Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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.

Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Tested-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
Link: https://lore.kernel.org/r/20220728-rpi-analog-tv-properties-v9-11-24b168e5bcd5@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>

+16 -2
+16 -2
drivers/gpu/drm/drm_modes.c
··· 1752 1752 1753 1753 struct drm_named_mode { 1754 1754 const char *name; 1755 + unsigned int xres; 1756 + unsigned int yres; 1757 + unsigned int flags; 1755 1758 }; 1756 1759 1760 + #define NAMED_MODE(_name, _x, _y, _flags) \ 1761 + { \ 1762 + .name = _name, \ 1763 + .xres = _x, \ 1764 + .yres = _y, \ 1765 + .flags = _flags, \ 1766 + } 1767 + 1757 1768 static const struct drm_named_mode drm_named_modes[] = { 1758 - { "NTSC", }, 1759 - { "PAL", }, 1769 + NAMED_MODE("NTSC", 720, 480, DRM_MODE_FLAG_INTERLACE), 1770 + NAMED_MODE("PAL", 720, 576, DRM_MODE_FLAG_INTERLACE), 1760 1771 }; 1761 1772 1762 1773 static int drm_mode_parse_cmdline_named_mode(const char *name, ··· 1808 1797 continue; 1809 1798 1810 1799 strcpy(cmdline_mode->name, mode->name); 1800 + cmdline_mode->xres = mode->xres; 1801 + cmdline_mode->yres = mode->yres; 1802 + cmdline_mode->interlace = !!(mode->flags & DRM_MODE_FLAG_INTERLACE); 1811 1803 cmdline_mode->specified = true; 1812 1804 1813 1805 return 1;