diff options
author | Kenneth Feng <kenneth.feng@amd.com> | 2024-03-01 17:36:42 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2024-05-02 16:18:15 -0400 |
commit | 598a3b753af1947adbc542d1ebcc1863877589b0 (patch) | |
tree | ce81730918678ecb8d2f4dd043f0ac4d7dafec96 /drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | |
parent | 6f6bb3909cf7c45a7d36963368d718d1d2f31a97 (diff) |
drm/amd/amdgpu: enable sram fgcg on gc 12.0.1
enable sram fgcg on gc 12.0.1
Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Likun Gao <Likun.Gao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c index 2d0b21348d64..e5bf2984d8cb 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c @@ -3797,7 +3797,20 @@ static void gfx_v12_0_update_repeater_fgcg(struct amdgpu_device *adev, static void gfx_v12_0_update_sram_fgcg(struct amdgpu_device *adev, bool enable) { - /* TODO */ + uint32_t def, data; + + if (!(adev->cg_flags & AMD_CG_SUPPORT_GFX_FGCG)) + return; + + def = data = RREG32_SOC15(GC, 0, regRLC_CGTT_MGCG_OVERRIDE); + + if (enable) + data &= ~RLC_CGTT_MGCG_OVERRIDE__GFXIP_FGCG_OVERRIDE_MASK; + else + data |= RLC_CGTT_MGCG_OVERRIDE__GFXIP_FGCG_OVERRIDE_MASK; + + if (def != data) + WREG32_SOC15(GC, 0, regRLC_CGTT_MGCG_OVERRIDE, data); } static int gfx_v12_0_update_gfx_clock_gating(struct amdgpu_device *adev, |