drm/amdgpu: enable MGCG/FGCG/PERF_CLK for GC 11.0.2
Subsystems (2)
PATCH 1/1 drm/amdgpu: enable MGCG/FGCG/PERF_CLK for GC 11.0.2
GC 11.0.2 (Navi33) never got the GFX MGCG, FGCG and PERF_CLK clock gating flags. GC 11.0.0, 11.0.1 and 11.0.4 have all three, GC 11.0.3 has MGCG. The gfx_v11_0 code behind these flags is shared by all GC 11 parts. Enable them for GC 11.0.2, same as for GC 11.0.0.
Without the flags the driver does not clear the override bits in RLC_CGTT_MGCG_OVERRIDE (0x000605e7 under load), so this gating stays off. On RX 7600S the GFX clock is limited by the GFX TDC limit (68 A), in Linux and in Windows. With the gating off each MHz costs more GFX current, so PMFW stops at a lower clock than in Windows.
vkpeak fp32-scalar for 300 s, median after the first 60 s, GFX current is about 68 A (TDC limit) in all cases:
gfxclk VDDGFX GFLOPS current flags 2030 MHz 800 mV 8915 + MGCG 2261 MHz 873 mV 9921 + MGCG, FGCG, PERF_CLK 2314 MHz 894 mV 10104 Windows 11, AMD driver 910 mV 10157-10186
GFLOPS per MHz is the same, only the current per clock goes down. Windows shows other clock sensors, so there I compare GFLOPS only. With all three flags vkpeak is within 1% of Windows. MGCG gives most of the gain, FGCG and PERF_CLK add about 2% more.
Tested on one laptop, ASUS TUF A16 FA617NS (RX 7600S, PMFW 82.97.0), Fedora kernel 7.2.11, Mesa 26.2.5, with the same flags set by a local debug patch. One 300 s vkpeak run for each setting and some gaming, no amdgpu errors in dmesg. Suspend/resume and long runs are not tested yet.
---
I have only this one Navi33 laptop. I could not find why these flags were left off for GC 11.0.2. If there is a hardware reason (errata), please tell me. If only FGCG or PERF_CLK is the problem, MGCG alone still gives most of the gain (+11% GFLOPS), and I can send a v2 with MGCG only.
Logs, register values and the Windows numbers are in the issue linked above.
drivers/gpu/drm/amd/amdgpu/soc21.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/soc21.c +3 -0
@@ -599,7 +599,10 @@ static int soc21_common_early_init(struct amdgpu_ip_block *ip_block) adev->cg_flags =AMD_CG_SUPPORT_GFX_CGCG |AMD_CG_SUPPORT_GFX_CGLS | +AMD_CG_SUPPORT_GFX_MGCG |AMD_CG_SUPPORT_REPEATER_FGCG | +AMD_CG_SUPPORT_GFX_FGCG | +AMD_CG_SUPPORT_GFX_PERF_CLK |AMD_CG_SUPPORT_VCN_MGCG |AMD_CG_SUPPORT_JPEG_MGCG | AMD_CG_SUPPORT_ATHUB_MGCG |
base-commit: ba496bb837882eb1af58f41572fc289e46c77b8c
Signature · 1 line
2.56.0
AMD General
Thanks for the fix.
I just remember that there was an issue on MGCG so it was not enabled at the beginning, but I forgot the details, apology.
-----Original Message-----
From: Andrei Krautsou <[email protected]>
Sent: Tuesday, November 3, 2026 8:02 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Feng, Kenneth <[email protected]>; Andrei Krautsou <[email protected]>
Subject: [PATCH] drm/amdgpu: enable MGCG/FGCG/PERF_CLK for GC 11.0.2
[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
GC 11.0.2 (Navi33) never got the GFX MGCG, FGCG and PERF_CLK clock gating flags. GC 11.0.0, 11.0.1 and 11.0.4 have all three, GC 11.0.3 has MGCG. The gfx_v11_0 code behind these flags is shared by all GC 11 parts. Enable them for GC 11.0.2, same as for GC 11.0.0.
Without the flags the driver does not clear the override bits in RLC_CGTT_MGCG_OVERRIDE (0x000605e7 under load), so this gating stays off. On RX 7600S the GFX clock is limited by the GFX TDC limit (68 A), in Linux and in Windows. With the gating off each MHz costs more GFX current, so PMFW stops at a lower clock than in Windows.
vkpeak fp32-scalar for 300 s, median after the first 60 s, GFX current is about 68 A (TDC limit) in all cases:
gfxclk VDDGFX GFLOPS current flags 2030 MHz 800 mV 8915 + MGCG 2261 MHz 873 mV 9921 + MGCG, FGCG, PERF_CLK 2314 MHz 894 mV 10104 Windows 11, AMD driver 910 mV 10157-10186
GFLOPS per MHz is the same, only the current per clock goes down.
Windows shows other clock sensors, so there I compare GFLOPS only.
With all three flags vkpeak is within 1% of Windows. MGCG gives most of the gain, FGCG and PERF_CLK add about 2% more.
Tested on one laptop, ASUS TUF A16 FA617NS (RX 7600S, PMFW 82.97.0), Fedora kernel 7.2.11, Mesa 26.2.5, with the same flags set by a local debug patch. One 300 s vkpeak run for each setting and some gaming, no amdgpu errors in dmesg. Suspend/resume and long runs are not tested yet.
---
I have only this one Navi33 laptop. I could not find why these flags were left off for GC 11.0.2. If there is a hardware reason (errata), please tell me. If only FGCG or PERF_CLK is the problem, MGCG alone still gives most of the gain (+11% GFLOPS), and I can send a v2 with MGCG only.
Logs, register values and the Windows numbers are in the issue linked above.
drivers/gpu/drm/amd/amdgpu/soc21.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/soc21.c +3 -0
@@ -599,7 +599,10 @@ static int soc21_common_early_init(struct amdgpu_ip_block *ip_block) adev->cg_flags =AMD_CG_SUPPORT_GFX_CGCG |AMD_CG_SUPPORT_GFX_CGLS | +AMD_CG_SUPPORT_GFX_MGCG |AMD_CG_SUPPORT_REPEATER_FGCG | +AMD_CG_SUPPORT_GFX_FGCG | +AMD_CG_SUPPORT_GFX_PERF_CLK |AMD_CG_SUPPORT_VCN_MGCG |AMD_CG_SUPPORT_JPEG_MGCG | AMD_CG_SUPPORT_ATHUB_MGCG |
base-commit: ba496bb837882eb1af58f41572fc289e46c77b8c --
2.56.0
Alex Deucher
AppliedApplied. Thanks!
Quoted 65 lines · Kenneth
AMD General
Thanks for the fix.
I just remember that there was an issue on MGCG so it was not enabled at the beginning, but I forgot the details, apology.Reviewed-by Kenneth Feng <[email protected]>-----Original Message-----
From: Andrei Krautsou <[email protected]>
Sent: Tuesday, November 3, 2026 8:02 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Feng, Kenneth <[email protected]>; Andrei Krautsou <[email protected]>
Subject: [PATCH] drm/amdgpu: enable MGCG/FGCG/PERF_CLK for GC 11.0.2[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
GC 11.0.2 (Navi33) never got the GFX MGCG, FGCG and
PERF_CLKclock gating flags. GC 11.0.0, 11.0.1 and 11.0.4 have all three, GC 11.0.3 has MGCG. Thegfx_v11_0code behind these flags is shared by all GC 11 parts. Enable them for GC 11.0.2, same as for GC 11.0.0.Without the flags the driver does not clear the override bits in
RLC_CGTT_MGCG_OVERRIDE(0x000605e7under load), so this gating stays off. On RX 7600S the GFX clock is limited by the GFX TDC limit (68 A), in Linux and in Windows. With the gating off each MHz costs more GFX current, so PMFW stops at a lower clock than in Windows.vkpeak fp32-scalar for 300 s, median after the first 60 s, GFX current is about 68 A (TDC limit) in all cases:
gfxclk VDDGFX GFLOPS current flags 2030 MHz 800 mV 8915 + MGCG 2261 MHz 873 mV 9921 + MGCG, FGCG, PERF_CLK 2314 MHz 894 mV 10104 Windows 11, AMD driver 910 mV 10157-10186GFLOPS per MHz is the same, only the current per clock goes down.
Windows shows other clock sensors, so there I compare GFLOPS only.
With all three flags vkpeak is within 1% of Windows. MGCG gives most of the gain, FGCG andPERF_CLKadd about 2% more.Tested on one laptop, ASUS TUF A16 FA617NS (RX 7600S, PMFW 82.97.0), Fedora kernel 7.2.11, Mesa 26.2.5, with the same flags set by a local debug patch. One 300 s vkpeak run for each setting and some gaming, no amdgpu errors in dmesg. Suspend/resume and long runs are not tested yet.
Signed-off-by Andrei Krautsou <[email protected]>---
I have only this one Navi33 laptop. I could not find why these flags were left off for GC 11.0.2. If there is a hardware reason (errata), please tell me. If only FGCG orPERF_CLKis the problem, MGCG alone still gives most of the gain (+11% GFLOPS), and I can send a v2 with MGCG only.Logs, register values and the Windows numbers are in the issue linked above.
drivers/gpu/drm/amd/amdgpu/soc21.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/amdgpu/soc21.c +3
-0@@ -599,7 +599,10 @@ static int soc21_common_early_init(struct amdgpu_ip_block *ip_block) adev->cg_flags =AMD_CG_SUPPORT_GFX_CGCG |AMD_CG_SUPPORT_GFX_CGLS | +AMD_CG_SUPPORT_GFX_MGCG |AMD_CG_SUPPORT_REPEATER_FGCG | +AMD_CG_SUPPORT_GFX_FGCG | +AMD_CG_SUPPORT_GFX_PERF_CLK |AMD_CG_SUPPORT_VCN_MGCG |AMD_CG_SUPPORT_JPEG_MGCG | AMD_CG_SUPPORT_ATHUB_MGCG |base-commit:
ba496bb837882eb1af58f41572fc289e46c77b8c--
2.56.0