Commit 0740ac38 authored by Maxime Ripard's avatar Maxime Ripard

drm/modes: Introduce more named modes

Now that we can easily extend the named modes list, let's add a few more
analog TV modes that were used in the wild, and some unit tests to make
sure it works as intended.
Reviewed-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Tested-by: default avatarMateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
Acked-in-principle-or-something-like-that-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://lore.kernel.org/r/20220728-rpi-analog-tv-properties-v10-11-256dad125326@cerno.techSigned-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
parent 65c7bcf7
...@@ -29,7 +29,10 @@ Things between square brackets are optional. ...@@ -29,7 +29,10 @@ Things between square brackets are optional.
Valid names are:: Valid names are::
- NSTC: 480i output, with the CCIR System-M TV mode and NTSC color encoding - NSTC: 480i output, with the CCIR System-M TV mode and NTSC color encoding
- NTSC-J: 480i output, with the CCIR System-M TV mode, the NTSC color
encoding, and a black level equal to the blanking level.
- PAL: 576i output, with the CCIR System-B TV mode and PAL color encoding - PAL: 576i output, with the CCIR System-B TV mode and PAL color encoding
- PAL-M: 480i output, with the CCIR System-M TV mode and PAL color encoding
If 'M' is specified in the mode_option argument (after <yres> and before If 'M' is specified in the mode_option argument (after <yres> and before
<bpp> and <refresh>, if specified) the timings will be calculated using <bpp> and <refresh>, if specified) the timings will be calculated using
......
...@@ -2274,7 +2274,9 @@ struct drm_named_mode { ...@@ -2274,7 +2274,9 @@ struct drm_named_mode {
static const struct drm_named_mode drm_named_modes[] = { static const struct drm_named_mode drm_named_modes[] = {
NAMED_MODE("NTSC", 13500, 720, 480, DRM_MODE_FLAG_INTERLACE, DRM_MODE_TV_MODE_NTSC), NAMED_MODE("NTSC", 13500, 720, 480, DRM_MODE_FLAG_INTERLACE, DRM_MODE_TV_MODE_NTSC),
NAMED_MODE("NTSC-J", 13500, 720, 480, DRM_MODE_FLAG_INTERLACE, DRM_MODE_TV_MODE_NTSC_J),
NAMED_MODE("PAL", 13500, 720, 576, DRM_MODE_FLAG_INTERLACE, DRM_MODE_TV_MODE_PAL), NAMED_MODE("PAL", 13500, 720, 576, DRM_MODE_FLAG_INTERLACE, DRM_MODE_TV_MODE_PAL),
NAMED_MODE("PAL-M", 13500, 720, 480, DRM_MODE_FLAG_INTERLACE, DRM_MODE_TV_MODE_PAL_M),
}; };
static int drm_mode_parse_cmdline_named_mode(const char *name, static int drm_mode_parse_cmdline_named_mode(const char *name,
......
...@@ -150,7 +150,9 @@ static void drm_test_pick_cmdline_named(struct kunit *test) ...@@ -150,7 +150,9 @@ static void drm_test_pick_cmdline_named(struct kunit *test)
static const static const
struct drm_connector_pick_cmdline_mode_test drm_connector_pick_cmdline_mode_tests[] = { struct drm_connector_pick_cmdline_mode_test drm_connector_pick_cmdline_mode_tests[] = {
TEST_CMDLINE("NTSC", drm_mode_analog_ntsc_480i), TEST_CMDLINE("NTSC", drm_mode_analog_ntsc_480i),
TEST_CMDLINE("NTSC-J", drm_mode_analog_ntsc_480i),
TEST_CMDLINE("PAL", drm_mode_analog_pal_576i), TEST_CMDLINE("PAL", drm_mode_analog_pal_576i),
TEST_CMDLINE("PAL-M", drm_mode_analog_ntsc_480i),
}; };
static void static void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment