summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorSolomon Chiu <solomon.chiu@amd.com>2021-07-28 00:20:30 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-08-18 09:06:51 +0200
commitfcd957aa8b321c3ee7adf2f4446f476c217c16d9 (patch)
tree2505e017e8b3204f9b1fab801e3a09cb8f0e95f9 /drivers/gpu
parent7b69bee4817cdbdb9a0a7a6db595301c6349d7b7 (diff)
downloadlinux-stable-fcd957aa8b321c3ee7adf2f4446f476c217c16d9.tar.gz
linux-stable-fcd957aa8b321c3ee7adf2f4446f476c217c16d9.tar.bz2
linux-stable-fcd957aa8b321c3ee7adf2f4446f476c217c16d9.zip
drm/amdgpu: Add preferred mode in modeset when freesync video mode's enabled.
commit 46dd2965bdd1c5a4f6499c73ff32e636fa8f9769 upstream. [Why] With kernel module parameter "freesync_video" is enabled, if the mode is changed to preferred mode(the mode with highest rate), then Freesync fails because the preferred mode is treated as one of freesync video mode, and then be configurated as freesync video mode(fixed refresh rate). [How] Skip freesync fixed rate configurating when modeset to preferred mode. Signed-off-by: Solomon Chiu <solomon.chiu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 0894cd505361..ed221f815a1f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -9410,7 +9410,12 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
} else if (amdgpu_freesync_vid_mode && aconnector &&
is_freesync_video_mode(&new_crtc_state->mode,
aconnector)) {
- set_freesync_fixed_config(dm_new_crtc_state);
+ struct drm_display_mode *high_mode;
+
+ high_mode = get_highest_refresh_rate_mode(aconnector, false);
+ if (!drm_mode_equal(&new_crtc_state->mode, high_mode)) {
+ set_freesync_fixed_config(dm_new_crtc_state);
+ }
}
ret = dm_atomic_get_state(state, &dm_state);