Skip to content

Commit b316727

Browse files
soyersoyeralexdeucher
authored andcommitted
drm/amd/display: do not copy invalid CRTC timing info
Since b255ce4, it is possible that the CRTC timing information for the preferred mode has not yet been calculated while amdgpu_dm_connector_mode_valid() is running. In this case use the CRTC timing information of the actual mode. Fixes: b255ce4 ("drm/amdgpu: don't change mode in amdgpu_dm_connector_mode_valid()") Closes: https://lore.kernel.org/all/ed09edb167e74167a694f4854102a3de6d2f1433.camel@irl.hu/ Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4085 Signed-off-by: Gergo Koteles <soyer@irl.hu> Reviewed-by: Zaeem Mohamed <zaeem.mohamed@amd.com> Tested-by: Mark Broadworth <mark.broadworth@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 2023219) Cc: stable@vger.kernel.org
1 parent 6ed0dc3 commit b316727

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6501,12 +6501,12 @@ decide_crtc_timing_for_drm_display_mode(struct drm_display_mode *drm_mode,
65016501
const struct drm_display_mode *native_mode,
65026502
bool scale_enabled)
65036503
{
6504-
if (scale_enabled) {
6505-
copy_crtc_timing_for_drm_display_mode(native_mode, drm_mode);
6506-
} else if (native_mode->clock == drm_mode->clock &&
6507-
native_mode->htotal == drm_mode->htotal &&
6508-
native_mode->vtotal == drm_mode->vtotal) {
6509-
copy_crtc_timing_for_drm_display_mode(native_mode, drm_mode);
6504+
if (scale_enabled || (
6505+
native_mode->clock == drm_mode->clock &&
6506+
native_mode->htotal == drm_mode->htotal &&
6507+
native_mode->vtotal == drm_mode->vtotal)) {
6508+
if (native_mode->crtc_clock)
6509+
copy_crtc_timing_for_drm_display_mode(native_mode, drm_mode);
65106510
} else {
65116511
/* no scaling nor amdgpu inserted, no need to patch */
65126512
}

0 commit comments

Comments
 (0)