Skip to contentSkip to conversation

drm/amd/display: Fix artifacting on eDP panels when engaging freesync video mode

PATCH In review Aurabindo Pillai 2 participants 2 messages May 18, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/amd/display: Fix artifacting on eDP panels when engaging freesync video mode

[Why]
When freesync video mode is enabled, switching resolution from native mode to one of the freesync video compatible modes can trigger continous artifacts on some eDP panels when running under KDE. The articating can be seen in the attached bug report.

[How]
Fix this by restricting updates that does not require full commit by using the same checks for stream and scaling changes in the the enable pass of dm_update_crtc_state() along with the check for compatible timings for freesync vide mode.

Fixes 541d54055b75 ("drm/amd/display: Fix hang when skipping modeset")
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -0
index 14b296e1d0f6..7f322b18eda6 100644
@@ -9285,6 +9285,8 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
 
 		/* Now check if we should set freesync video mode */
 		if (amdgpu_freesync_vid_mode && dm_new_crtc_state->stream &&
+		    dc_is_stream_unchanged(new_stream, dm_old_crtc_state->stream) &&
+		    dc_is_stream_scaling_unchanged(new_stream, dm_old_crtc_state->stream) &&
 		    is_timing_unchanged_for_freesync(new_crtc_state,
 						     old_crtc_state)) {
 			new_crtc_state->mode_changed = false;
Signature · 1 line
2.40.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 23 lines · Aurabindo Pillai

[Why]
When freesync video mode is enabled, switching resolution from native mode to one of the freesync video compatible modes can trigger continous artifacts on some eDP panels when running under KDE. The articating can be seen in the attached bug report.

[How]
Fix this by restricting updates that does not require full commit by using the same checks for stream and scaling changes in the the enable pass of dm_update_crtc_state() along with the check for compatible timings for freesync vide mode.

Fixes 541d54055b75 ("drm/amd/display: Fix hang when skipping modeset")
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index 14b296e1d0f6..7f322b18eda6 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int dm_update_crtc_state(struct amdgpu_display_manager *dm, · line 9292

Quoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -0
@@ -9285,6 +9285,8 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
 
  		/* Now check if we should set freesync video mode */
  		if (amdgpu_freesync_vid_mode && dm_new_crtc_state->stream &&
+		    dc_is_stream_unchanged(new_stream, dm_old_crtc_state->stream) &&
+		    dc_is_stream_scaling_unchanged(new_stream, dm_old_crtc_state->stream) &&
  		    is_timing_unchanged_for_freesync(new_crtc_state,
  						     old_crtc_state)) {
  			new_crtc_state->mode_changed = false;