Skip to content

Commit 637fee3

Browse files
committed
drm/amdgpu/soc21: fix xclk for APUs
The reference clock is supposed to be 100Mhz, but it appears to actually be slightly lower (99.81Mhz). Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14451 Reviewed-by: Jesse Zhang <Jesse.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 05762d9 commit 637fee3

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,13 @@ static u32 soc21_get_config_memsize(struct amdgpu_device *adev)
256256

257257
static u32 soc21_get_xclk(struct amdgpu_device *adev)
258258
{
259-
return adev->clock.spll.reference_freq;
259+
u32 reference_clock = adev->clock.spll.reference_freq;
260+
261+
/* reference clock is actually 99.81 Mhz rather than 100 Mhz */
262+
if ((adev->flags & AMD_IS_APU) && reference_clock == 10000)
263+
return 9981;
264+
265+
return reference_clock;
260266
}
261267

262268

0 commit comments

Comments
 (0)