summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_modes.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2022-09-29 18:31:07 +0200
committerMaxime Ripard <maxime@cerno.tech>2022-10-10 13:59:04 +0200
commit8b6e28ea0a51a74af6a2684591a3471742f90647 (patch)
treef3d3dc2e0b532c4eb567c62ae92387856c9a195a /drivers/gpu/drm/drm_modes.c
parentdrm/modes: Only consider bpp and refresh before options (diff)
downloadlinux-8b6e28ea0a51a74af6a2684591a3471742f90647.tar.xz
linux-8b6e28ea0a51a74af6a2684591a3471742f90647.zip
drm/modes: parse_cmdline: Add support for named modes containing dashes
It is fairly common for named video modes to contain dashes (e.g. "tt-mid" on Atari, "dblntsc-ff" on Amiga). Currently such mode names are not recognized, as the dash is considered to be a separator between mode name and bpp. Fix this by skipping any dashes that are not followed immediately by a digit when looking for the separator. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20220728-rpi-analog-tv-properties-v4-13-60d38873f782@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Diffstat (limited to 'drivers/gpu/drm/drm_modes.c')
-rw-r--r--drivers/gpu/drm/drm_modes.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index e0221183135b..5d4ac79381c4 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -1810,6 +1810,8 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option,
/* Try to locate the bpp and refresh specifiers, if any */
bpp_ptr = strnchr(name, options_off, '-');
+ while (bpp_ptr && !isdigit(bpp_ptr[1]))
+ bpp_ptr = strnchr(bpp_ptr + 1, options_off, '-');
if (bpp_ptr)
bpp_off = bpp_ptr - name;