[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <4bd5f539b686fbcd097fa07cff2eb6f60ca9bec1.1657301107.git.geert@linux-m68k.org>
Date: Fri, 8 Jul 2022 20:21:27 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Hans de Goede <hdegoede@...hat.com>
Cc: dri-devel@...ts.freedesktop.org, linux-fbdev@...r.kernel.org,
linux-m68k@...r.kernel.org, linux-kernel@...r.kernel.org,
Geert Uytterhoeven <geert@...ux-m68k.org>
Subject: [PATCH 3/5] drm/modes: parse_cmdline: Make mode->*specified handling more uniform
The various mode->*specified flags are not handled in an uniform way:
some flags are set by the corresponding drm_mode_parse_cmdline_*()
function, some flags by the caller of the function, and some flags by
both.
Make this uniform by making this the responsibility of the various
parsing helpers, i.e.
- Move the setting of mode->specified from caller to callee,
- Drop the duplicate setting of mode->bpp_specified and
mode->refresh_specified from callers.
Signed-off-by: Geert Uytterhoeven <geert@...ux-m68k.org>
---
drivers/gpu/drm/drm_modes.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 434383469e9d984d..9ce275fbda566b7c 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -1599,6 +1599,7 @@ static int drm_mode_parse_cmdline_res_mode(const char *str, unsigned int length,
mode->yres = yres;
mode->cvt = cvt;
mode->rb = rb;
+ mode->specified = true;
return 0;
}
@@ -1862,8 +1863,6 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option,
mode);
if (ret)
return false;
-
- mode->specified = true;
}
/* No mode? Check for freestanding extras and/or options */
@@ -1885,8 +1884,6 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option,
ret = drm_mode_parse_cmdline_bpp(bpp_ptr, &bpp_end_ptr, mode);
if (ret)
return false;
-
- mode->bpp_specified = true;
}
if (refresh_ptr) {
@@ -1894,8 +1891,6 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option,
&refresh_end_ptr, mode);
if (ret)
return false;
-
- mode->refresh_specified = true;
}
/*
--
2.25.1
Powered by blists - more mailing lists