af29bdab811c11d8a0c4370a558ff4102ca29dbe
[oweals/openwrt.git] /
1 From d4df2766945e0410d1975434f34e647e7e13b992 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Wed, 10 Apr 2019 17:43:57 +0100
4 Subject: [PATCH] drm: vc4: Bring fkms into line with kms in blocking
5  doublescan modes
6
7 Implement vc4_crtc_mode_valid so that it blocks doublescan modes
8
9 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
10 ---
11  drivers/gpu/drm/vc4/vc4_firmware_kms.c | 15 +++++++++++++--
12  1 file changed, 13 insertions(+), 2 deletions(-)
13
14 --- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c
15 +++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c
16 @@ -625,7 +625,17 @@ static void vc4_crtc_enable(struct drm_c
17                         vc4_plane_set_blank(plane, plane->state->visible);
18  }
19  
20 +static enum drm_mode_status
21 +vc4_crtc_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode)
22 +{
23 +       /* Do not allow doublescan modes from user space */
24 +       if (mode->flags & DRM_MODE_FLAG_DBLSCAN) {
25 +               DRM_DEBUG_KMS("[CRTC:%d] Doublescan mode rejected.\n",
26 +                             crtc->base.id);
27 +               return MODE_NO_DBLESCAN;
28 +       }
29  
30 +       return MODE_OK;
31  }
32  
33  static int vc4_crtc_atomic_check(struct drm_crtc *crtc,
34 @@ -735,10 +745,11 @@ static const struct drm_crtc_funcs vc4_c
35  
36  static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = {
37         .mode_set_nofb = vc4_crtc_mode_set_nofb,
38 -       .atomic_disable = vc4_crtc_disable,
39 -       .atomic_enable = vc4_crtc_enable,
40 +       .mode_valid = vc4_crtc_mode_valid,
41         .atomic_check = vc4_crtc_atomic_check,
42         .atomic_flush = vc4_crtc_atomic_flush,
43 +       .atomic_enable = vc4_crtc_enable,
44 +       .atomic_disable = vc4_crtc_disable,
45  };
46  
47  static const struct of_device_id vc4_firmware_kms_dt_match[] = {