AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Shashank Sharma <shashank.sharma@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: mukul.joshi@amd.com, Shashank Sharma <shashank.sharma@amd.com>,
	arvind.yadav@amd.com, Alex Deucher <alexander.deucher@amd.com>,
	contactshashanksharma@gmail.com,
	Christian Koenig <christian.koenig@amd.com>
Subject: [PATCH v2 10/12] drm/amdgpu: remove unused functions and variables
Date: Wed, 12 Apr 2023 18:25:34 +0200	[thread overview]
Message-ID: <20230412162537.1357-11-shashank.sharma@amd.com> (raw)
In-Reply-To: <20230412162537.1357-1-shashank.sharma@amd.com>

This patch removes some variables and functions from KFD
doorbell handling code, which are no more required since
doorbell manager is handling doorbell calculations.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian Koenig <christian.koenig@amd.com>
Signed-off-by: Shashank Sharma <shashank.sharma@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c | 32 -----------------------
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h     | 12 ---------
 2 files changed, 44 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c b/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c
index 718cfe9cb4f5..f4088cfd52db 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c
@@ -193,38 +193,6 @@ void write_kernel_doorbell64(void __iomem *db, u64 value)
 	}
 }
 
-unsigned int kfd_get_doorbell_dw_offset_in_bar(struct kfd_dev *kfd,
-					struct kfd_process_device *pdd,
-					unsigned int doorbell_id)
-{
-	/*
-	 * doorbell_base_dw_offset accounts for doorbells taken by KGD.
-	 * index * kfd_doorbell_process_slice/sizeof(u32) adjusts to
-	 * the process's doorbells. The offset returned is in dword
-	 * units regardless of the ASIC-dependent doorbell size.
-	 */
-	if (!kfd->shared_resources.enable_mes)
-		return kfd->doorbell_base_dw_offset +
-			pdd->doorbell_index
-			* kfd_doorbell_process_slice(kfd) / sizeof(u32) +
-			doorbell_id *
-			kfd->device_info.doorbell_size / sizeof(u32);
-	else
-		return amdgpu_mes_get_doorbell_dw_offset_in_bar(
-				(struct amdgpu_device *)kfd->adev,
-				pdd->doorbell_index, doorbell_id);
-}
-
-uint64_t kfd_get_number_elems(struct kfd_dev *kfd)
-{
-	uint64_t num_of_elems = (kfd->shared_resources.doorbell_aperture_size -
-				kfd->shared_resources.doorbell_start_offset) /
-					kfd_doorbell_process_slice(kfd) + 1;
-
-	return num_of_elems;
-
-}
-
 phys_addr_t kfd_get_process_doorbells(struct kfd_process_device *pdd)
 {
 	struct amdgpu_device *adev = pdd->dev->adev;
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
index dfff77379acb..1bc6a8ed8cda 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
@@ -257,15 +257,6 @@ struct kfd_dev {
 
 	unsigned int id;		/* topology stub index */
 
-	phys_addr_t doorbell_base;	/* Start of actual doorbells used by
-					 * KFD. It is aligned for mapping
-					 * into user mode
-					 */
-	size_t doorbell_base_dw_offset;	/* Offset from the start of the PCI
-					 * doorbell BAR to the first KFD
-					 * doorbell in dwords. GFX reserves
-					 * the segment before this offset.
-					 */
 	u32 __iomem *doorbell_kernel_ptr; /* This is a pointer for a doorbells
 					   * page used by kernel queue
 					   */
@@ -276,8 +267,6 @@ struct kfd_dev {
 
 	const struct kfd2kgd_calls *kfd2kgd;
 	struct mutex doorbell_mutex;
-	DECLARE_BITMAP(doorbell_available_index,
-			KFD_MAX_NUM_OF_QUEUES_PER_PROCESS);
 
 	void *gtt_mem;
 	uint64_t gtt_start_gpu_addr;
@@ -754,7 +743,6 @@ struct kfd_process_device {
 	struct attribute attr_evict;
 
 	struct kobject *kobj_stats;
-	unsigned int doorbell_index;
 
 	/*
 	 * @cu_occupancy: Reports occupancy of Compute Units (CU) of a process
-- 
2.40.0


  parent reply	other threads:[~2023-04-12 16:26 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12 16:25 [PATCH v2 00/12] AMDGPU doorbell manager Shashank Sharma
2023-04-12 16:25 ` [PATCH v2 01/12] drm/amdgpu: create a new file for " Shashank Sharma
2023-04-13 10:48   ` Christian König
2023-04-13 10:51     ` Christian König
2023-04-12 16:25 ` [PATCH v2 02/12] drm/amdgpu: don't modify num_doorbells for mes Shashank Sharma
2023-04-12 16:25 ` [PATCH v2 03/12] drm/amdgpu: add UAPI for allocating doorbell memory Shashank Sharma
2023-04-12 16:25 ` [PATCH v2 04/12] drm/amdgpu: accommodate DOMAIN/PL_DOORBELL Shashank Sharma
2023-04-12 16:25 ` [PATCH v2 05/12] drm/amdgpu: initialize ttm for doorbells Shashank Sharma
2023-04-12 16:25 ` [PATCH v2 06/12] drm/amdgpu: create kernel doorbell pages Shashank Sharma
2023-04-12 16:25 ` [PATCH v2 07/12] get absolute offset from doorbell index Shashank Sharma
2023-04-13 10:59   ` Christian König
2023-04-12 16:25 ` [PATCH v2 08/12] drm/amdgpu: use doorbell manager for kfd kernel doorbells Shashank Sharma
2023-04-13 11:02   ` Christian König
2023-04-13 13:08     ` Shashank Sharma
2023-04-21 19:58   ` Felix Kuehling
2023-04-22  6:39     ` Shashank Sharma
2023-04-24 19:56       ` Felix Kuehling
2023-04-25 19:59         ` Shashank Sharma
2023-06-09 19:33           ` Felix Kuehling
2023-04-12 16:25 ` [PATCH v2 09/12] drm/amdgpu: use doorbell manager for kfd process doorbells Shashank Sharma
2023-04-13 11:07   ` Christian König
2023-04-21 20:11   ` Felix Kuehling
2023-04-22  6:45     ` Shashank Sharma
2023-04-12 16:25 ` Shashank Sharma [this message]
2023-06-09 19:34   ` [PATCH v2 10/12] drm/amdgpu: remove unused functions and variables Felix Kuehling
2023-04-12 16:25 ` [PATCH v2 11/12] drm/amdgpu: use doorbell mgr for MES kernel doorbells Shashank Sharma
2023-04-12 16:25 ` [PATCH v2 12/12] drm/amdgpu: cleanup MES process level doorbells Shashank Sharma
2023-04-13 11:19   ` Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230412162537.1357-11-shashank.sharma@amd.com \
    --to=shashank.sharma@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=arvind.yadav@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=contactshashanksharma@gmail.com \
    --cc=mukul.joshi@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox