Skip to content

Commit 8c97e87

Browse files
Horace Chenalexdeucher
authored andcommitted
drm/amdkfd: use correct method to get clock under SRIOV
[What] Current SRIOV still using adev->clock.default_XX which gets from atomfirmware. But these fields are abandoned in atomfirmware long ago. Which may cause function to return a 0 value. [How] We don't need to check whether SR-IOV. For SR-IOV one-vf-mode, pm is enabled and VF is able to read dpm clock from pmfw, so we can use dpm clock interface directly. For multi-VF mode, VF pm is disabled, so driver can just react as pm disabled. One-vf-mode is introduced from GFX9 so it shall not have any backward compatibility issue. Signed-off-by: Horace Chen <[email protected]> Acked-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 8f17789 commit 8c97e87

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,7 @@ void amdgpu_amdkfd_get_local_mem_info(struct amdgpu_device *adev,
442442
mem_info->local_mem_size_public,
443443
mem_info->local_mem_size_private);
444444

445-
if (amdgpu_sriov_vf(adev))
446-
mem_info->mem_clk_max = adev->clock.default_mclk / 100;
447-
else if (adev->pm.dpm_enabled) {
445+
if (adev->pm.dpm_enabled) {
448446
if (amdgpu_emu_mode == 1)
449447
mem_info->mem_clk_max = 0;
450448
else
@@ -463,9 +461,7 @@ uint64_t amdgpu_amdkfd_get_gpu_clock_counter(struct amdgpu_device *adev)
463461
uint32_t amdgpu_amdkfd_get_max_engine_clock_in_mhz(struct amdgpu_device *adev)
464462
{
465463
/* the sclk is in quantas of 10kHz */
466-
if (amdgpu_sriov_vf(adev))
467-
return adev->clock.default_sclk / 100;
468-
else if (adev->pm.dpm_enabled)
464+
if (adev->pm.dpm_enabled)
469465
return amdgpu_dpm_get_sclk(adev, false) / 100;
470466
else
471467
return 100;

0 commit comments

Comments
 (0)