提交 a3ff6d56 编写于 作者: D Damien Lespiau 提交者: Daniel Vetter

drm: Reject modes with more than 1 stereo flags set

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: NVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
Acked-by: NDave Airlie <airlied@gmail.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 1deee8d7
...@@ -1319,6 +1319,10 @@ static int drm_crtc_convert_umode(struct drm_display_mode *out, ...@@ -1319,6 +1319,10 @@ static int drm_crtc_convert_umode(struct drm_display_mode *out,
if (in->clock > INT_MAX || in->vrefresh > INT_MAX) if (in->clock > INT_MAX || in->vrefresh > INT_MAX)
return -ERANGE; 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->clock = in->clock;
out->hdisplay = in->hdisplay; out->hdisplay = in->hdisplay;
out->hsync_start = in->hsync_start; out->hsync_start = in->hsync_start;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册