History

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.

Maxime Ripard committed 4 years ago

Commit 0e308ef1 parent 00dcc4a2 files · +13 −3Browse files

Unified · Split

2 files
  1. drivers/gpu/drm/drm_modes.c +6 −3
  2. include/drm/drm_connector.h +7 −0
drivers/gpu/drm/drm_modes.c+6−3
@@ -1752,22 +1752,24 @@ static int drm_mode_parse_cmdline_options(const char *str, · 1751 unmodified lines
17521752
17531753 struct drm_named_mode {
17541754 const char *name;
1755+ unsigned int pixel_clock_khz;
17551756 unsigned int xres;
17561757 unsigned int yres;
17571758 unsigned int flags;
17581759 };
17591760
1760−#define NAMED_MODE(_name, _x, _y, _flags) \
1761+#define NAMED_MODE(_name, _pclk, _x, _y, _flags) \
17611762 { \
17621763 .name = _name, \
1764+ .pixel_clock_khz = _pclk, \
17631765 .xres = _x, \
17641766 .yres = _y, \
17651767 .flags = _flags, \
17661768 }
17671769
17681770 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),
17711773 };
17721774
17731775 static int drm_mode_parse_cmdline_named_mode(const char *name,
@@ -1808,6 +1810,7 @@ static int drm_mode_parse_cmdline_named_mode(const char *name, · 34 unmodified lines
18081810 continue;
18091811
18101812 strcpy(cmdline_mode->name, mode->name);
1813+ cmdline_mode->pixel_clock = mode->pixel_clock_khz;
18111814 cmdline_mode->xres = mode->xres;
18121815 cmdline_mode->yres = mode->yres;
18131816 cmdline_mode->interlace = !!(mode->flags & DRM_MODE_FLAG_INTERLACE);
include/drm/drm_connector.h+7−0
@@ -1212,6 +1212,13 @@ struct drm_cmdline_mode { · 1211 unmodified lines
12121212 */
12131213 bool bpp_specified;
12141214
1215+ /**
1216+ * @pixel_clock:
1217+ *
1218+ * Pixel Clock in kHz. Optional.
1219+ */
1220+ unsigned int pixel_clock;
1221+
12151222 /**
12161223 * @xres:
12171224 *