summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/smuio_v11_0.c
diff options
context:
space:
mode:
authorEvan Quan <evan.quan@amd.com>2021-05-25 18:24:47 +0800
committerAlex Deucher <alexander.deucher@amd.com>2021-06-30 00:18:22 -0400
commit754e9883d48c2e3a50c4d53c42905e25df3862c7 (patch)
treec18d4abd56ae1705fc5179a29bf3fa1f17024084 /drivers/gpu/drm/amd/amdgpu/smuio_v11_0.c
parentadcf949e664a8b04df2fb8aa916892e58561653c (diff)
drm/amdgpu: correct clock gating settings on feature unsupported
Clock gating setting is still performed even when the corresponding CG feature is not supported. And the tricky part is disablement is actually performed no matter for enablement or disablement request. That seems not logically right. Considering HW should already properly take care of the CG state, we will just skip the corresponding clock gating setting when the feature is not supported. Signed-off-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/smuio_v11_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/smuio_v11_0.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/smuio_v11_0.c b/drivers/gpu/drm/amd/amdgpu/smuio_v11_0.c
index e9c474c217ec..b6f1322f908c 100644
--- a/drivers/gpu/drm/amd/amdgpu/smuio_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/smuio_v11_0.c
@@ -43,9 +43,12 @@ static void smuio_v11_0_update_rom_clock_gating(struct amdgpu_device *adev, bool
if (adev->flags & AMD_IS_APU)
return;
+ if (!(adev->cg_flags & AMD_CG_SUPPORT_ROM_MGCG))
+ return;
+
def = data = RREG32_SOC15(SMUIO, 0, mmCGTT_ROM_CLK_CTRL0);
- if (enable && (adev->cg_flags & AMD_CG_SUPPORT_ROM_MGCG))
+ if (enable)
data &= ~(CGTT_ROM_CLK_CTRL0__SOFT_OVERRIDE0_MASK |
CGTT_ROM_CLK_CTRL0__SOFT_OVERRIDE1_MASK);
else