Skip to content

Commit

Permalink
drm/amdgpu: remove unused functions and variables
Browse files Browse the repository at this point in the history
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>
Cc: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Shashank Sharma <shashank.sharma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Shashank Sharma authored and Alex Deucher committed Aug 7, 2023
1 parent a7c0cad commit 8da0d69
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 44 deletions.
32 changes: 0 additions & 32 deletions drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,38 +200,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;

}

static int init_doorbell_bitmap(struct qcm_process_device *qpd,
struct kfd_dev *dev)
{
Expand Down
12 changes: 0 additions & 12 deletions drivers/gpu/drm/amd/amdkfd/kfd_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,15 +323,6 @@ struct kfd_dev {

struct kfd_device_info device_info;

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
*/
Expand All @@ -340,8 +331,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;
Expand Down Expand Up @@ -801,7 +790,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
Expand Down

0 comments on commit 8da0d69

Please sign in to comment.