[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220728-rpi-analog-tv-properties-v2-16-459522d653a7@cerno.tech>
Date: Mon, 29 Aug 2022 15:11:30 +0200
From: Maxime Ripard <maxime@...no.tech>
To: Maxime Ripard <mripard@...nel.org>,
Ben Skeggs <bskeggs@...hat.com>,
David Airlie <airlied@...ux.ie>, Chen-Yu Tsai <wens@...e.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Lyude Paul <lyude@...hat.com>,
Philipp Zabel <p.zabel@...gutronix.de>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Samuel Holland <samuel@...lland.org>,
Karol Herbst <kherbst@...hat.com>,
Noralf Trønnes <noralf@...nnes.org>,
Emma Anholt <emma@...olt.net>, Daniel Vetter <daniel@...ll.ch>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>
Cc: Maxime Ripard <maxime@...no.tech>,
Hans de Goede <hdegoede@...hat.com>,
linux-arm-kernel@...ts.infradead.org,
Phil Elwell <phil@...pberrypi.com>,
intel-gfx@...ts.freedesktop.org,
Dave Stevenson <dave.stevenson@...pberrypi.com>,
dri-devel@...ts.freedesktop.org, Dom Cobley <dom@...pberrypi.com>,
linux-kernel@...r.kernel.org, nouveau@...ts.freedesktop.org,
linux-sunxi@...ts.linux.dev,
Mateusz Kwiatkowski <kfyatek+publicgit@...il.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>
Subject: [PATCH v2 16/41] drm/modes: Fill drm_cmdline mode from named modes
The current code to deal with named modes will only set the mode name, and
then it's up to drivers to try to match that name to whatever mode or
configuration they see fit.
The plan is to remove that need and move the named mode handling out of
drivers and into the core, and only rely on modes and properties. Let's
start by properly filling drm_cmdline_mode from a named mode.
Signed-off-by: Maxime Ripard <maxime@...no.tech>
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 1fdfa004b139..5e898699b532 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -2208,11 +2208,22 @@ static int drm_mode_parse_cmdline_options(const char *str,
struct drm_named_mode {
const char *name;
+ unsigned int xres;
+ unsigned int yres;
+ unsigned int flags;
};
+#define NAMED_MODE(_name, _x, _y, _flags) \
+ { \
+ .name = _name, \
+ .xres = _x, \
+ .yres = _y, \
+ .flags = _flags, \
+ }
+
static const struct drm_named_mode drm_named_modes[] = {
- { "NTSC", },
- { "PAL", },
+ NAMED_MODE("NTSC", 720, 480, DRM_MODE_FLAG_INTERLACE),
+ NAMED_MODE("PAL", 720, 576, DRM_MODE_FLAG_INTERLACE),
};
static int drm_mode_parse_cmdline_named_mode(const char *name,
@@ -2254,6 +2265,9 @@ static int drm_mode_parse_cmdline_named_mode(const char *name,
continue;
strcpy(cmdline_mode->name, mode->name);
+ cmdline_mode->xres = mode->xres;
+ cmdline_mode->yres = mode->yres;
+ cmdline_mode->interlace = !!(mode->flags & DRM_MODE_FLAG_INTERLACE);
cmdline_mode->specified = true;
return 1;
--
b4 0.10.0-dev-65ba7
Powered by blists - more mailing lists