aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2017-12-14 16:27:11 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-12-18 10:59:23 -0500
commit22cb0164378c6511423f79d429e0b2e4290934df (patch)
tree1287794b7b566e818a87320568be172559b61b00 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
parent8111c387275f64aae972d5717d32b0f756bb6e5f (diff)
drm/amdgpu: move amdgpu_doorbell_get_kfd_info to amdgpu_amdkfd.c
It's the only place it's used. Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 2ff4194fd153..ae9a3a0334d7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -438,38 +438,7 @@ static void amdgpu_device_doorbell_fini(struct amdgpu_device *adev)
438 adev->doorbell.ptr = NULL; 438 adev->doorbell.ptr = NULL;
439} 439}
440 440
441/** 441
442 * amdgpu_doorbell_get_kfd_info - Report doorbell configuration required to
443 * setup amdkfd
444 *
445 * @adev: amdgpu_device pointer
446 * @aperture_base: output returning doorbell aperture base physical address
447 * @aperture_size: output returning doorbell aperture size in bytes
448 * @start_offset: output returning # of doorbell bytes reserved for amdgpu.
449 *
450 * amdgpu and amdkfd share the doorbell aperture. amdgpu sets it up,
451 * takes doorbells required for its own rings and reports the setup to amdkfd.
452 * amdgpu reserved doorbells are at the start of the doorbell aperture.
453 */
454void amdgpu_doorbell_get_kfd_info(struct amdgpu_device *adev,
455 phys_addr_t *aperture_base,
456 size_t *aperture_size,
457 size_t *start_offset)
458{
459 /*
460 * The first num_doorbells are used by amdgpu.
461 * amdkfd takes whatever's left in the aperture.
462 */
463 if (adev->doorbell.size > adev->doorbell.num_doorbells * sizeof(u32)) {
464 *aperture_base = adev->doorbell.base;
465 *aperture_size = adev->doorbell.size;
466 *start_offset = adev->doorbell.num_doorbells * sizeof(u32);
467 } else {
468 *aperture_base = 0;
469 *aperture_size = 0;
470 *start_offset = 0;
471 }
472}
473 442
474/* 443/*
475 * amdgpu_device_wb_*() 444 * amdgpu_device_wb_*()