1 From d3c76025a7de614fade5ffcaa8c1d88d8d64213e Mon Sep 17 00:00:00 2001
2 From: Hans de Goede <hdegoede@redhat.com>
3 Date: Mon, 18 Nov 2019 16:51:27 +0100
4 Subject: [PATCH] drm/modes: parse_cmdline: Add freestanding argument
5 to drm_mode_parse_cmdline_options()
7 Commit 99e2716e053734b70434502867be24d20a3e2d84 upstream.
9 Add a freestanding function argument to drm_mode_parse_cmdline_options()
10 similar to how drm_mode_parse_cmdline_extra() already has this.
12 This is a preparation patch for allowing parsing of stand-alone options
13 without a mode before them, e.g.: video=HDMI-1:margin_right=14,...
15 Acked-by: Maxime Ripard <mripard@kernel.org>
16 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
17 Link: https://patchwork.freedesktop.org/patch/msgid/20191118155134.30468-6-hdegoede@redhat.com
19 drivers/gpu/drm/drm_modes.c | 5 +++++
20 1 file changed, 5 insertions(+)
22 --- a/drivers/gpu/drm/drm_modes.c
23 +++ b/drivers/gpu/drm/drm_modes.c
24 @@ -1592,6 +1592,7 @@ static int drm_mode_parse_cmdline_int(co
27 static int drm_mode_parse_cmdline_options(const char *str,
29 const struct drm_connector *connector,
30 struct drm_cmdline_mode *mode)
32 @@ -1670,6 +1671,9 @@ static int drm_mode_parse_cmdline_option
33 if (!is_power_of_2(rotation & DRM_MODE_ROTATE_MASK))
36 + if (rotation && freestanding)
39 mode->rotation_reflection = rotation;
42 @@ -1862,6 +1866,7 @@ bool drm_mode_parse_command_line_for_con
45 ret = drm_mode_parse_cmdline_options(options_ptr + 1,