Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Noralf Trønnes <noralf@tronnes.org>
Tested-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
Acked-in-principle-or-something-like-that-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://lore.kernel.org/r/20220728-rpi-analog-tv-properties-v10-11-256dad125326@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>

+7
+3
Documentation/fb/modedb.rst
··· 29 29 Valid names are:: 30 30 31 31 - NSTC: 480i output, with the CCIR System-M TV mode and NTSC color encoding 32 + - NTSC-J: 480i output, with the CCIR System-M TV mode, the NTSC color 33 + encoding, and a black level equal to the blanking level. 32 34 - PAL: 576i output, with the CCIR System-B TV mode and PAL color encoding 35 + - PAL-M: 480i output, with the CCIR System-M TV mode and PAL color encoding 33 36 34 37 If 'M' is specified in the mode_option argument (after <yres> and before 35 38 <bpp> and <refresh>, if specified) the timings will be calculated using
+2
drivers/gpu/drm/drm_modes.c
··· 2274 2274 2275 2275 static const struct drm_named_mode drm_named_modes[] = { 2276 2276 NAMED_MODE("NTSC", 13500, 720, 480, DRM_MODE_FLAG_INTERLACE, DRM_MODE_TV_MODE_NTSC), 2277 + NAMED_MODE("NTSC-J", 13500, 720, 480, DRM_MODE_FLAG_INTERLACE, DRM_MODE_TV_MODE_NTSC_J), 2277 2278 NAMED_MODE("PAL", 13500, 720, 576, DRM_MODE_FLAG_INTERLACE, DRM_MODE_TV_MODE_PAL), 2279 + NAMED_MODE("PAL-M", 13500, 720, 480, DRM_MODE_FLAG_INTERLACE, DRM_MODE_TV_MODE_PAL_M), 2278 2280 }; 2279 2281 2280 2282 static int drm_mode_parse_cmdline_named_mode(const char *name,
+2
drivers/gpu/drm/tests/drm_client_modeset_test.c
··· 150 150 static const 151 151 struct drm_connector_pick_cmdline_mode_test drm_connector_pick_cmdline_mode_tests[] = { 152 152 TEST_CMDLINE("NTSC", drm_mode_analog_ntsc_480i), 153 + TEST_CMDLINE("NTSC-J", drm_mode_analog_ntsc_480i), 153 154 TEST_CMDLINE("PAL", drm_mode_analog_pal_576i), 155 + TEST_CMDLINE("PAL-M", drm_mode_analog_ntsc_480i), 154 156 }; 155 157 156 158 static void