projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1deee8d
)
drm: Reject modes with more than 1 stereo flags set
author
Damien Lespiau
<
[email protected]
>
Wed, 25 Sep 2013 15:45:25 +0000
(16:45 +0100)
committer
Daniel Vetter
<
[email protected]
>
Tue, 1 Oct 2013 05:45:29 +0000
(07:45 +0200)
When setting a stereo 3D mode, there can be only one bit set describing
the layout of the frambuffer(s). So reject invalid modes early.
Reviewed-by: Ville Syrjälä <
[email protected]
>
Signed-off-by: Damien Lespiau <
[email protected]
>
Acked-by: Dave Airlie <
[email protected]
>
Signed-off-by: Daniel Vetter <
[email protected]
>
drivers/gpu/drm/drm_crtc.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/drm_crtc.c
b/drivers/gpu/drm/drm_crtc.c
index 454ac8a6381cf590c7d2eff615df38c659c19a2a..090415f418b8eb2030ce0a79b90299187b4b2af3 100644
(file)
--- a/
drivers/gpu/drm/drm_crtc.c
+++ b/
drivers/gpu/drm/drm_crtc.c
@@
-1319,6
+1319,10
@@
static int drm_crtc_convert_umode(struct drm_display_mode *out,
if (in->clock > INT_MAX || in->vrefresh > INT_MAX)
return -ERANGE;
+ /* At most, 1 set bit describing the 3D layout of the mode */
+ if (hweight32(in->flags & DRM_MODE_FLAG_3D_MASK) > 1)
+ return -EINVAL;
+
out->clock = in->clock;
out->hdisplay = in->hdisplay;
out->hsync_start = in->hsync_start;