Commit 8da0d694 authored by Shashank Sharma's avatar Shashank Sharma Committed by Alex Deucher
Browse files

drm/amdgpu: remove unused functions and variables



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: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: default avatarShashank Sharma <shashank.sharma@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a7c0cad0
Loading
Loading
Loading
Loading
+0 −32
Original line number Diff line number Diff line
@@ -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)
{
+0 −12
Original line number Diff line number Diff line
@@ -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
					   */
@@ -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;
@@ -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