drm/nouveau/kms/nv50-: fix panel scaling

This change “drm/nouveau/kms/nv50-: fix panel scaling” (commit 3d1890e) in Linux kernel is authored by Ben Skeggs <bskeggs [at] redhat.com> on Tue Dec 10 12:15:44 2019 +1000.

Description of "drm/nouveau/kms/nv50-: fix panel scaling"

The change “drm/nouveau/kms/nv50-: fix panel scaling” introduces changes as follows.

drm/nouveau/kms/nv50-: fix panel scaling

Under certain circumstances, encoder atomic_check() can be entered
without adjusted_mode having been reset to the same as mode, which
confuses the scaling logic and can lead to a misprogrammed display.

Fix this by checking against the user-provided mode directly.

Link: https://bugs.freedesktop.org/show_bug.cgi?id=108615
Link: https://gitlab.freedesktop.org/xorg/driver/xf86-video-nouveau/issues/464
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

Linux kernel releases containing commit 3d1890e

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "drm/nouveau/kms/nv50-: fix panel scaling"

There are 6 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/gpu/drm/nouveau/dispnv50/disp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index 9ac47fe519f8..63425e246018 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -326,9 +326,9 @@ nv50_outp_atomic_check_view(struct drm_encoder *encoder,
 			 * same size as the native one (e.g. different
 			 * refresh rate)
-			if (adjusted_mode->hdisplay == native_mode->hdisplay &&
-			    adjusted_mode->vdisplay == native_mode->vdisplay &&
-			    adjusted_mode->type & DRM_MODE_TYPE_DRIVER)
+			if (mode->hdisplay == native_mode->hdisplay &&
+			    mode->vdisplay == native_mode->vdisplay &&
+			    mode->type & DRM_MODE_TYPE_DRIVER)
 			mode = native_mode;
 			asyc->scaler.full = true;

The commit for this change in Linux stable tree is 3d1890e (patch).

Last modified: 2020/02/08