drm/vc4: Reject doublescan modes.
authorMario Kleiner <mario.kleiner.de@gmail.com>
Tue, 19 Jul 2016 18:58:59 +0000 (20:58 +0200)
committerEric Anholt <eric@anholt.net>
Sat, 20 Aug 2016 02:05:52 +0000 (19:05 -0700)
We can't handle doublescan modes at the moment, so if
userspace tries to set one, reject the mode set.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/vc4/vc4_crtc.c

index a479d3d840c59257aaf0f411cc9600f4915bb62c..2bfa2470e66b3fb5aa3692c66cb803973985f68f 100644 (file)
@@ -536,6 +536,13 @@ static bool vc4_crtc_mode_fixup(struct drm_crtc *crtc,
                                const struct drm_display_mode *mode,
                                struct drm_display_mode *adjusted_mode)
 {
+       /* Do not allow doublescan modes from user space */
+       if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) {
+               DRM_DEBUG_KMS("[CRTC:%d] Doublescan mode rejected.\n",
+                             crtc->base.id);
+               return false;
+       }
+
        /*
         * Interlaced video modes got CRTC_INTERLACE_HALVE_V applied when
         * coming from user space. We don't want this, as it screws up