Commit 41474d25 authored by Nick Hollinghurst's avatar Nick Hollinghurst Committed by Maxime Ripard

drm: Add DRM_MODE_TV_MODE_MONOCHROME

Add this as a value for enum_drm_connector_tv_mode, represented
by the string "Mono", to generate video with no colour encoding
or bursts. Define it to have no pedestal (since only NTSC-M calls
for a pedestal).

Change default mode creation to acommodate the new tv_mode value
which comprises both 525-line and 625-line formats.
Acked-by: default avatarDaniel Vetter <daniel@ffwll.ch>
Signed-off-by: default avatarNick Hollinghurst <nick.hollinghurst@raspberrypi.com>
Signed-off-by: default avatarDave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: default avatarMaxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240216184857.245372-2-dave.stevenson@raspberrypi.com
parent b2cb6011
...@@ -1087,6 +1087,7 @@ static const struct drm_prop_enum_list drm_tv_mode_enum_list[] = { ...@@ -1087,6 +1087,7 @@ static const struct drm_prop_enum_list drm_tv_mode_enum_list[] = {
{ DRM_MODE_TV_MODE_PAL_M, "PAL-M" }, { DRM_MODE_TV_MODE_PAL_M, "PAL-M" },
{ DRM_MODE_TV_MODE_PAL_N, "PAL-N" }, { DRM_MODE_TV_MODE_PAL_N, "PAL-N" },
{ DRM_MODE_TV_MODE_SECAM, "SECAM" }, { DRM_MODE_TV_MODE_SECAM, "SECAM" },
{ DRM_MODE_TV_MODE_MONOCHROME, "Mono" },
}; };
DRM_ENUM_NAME_FN(drm_get_tv_mode_name, drm_tv_mode_enum_list) DRM_ENUM_NAME_FN(drm_get_tv_mode_name, drm_tv_mode_enum_list)
...@@ -1858,6 +1859,12 @@ EXPORT_SYMBOL(drm_connector_attach_dp_subconnector_property); ...@@ -1858,6 +1859,12 @@ EXPORT_SYMBOL(drm_connector_attach_dp_subconnector_property);
* TV Mode is CCIR System B (aka 625-lines) together with * TV Mode is CCIR System B (aka 625-lines) together with
* the SECAM Color Encoding. * the SECAM Color Encoding.
* *
* Mono:
*
* Use timings appropriate to the DRM mode, including
* equalizing pulses for a 525-line or 625-line mode,
* with no pedestal or color encoding.
*
* Drivers can set up this property by calling * Drivers can set up this property by calling
* drm_mode_create_tv_properties(). * drm_mode_create_tv_properties().
*/ */
......
...@@ -531,7 +531,8 @@ static int fill_analog_mode(struct drm_device *dev, ...@@ -531,7 +531,8 @@ static int fill_analog_mode(struct drm_device *dev,
* @interlace: whether to compute an interlaced mode * @interlace: whether to compute an interlaced mode
* *
* This function creates a struct drm_display_mode instance suited for * This function creates a struct drm_display_mode instance suited for
* an analog TV output, for one of the usual analog TV mode. * an analog TV output, for one of the usual analog TV modes. Where
* this is DRM_MODE_TV_MODE_MONOCHROME, a 625-line mode will be created.
* *
* Note that @hdisplay is larger than the usual constraints for the PAL * Note that @hdisplay is larger than the usual constraints for the PAL
* and NTSC timings, and we'll choose to ignore most timings constraints * and NTSC timings, and we'll choose to ignore most timings constraints
...@@ -569,6 +570,8 @@ struct drm_display_mode *drm_analog_tv_mode(struct drm_device *dev, ...@@ -569,6 +570,8 @@ struct drm_display_mode *drm_analog_tv_mode(struct drm_device *dev,
case DRM_MODE_TV_MODE_PAL_N: case DRM_MODE_TV_MODE_PAL_N:
fallthrough; fallthrough;
case DRM_MODE_TV_MODE_SECAM: case DRM_MODE_TV_MODE_SECAM:
fallthrough;
case DRM_MODE_TV_MODE_MONOCHROME:
analog = DRM_MODE_ANALOG_PAL; analog = DRM_MODE_ANALOG_PAL;
break; break;
......
...@@ -1259,8 +1259,9 @@ int drm_connector_helper_tv_get_modes(struct drm_connector *connector) ...@@ -1259,8 +1259,9 @@ int drm_connector_helper_tv_get_modes(struct drm_connector *connector)
for (i = 0; i < tv_mode_property->num_values; i++) for (i = 0; i < tv_mode_property->num_values; i++)
supported_tv_modes |= BIT(tv_mode_property->values[i]); supported_tv_modes |= BIT(tv_mode_property->values[i]);
if ((supported_tv_modes & ntsc_modes) && if (((supported_tv_modes & ntsc_modes) &&
(supported_tv_modes & pal_modes)) { (supported_tv_modes & pal_modes)) ||
(supported_tv_modes & BIT(DRM_MODE_TV_MODE_MONOCHROME))) {
uint64_t default_mode; uint64_t default_mode;
if (drm_object_property_get_default_value(&connector->base, if (drm_object_property_get_default_value(&connector->base,
......
...@@ -201,6 +201,13 @@ enum drm_connector_tv_mode { ...@@ -201,6 +201,13 @@ enum drm_connector_tv_mode {
*/ */
DRM_MODE_TV_MODE_SECAM, DRM_MODE_TV_MODE_SECAM,
/**
* @DRM_MODE_TV_MODE_MONOCHROME: Use timings appropriate to
* the DRM mode, including equalizing pulses for a 525-line
* or 625-line mode, with no pedestal or color encoding.
*/
DRM_MODE_TV_MODE_MONOCHROME,
/** /**
* @DRM_MODE_TV_MODE_MAX: Number of analog TV output modes. * @DRM_MODE_TV_MODE_MAX: Number of analog TV output modes.
* *
......
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