Skip to content

Commit 9a6d87f

Browse files
alexdeuchergregkh
authored andcommitted
drm/amdgpu/soc21: fix xclk for APUs
commit e7fbff9 upstream. 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> (cherry picked from commit 637fee3) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5f841c3 commit 9a6d87f

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
@@ -225,7 +225,13 @@ static u32 soc21_get_config_memsize(struct amdgpu_device *adev)
225225

226226
static u32 soc21_get_xclk(struct amdgpu_device *adev)
227227
{
228-
return adev->clock.spll.reference_freq;
228+
u32 reference_clock = adev->clock.spll.reference_freq;
229+
230+
/* reference clock is actually 99.81 Mhz rather than 100 Mhz */
231+
if ((adev->flags & AMD_IS_APU) && reference_clock == 10000)
232+
return 9981;
233+
234+
return reference_clock;
229235
}
230236

231237

0 commit comments

Comments
 (0)