Commit 064a3e6e authored by Ville Syrjälä's avatar Ville Syrjälä

drm/modes: Move 3D stereo flag check into drm_mode_validate_basic()

Currently we don't sanity check the 3D stereo flags for modes filled out
by the kernel. Move the check from drm_mode_convert_umode() into
drm_mode_validate_basic() so that we get the same check going both ways.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171114183258.16976-2-ville.syrjala@linux.intel.comReviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2a8d3eac
...@@ -1036,6 +1036,9 @@ EXPORT_SYMBOL(drm_mode_equal_no_clocks_no_stereo); ...@@ -1036,6 +1036,9 @@ EXPORT_SYMBOL(drm_mode_equal_no_clocks_no_stereo);
enum drm_mode_status enum drm_mode_status
drm_mode_validate_basic(const struct drm_display_mode *mode) drm_mode_validate_basic(const struct drm_display_mode *mode)
{ {
if ((mode->flags & DRM_MODE_FLAG_3D_MASK) > DRM_MODE_FLAG_3D_MAX)
return MODE_BAD;
if (mode->clock == 0) if (mode->clock == 0)
return MODE_CLOCK_LOW; return MODE_CLOCK_LOW;
...@@ -1574,9 +1577,6 @@ int drm_mode_convert_umode(struct drm_display_mode *out, ...@@ -1574,9 +1577,6 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
goto out; goto out;
} }
if ((in->flags & DRM_MODE_FLAG_3D_MASK) > DRM_MODE_FLAG_3D_MAX)
goto out;
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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment