]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/modes: Make sure to parse valid rotation value from cmdline
authorStephan Gerhold <stephan@gerhold.net>
Fri, 17 Jan 2020 15:34:28 +0000 (16:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Mar 2020 06:18:24 +0000 (07:18 +0100)
commitb7207241d1300613000e7c271e6047a3f5975349
tree3e4ac9f20d133addf22757683534a1c04b41b969
parent3432b2fe45a6a9e78851cd14ec21e2d421a22061
drm/modes: Make sure to parse valid rotation value from cmdline

[ Upstream commit e6980a727154b793adb218fbc7b4d6af52a7e364 ]

A rotation value should have exactly one rotation angle.
At the moment there is no validation for this when parsing video=
parameters from the command line. This causes problems later on
when we try to combine the command line rotation with the panel
orientation.

To make sure that we generate a valid rotation value:
  - Set DRM_MODE_ROTATE_0 by default (if no rotate= option is set)
  - Validate that there is exactly one rotation angle set
    (i.e. specifying the rotate= option multiple times is invalid)

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20200117153429.54700-2-stephan@gerhold.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/drm_modes.c
drivers/gpu/drm/selftests/drm_cmdline_selftests.h
drivers/gpu/drm/selftests/test-drm_cmdline_parser.c