aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.4/0517-drm-vc4-Reject-doublescan-modes.patch
blob: a3a26e4bfa9c94b6d5e96fdc8aa40489cfb2b37a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 39d618a032d26655dfa62299034394e5d1ea7712 Mon Sep 17 00:00:00 2001
From: Mario Kleiner <mario.kleiner.de@gmail.com>
Date: Tue, 19 Jul 2016 20:58:59 +0200
Subject: [PATCH] drm/vc4: Reject doublescan modes.

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 | 7 +++++++
 1 file changed, 7 insertions(+)

--- a/drivers/gpu/drm/vc4/vc4_crtc.c
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
@@ -542,6 +542,13 @@ static bool vc4_crtc_mode_fixup(struct d
 				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