Skip to content

Commit 064a3e6

Browse files
committed
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: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Alex Deucher <[email protected]>
1 parent 2a8d3ea commit 064a3e6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpu/drm/drm_modes.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,9 @@ EXPORT_SYMBOL(drm_mode_equal_no_clocks_no_stereo);
10361036
enum drm_mode_status
10371037
drm_mode_validate_basic(const struct drm_display_mode *mode)
10381038
{
1039+
if ((mode->flags & DRM_MODE_FLAG_3D_MASK) > DRM_MODE_FLAG_3D_MAX)
1040+
return MODE_BAD;
1041+
10391042
if (mode->clock == 0)
10401043
return MODE_CLOCK_LOW;
10411044

@@ -1574,9 +1577,6 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
15741577
goto out;
15751578
}
15761579

1577-
if ((in->flags & DRM_MODE_FLAG_3D_MASK) > DRM_MODE_FLAG_3D_MAX)
1578-
goto out;
1579-
15801580
out->clock = in->clock;
15811581
out->hdisplay = in->hdisplay;
15821582
out->hsync_start = in->hsync_start;

0 commit comments

Comments
 (0)