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.

Signed-off-by: Maxime Ripard <max...@cerno.tech>

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 5d8b6a0d96f3..eb3c4e596c67 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -2226,22 +2226,24 @@ static int drm_mode_parse_cmdline_options(const char 
*str,
 
 struct drm_named_mode {
        const char *name;
+       unsigned int pixel_clock_khz;
        unsigned int xres;
        unsigned int yres;
        unsigned int flags;
 };
 
-#define NAMED_MODE(_name, _x, _y, _flags)              \
+#define NAMED_MODE(_name, _pclk, _x, _y, _flags)       \
        {                                               \
                .name = _name,                          \
+               .pixel_clock_khz = _pclk,               \
                .xres = _x,                             \
                .yres = _y,                             \
                .flags = _flags,                        \
        }
 
 static const struct drm_named_mode drm_named_modes[] = {
-       NAMED_MODE("NTSC", 720, 480, DRM_MODE_FLAG_INTERLACE),
-       NAMED_MODE("PAL", 720, 576, DRM_MODE_FLAG_INTERLACE),
+       NAMED_MODE("NTSC", 13500, 720, 480, DRM_MODE_FLAG_INTERLACE),
+       NAMED_MODE("PAL", 13500, 720, 576, DRM_MODE_FLAG_INTERLACE),
 };
 
 static int drm_mode_parse_cmdline_named_mode(const char *name,
@@ -2286,6 +2288,7 @@ static int drm_mode_parse_cmdline_named_mode(const char 
*name,
                        continue;
 
                strcpy(cmdline_mode->name, mode->name);
+               cmdline_mode->pixel_clock = mode->pixel_clock_khz;
                cmdline_mode->xres = mode->xres;
                cmdline_mode->yres = mode->yres;
                cmdline_mode->interlace = !!(mode->flags & 
DRM_MODE_FLAG_INTERLACE);
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index fffacbfd0a45..80e19efb3f42 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1279,6 +1279,13 @@ struct drm_cmdline_mode {
         */
        bool bpp_specified;
 
+       /**
+        * @pixel_clock:
+        *
+        * Pixel Clock in kHz. Optional.
+        */
+       unsigned int pixel_clock;
+
        /**
         * @xres:
         *

-- 
b4 0.10.0

Reply via email to