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/connector: Add pixel clock to cmdline mode

We'll need to get the pixel clock to generate proper display modes for
all the current named modes. Let's add it to struct drm_cmdline_mode and
fill it when parsing the 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-12-24b168e5bcd5@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>

+13 -3
+6 -3
drivers/gpu/drm/drm_modes.c
··· 1752 1752 1753 1753 struct drm_named_mode { 1754 1754 const char *name; 1755 + unsigned int pixel_clock_khz; 1755 1756 unsigned int xres; 1756 1757 unsigned int yres; 1757 1758 unsigned int flags; 1758 1759 }; 1759 1760 1760 - #define NAMED_MODE(_name, _x, _y, _flags) \ 1761 + #define NAMED_MODE(_name, _pclk, _x, _y, _flags) \ 1761 1762 { \ 1762 1763 .name = _name, \ 1764 + .pixel_clock_khz = _pclk, \ 1763 1765 .xres = _x, \ 1764 1766 .yres = _y, \ 1765 1767 .flags = _flags, \ 1766 1768 } 1767 1769 1768 1770 static const struct drm_named_mode drm_named_modes[] = { 1769 - NAMED_MODE("NTSC", 720, 480, DRM_MODE_FLAG_INTERLACE), 1770 - NAMED_MODE("PAL", 720, 576, DRM_MODE_FLAG_INTERLACE), 1771 + NAMED_MODE("NTSC", 13500, 720, 480, DRM_MODE_FLAG_INTERLACE), 1772 + NAMED_MODE("PAL", 13500, 720, 576, DRM_MODE_FLAG_INTERLACE), 1771 1773 }; 1772 1774 1773 1775 static int drm_mode_parse_cmdline_named_mode(const char *name, ··· 1810 1808 continue; 1811 1809 1812 1810 strcpy(cmdline_mode->name, mode->name); 1811 + cmdline_mode->pixel_clock = mode->pixel_clock_khz; 1813 1812 cmdline_mode->xres = mode->xres; 1814 1813 cmdline_mode->yres = mode->yres; 1815 1814 cmdline_mode->interlace = !!(mode->flags & DRM_MODE_FLAG_INTERLACE);
+7
include/drm/drm_connector.h
··· 1213 1213 bool bpp_specified; 1214 1214 1215 1215 /** 1216 + * @pixel_clock: 1217 + * 1218 + * Pixel Clock in kHz. Optional. 1219 + */ 1220 + unsigned int pixel_clock; 1221 + 1222 + /** 1216 1223 * @xres: 1217 1224 * 1218 1225 * Active resolution on the X axis, in pixels.