]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu/cgs: always set reference clock in mode_info
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 30 Jun 2017 13:58:34 +0000 (09:58 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2017 22:10:13 +0000 (15:10 -0700)
commit 73cc90798ff765341a1d9c2cfe18153ab231c9bb upstream.

It's relevent regardless of whether there are displays
enabled.  Fixes garbage values for ref clock in powerplay
leading to incorrect fan speed reporting when displays
are disabled.

bug: https://bugs.freedesktop.org/show_bug.cgi?id=101653
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c

index 8b8eda7d1703dd2e2955a34e2df12c43f2052dfd..c0a806280257c80954930c3744d7cd65e6b6de5f 100644 (file)
@@ -838,9 +838,12 @@ static int amdgpu_cgs_get_active_displays_info(struct cgs_device *cgs_device,
                return -EINVAL;
 
        mode_info = info->mode_info;
-       if (mode_info)
+       if (mode_info) {
                /* if the displays are off, vblank time is max */
                mode_info->vblank_time_us = 0xffffffff;
+               /* always set the reference clock */
+               mode_info->ref_clock = adev->clock.spll.reference_freq;
+       }
 
        if (adev->mode_info.num_crtc && adev->mode_info.mode_config_initialized) {
                list_for_each_entry(crtc,