Skip to content

Commit 0e308ef

Browse files
committed
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 <[email protected]> Tested-by: Mateusz Kwiatkowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
1 parent 00dcc4a commit 0e308ef

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

drivers/gpu/drm/drm_modes.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,22 +1752,24 @@ static int drm_mode_parse_cmdline_options(const char *str,
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,
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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,13 @@ struct drm_cmdline_mode {
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
*

0 commit comments

Comments
 (0)