Commit c03d0b52 authored by Maxime Ripard's avatar Maxime Ripard

drm/connector: Fix typo in output format

The HDMI specification mentions YCbCr everywhere, but our enums have
YCrCb. Let's rename it to match.
Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220120151625.594595-5-maxime@cerno.tech
parent 4adc33f3
...@@ -5816,7 +5816,7 @@ static void fill_stream_properties_from_drm_display_mode( ...@@ -5816,7 +5816,7 @@ static void fill_stream_properties_from_drm_display_mode(
else if (drm_mode_is_420_also(info, mode_in) else if (drm_mode_is_420_also(info, mode_in)
&& aconnector->force_yuv420_output) && aconnector->force_yuv420_output)
timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR420; timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR420;
else if ((connector->display_info.color_formats & DRM_COLOR_FORMAT_YCRCB444) else if ((connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR444)
&& stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) && stream->signal == SIGNAL_TYPE_HDMI_TYPE_A)
timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR444; timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR444;
else else
......
...@@ -1078,11 +1078,11 @@ static void d71_improc_update(struct komeda_component *c, ...@@ -1078,11 +1078,11 @@ static void d71_improc_update(struct komeda_component *c,
mask |= IPS_CTRL_YUV | IPS_CTRL_CHD422 | IPS_CTRL_CHD420; mask |= IPS_CTRL_YUV | IPS_CTRL_CHD422 | IPS_CTRL_CHD420;
/* config color format */ /* config color format */
if (st->color_format == DRM_COLOR_FORMAT_YCRCB420) if (st->color_format == DRM_COLOR_FORMAT_YCBCR420)
ctrl |= IPS_CTRL_YUV | IPS_CTRL_CHD422 | IPS_CTRL_CHD420; ctrl |= IPS_CTRL_YUV | IPS_CTRL_CHD422 | IPS_CTRL_CHD420;
else if (st->color_format == DRM_COLOR_FORMAT_YCRCB422) else if (st->color_format == DRM_COLOR_FORMAT_YCBCR422)
ctrl |= IPS_CTRL_YUV | IPS_CTRL_CHD422; ctrl |= IPS_CTRL_YUV | IPS_CTRL_CHD422;
else if (st->color_format == DRM_COLOR_FORMAT_YCRCB444) else if (st->color_format == DRM_COLOR_FORMAT_YCBCR444)
ctrl |= IPS_CTRL_YUV; ctrl |= IPS_CTRL_YUV;
malidp_write32_mask(reg, BLK_CONTROL, mask, ctrl); malidp_write32_mask(reg, BLK_CONTROL, mask, ctrl);
...@@ -1144,11 +1144,11 @@ static int d71_improc_init(struct d71_dev *d71, ...@@ -1144,11 +1144,11 @@ static int d71_improc_init(struct d71_dev *d71,
improc = to_improc(c); improc = to_improc(c);
improc->supported_color_depths = BIT(8) | BIT(10); improc->supported_color_depths = BIT(8) | BIT(10);
improc->supported_color_formats = DRM_COLOR_FORMAT_RGB444 | improc->supported_color_formats = DRM_COLOR_FORMAT_RGB444 |
DRM_COLOR_FORMAT_YCRCB444 | DRM_COLOR_FORMAT_YCBCR444 |
DRM_COLOR_FORMAT_YCRCB422; DRM_COLOR_FORMAT_YCBCR422;
value = malidp_read32(reg, BLK_INFO); value = malidp_read32(reg, BLK_INFO);
if (value & IPS_INFO_CHD420) if (value & IPS_INFO_CHD420)
improc->supported_color_formats |= DRM_COLOR_FORMAT_YCRCB420; improc->supported_color_formats |= DRM_COLOR_FORMAT_YCBCR420;
improc->supports_csc = true; improc->supports_csc = true;
improc->supports_gamma = true; improc->supports_gamma = true;
......
...@@ -223,7 +223,7 @@ static void adv7511_set_config_csc(struct adv7511 *adv7511, ...@@ -223,7 +223,7 @@ static void adv7511_set_config_csc(struct adv7511 *adv7511,
config.csc_coefficents = adv7511_csc_ycbcr_to_rgb; config.csc_coefficents = adv7511_csc_ycbcr_to_rgb;
if ((connector->display_info.color_formats & if ((connector->display_info.color_formats &
DRM_COLOR_FORMAT_YCRCB422) && DRM_COLOR_FORMAT_YCBCR422) &&
config.hdmi_mode) { config.hdmi_mode) {
config.csc_enable = false; config.csc_enable = false;
config.avi_infoframe.colorspace = config.avi_infoframe.colorspace =
......
...@@ -1537,9 +1537,9 @@ static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge, ...@@ -1537,9 +1537,9 @@ static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge,
video->color_depth = COLOR_8; video->color_depth = COLOR_8;
break; break;
} }
if (display_info->color_formats & DRM_COLOR_FORMAT_YCRCB444) if (display_info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
video->color_space = COLOR_YCBCR444; video->color_space = COLOR_YCBCR444;
else if (display_info->color_formats & DRM_COLOR_FORMAT_YCRCB422) else if (display_info->color_formats & DRM_COLOR_FORMAT_YCBCR422)
video->color_space = COLOR_YCBCR422; video->color_space = COLOR_YCBCR422;
else else
video->color_space = COLOR_RGB; video->color_space = COLOR_RGB;
......
...@@ -1553,13 +1553,13 @@ static u32 cdns_mhdp_get_bpp(struct cdns_mhdp_display_fmt *fmt) ...@@ -1553,13 +1553,13 @@ static u32 cdns_mhdp_get_bpp(struct cdns_mhdp_display_fmt *fmt)
switch (fmt->color_format) { switch (fmt->color_format) {
case DRM_COLOR_FORMAT_RGB444: case DRM_COLOR_FORMAT_RGB444:
case DRM_COLOR_FORMAT_YCRCB444: case DRM_COLOR_FORMAT_YCBCR444:
bpp = fmt->bpc * 3; bpp = fmt->bpc * 3;
break; break;
case DRM_COLOR_FORMAT_YCRCB422: case DRM_COLOR_FORMAT_YCBCR422:
bpp = fmt->bpc * 2; bpp = fmt->bpc * 2;
break; break;
case DRM_COLOR_FORMAT_YCRCB420: case DRM_COLOR_FORMAT_YCBCR420:
bpp = fmt->bpc * 3 / 2; bpp = fmt->bpc * 3 / 2;
break; break;
default: default:
...@@ -1767,8 +1767,8 @@ static void cdns_mhdp_configure_video(struct cdns_mhdp_device *mhdp, ...@@ -1767,8 +1767,8 @@ static void cdns_mhdp_configure_video(struct cdns_mhdp_device *mhdp,
* If YCBCR supported and stream not SD, use ITU709 * If YCBCR supported and stream not SD, use ITU709
* Need to handle ITU version with YCBCR420 when supported * Need to handle ITU version with YCBCR420 when supported
*/ */
if ((pxlfmt == DRM_COLOR_FORMAT_YCRCB444 || if ((pxlfmt == DRM_COLOR_FORMAT_YCBCR444 ||
pxlfmt == DRM_COLOR_FORMAT_YCRCB422) && mode->crtc_vdisplay >= 720) pxlfmt == DRM_COLOR_FORMAT_YCBCR422) && mode->crtc_vdisplay >= 720)
misc0 = DP_YCBCR_COEFFICIENTS_ITU709; misc0 = DP_YCBCR_COEFFICIENTS_ITU709;
bpp = cdns_mhdp_get_bpp(&mhdp->display_fmt); bpp = cdns_mhdp_get_bpp(&mhdp->display_fmt);
...@@ -1778,15 +1778,15 @@ static void cdns_mhdp_configure_video(struct cdns_mhdp_device *mhdp, ...@@ -1778,15 +1778,15 @@ static void cdns_mhdp_configure_video(struct cdns_mhdp_device *mhdp,
pxl_repr = CDNS_DP_FRAMER_RGB << CDNS_DP_FRAMER_PXL_FORMAT; pxl_repr = CDNS_DP_FRAMER_RGB << CDNS_DP_FRAMER_PXL_FORMAT;
misc0 |= DP_COLOR_FORMAT_RGB; misc0 |= DP_COLOR_FORMAT_RGB;
break; break;
case DRM_COLOR_FORMAT_YCRCB444: case DRM_COLOR_FORMAT_YCBCR444:
pxl_repr = CDNS_DP_FRAMER_YCBCR444 << CDNS_DP_FRAMER_PXL_FORMAT; pxl_repr = CDNS_DP_FRAMER_YCBCR444 << CDNS_DP_FRAMER_PXL_FORMAT;
misc0 |= DP_COLOR_FORMAT_YCbCr444 | DP_TEST_DYNAMIC_RANGE_CEA; misc0 |= DP_COLOR_FORMAT_YCbCr444 | DP_TEST_DYNAMIC_RANGE_CEA;
break; break;
case DRM_COLOR_FORMAT_YCRCB422: case DRM_COLOR_FORMAT_YCBCR422:
pxl_repr = CDNS_DP_FRAMER_YCBCR422 << CDNS_DP_FRAMER_PXL_FORMAT; pxl_repr = CDNS_DP_FRAMER_YCBCR422 << CDNS_DP_FRAMER_PXL_FORMAT;
misc0 |= DP_COLOR_FORMAT_YCbCr422 | DP_TEST_DYNAMIC_RANGE_CEA; misc0 |= DP_COLOR_FORMAT_YCbCr422 | DP_TEST_DYNAMIC_RANGE_CEA;
break; break;
case DRM_COLOR_FORMAT_YCRCB420: case DRM_COLOR_FORMAT_YCBCR420:
pxl_repr = CDNS_DP_FRAMER_YCBCR420 << CDNS_DP_FRAMER_PXL_FORMAT; pxl_repr = CDNS_DP_FRAMER_YCBCR420 << CDNS_DP_FRAMER_PXL_FORMAT;
break; break;
default: default:
...@@ -1882,7 +1882,7 @@ static void cdns_mhdp_configure_video(struct cdns_mhdp_device *mhdp, ...@@ -1882,7 +1882,7 @@ static void cdns_mhdp_configure_video(struct cdns_mhdp_device *mhdp,
if (mhdp->display_fmt.y_only) if (mhdp->display_fmt.y_only)
misc1 |= CDNS_DP_TEST_COLOR_FORMAT_RAW_Y_ONLY; misc1 |= CDNS_DP_TEST_COLOR_FORMAT_RAW_Y_ONLY;
/* Use VSC SDP for Y420 */ /* Use VSC SDP for Y420 */
if (pxlfmt == DRM_COLOR_FORMAT_YCRCB420) if (pxlfmt == DRM_COLOR_FORMAT_YCBCR420)
misc1 = CDNS_DP_TEST_VSC_SDP; misc1 = CDNS_DP_TEST_VSC_SDP;
cdns_mhdp_reg_write(mhdp, CDNS_DP_MSA_MISC(stream_id), cdns_mhdp_reg_write(mhdp, CDNS_DP_MSA_MISC(stream_id),
......
...@@ -2540,7 +2540,7 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, ...@@ -2540,7 +2540,7 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
struct drm_display_mode *mode = &crtc_state->mode; struct drm_display_mode *mode = &crtc_state->mode;
u8 max_bpc = conn_state->max_requested_bpc; u8 max_bpc = conn_state->max_requested_bpc;
bool is_hdmi2_sink = info->hdmi.scdc.supported || bool is_hdmi2_sink = info->hdmi.scdc.supported ||
(info->color_formats & DRM_COLOR_FORMAT_YCRCB420); (info->color_formats & DRM_COLOR_FORMAT_YCBCR420);
u32 *output_fmts; u32 *output_fmts;
unsigned int i = 0; unsigned int i = 0;
...@@ -2594,36 +2594,36 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, ...@@ -2594,36 +2594,36 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
*/ */
if (max_bpc >= 16 && info->bpc == 16) { if (max_bpc >= 16 && info->bpc == 16) {
if (info->color_formats & DRM_COLOR_FORMAT_YCRCB444) if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
output_fmts[i++] = MEDIA_BUS_FMT_YUV16_1X48; output_fmts[i++] = MEDIA_BUS_FMT_YUV16_1X48;
output_fmts[i++] = MEDIA_BUS_FMT_RGB161616_1X48; output_fmts[i++] = MEDIA_BUS_FMT_RGB161616_1X48;
} }
if (max_bpc >= 12 && info->bpc >= 12) { if (max_bpc >= 12 && info->bpc >= 12) {
if (info->color_formats & DRM_COLOR_FORMAT_YCRCB422) if (info->color_formats & DRM_COLOR_FORMAT_YCBCR422)
output_fmts[i++] = MEDIA_BUS_FMT_UYVY12_1X24; output_fmts[i++] = MEDIA_BUS_FMT_UYVY12_1X24;
if (info->color_formats & DRM_COLOR_FORMAT_YCRCB444) if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
output_fmts[i++] = MEDIA_BUS_FMT_YUV12_1X36; output_fmts[i++] = MEDIA_BUS_FMT_YUV12_1X36;
output_fmts[i++] = MEDIA_BUS_FMT_RGB121212_1X36; output_fmts[i++] = MEDIA_BUS_FMT_RGB121212_1X36;
} }
if (max_bpc >= 10 && info->bpc >= 10) { if (max_bpc >= 10 && info->bpc >= 10) {
if (info->color_formats & DRM_COLOR_FORMAT_YCRCB422) if (info->color_formats & DRM_COLOR_FORMAT_YCBCR422)
output_fmts[i++] = MEDIA_BUS_FMT_UYVY10_1X20; output_fmts[i++] = MEDIA_BUS_FMT_UYVY10_1X20;
if (info->color_formats & DRM_COLOR_FORMAT_YCRCB444) if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
output_fmts[i++] = MEDIA_BUS_FMT_YUV10_1X30; output_fmts[i++] = MEDIA_BUS_FMT_YUV10_1X30;
output_fmts[i++] = MEDIA_BUS_FMT_RGB101010_1X30; output_fmts[i++] = MEDIA_BUS_FMT_RGB101010_1X30;
} }
if (info->color_formats & DRM_COLOR_FORMAT_YCRCB422) if (info->color_formats & DRM_COLOR_FORMAT_YCBCR422)
output_fmts[i++] = MEDIA_BUS_FMT_UYVY8_1X16; output_fmts[i++] = MEDIA_BUS_FMT_UYVY8_1X16;
if (info->color_formats & DRM_COLOR_FORMAT_YCRCB444) if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
output_fmts[i++] = MEDIA_BUS_FMT_YUV8_1X24; output_fmts[i++] = MEDIA_BUS_FMT_YUV8_1X24;
/* Default 8bit RGB fallback */ /* Default 8bit RGB fallback */
......
...@@ -3776,7 +3776,7 @@ static int do_y420vdb_modes(struct drm_connector *connector, ...@@ -3776,7 +3776,7 @@ static int do_y420vdb_modes(struct drm_connector *connector,
} }
if (modes > 0) if (modes > 0)
info->color_formats |= DRM_COLOR_FORMAT_YCRCB420; info->color_formats |= DRM_COLOR_FORMAT_YCBCR420;
return modes; return modes;
} }
...@@ -4290,7 +4290,7 @@ static void drm_parse_y420cmdb_bitmap(struct drm_connector *connector, ...@@ -4290,7 +4290,7 @@ static void drm_parse_y420cmdb_bitmap(struct drm_connector *connector,
if (map_len == 0) { if (map_len == 0) {
/* All CEA modes support ycbcr420 sampling also.*/ /* All CEA modes support ycbcr420 sampling also.*/
hdmi->y420_cmdb_map = U64_MAX; hdmi->y420_cmdb_map = U64_MAX;
info->color_formats |= DRM_COLOR_FORMAT_YCRCB420; info->color_formats |= DRM_COLOR_FORMAT_YCBCR420;
return; return;
} }
...@@ -4313,7 +4313,7 @@ static void drm_parse_y420cmdb_bitmap(struct drm_connector *connector, ...@@ -4313,7 +4313,7 @@ static void drm_parse_y420cmdb_bitmap(struct drm_connector *connector,
map |= (u64)db[2 + count] << (8 * count); map |= (u64)db[2 + count] << (8 * count);
if (map) if (map)
info->color_formats |= DRM_COLOR_FORMAT_YCRCB420; info->color_formats |= DRM_COLOR_FORMAT_YCBCR420;
hdmi->y420_cmdb_map = map; hdmi->y420_cmdb_map = map;
} }
...@@ -5188,9 +5188,9 @@ static void drm_parse_cea_ext(struct drm_connector *connector, ...@@ -5188,9 +5188,9 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
/* The existence of a CEA block should imply RGB support */ /* The existence of a CEA block should imply RGB support */
info->color_formats = DRM_COLOR_FORMAT_RGB444; info->color_formats = DRM_COLOR_FORMAT_RGB444;
if (edid_ext[3] & EDID_CEA_YCRCB444) if (edid_ext[3] & EDID_CEA_YCRCB444)
info->color_formats |= DRM_COLOR_FORMAT_YCRCB444; info->color_formats |= DRM_COLOR_FORMAT_YCBCR444;
if (edid_ext[3] & EDID_CEA_YCRCB422) if (edid_ext[3] & EDID_CEA_YCRCB422)
info->color_formats |= DRM_COLOR_FORMAT_YCRCB422; info->color_formats |= DRM_COLOR_FORMAT_YCBCR422;
if (cea_db_offsets(edid_ext, &start, &end)) if (cea_db_offsets(edid_ext, &start, &end))
return; return;
...@@ -5416,9 +5416,9 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi ...@@ -5416,9 +5416,9 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
info->color_formats |= DRM_COLOR_FORMAT_RGB444; info->color_formats |= DRM_COLOR_FORMAT_RGB444;
if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444) if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444)
info->color_formats |= DRM_COLOR_FORMAT_YCRCB444; info->color_formats |= DRM_COLOR_FORMAT_YCBCR444;
if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422) if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422)
info->color_formats |= DRM_COLOR_FORMAT_YCRCB422; info->color_formats |= DRM_COLOR_FORMAT_YCBCR422;
drm_update_mso(connector, edid); drm_update_mso(connector, edid);
...@@ -5680,7 +5680,7 @@ static bool is_hdmi2_sink(const struct drm_connector *connector) ...@@ -5680,7 +5680,7 @@ static bool is_hdmi2_sink(const struct drm_connector *connector)
return true; return true;
return connector->display_info.hdmi.scdc.supported || return connector->display_info.hdmi.scdc.supported ||
connector->display_info.color_formats & DRM_COLOR_FORMAT_YCRCB420; connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420;
} }
static inline bool is_eotf_supported(u8 output_eotf, u8 sink_eotf) static inline bool is_eotf_supported(u8 output_eotf, u8 sink_eotf)
......
...@@ -117,7 +117,7 @@ static int rockchip_dp_get_modes(struct analogix_dp_plat_data *plat_data, ...@@ -117,7 +117,7 @@ static int rockchip_dp_get_modes(struct analogix_dp_plat_data *plat_data,
{ {
struct drm_display_info *di = &connector->display_info; struct drm_display_info *di = &connector->display_info;
/* VOP couldn't output YUV video format for eDP rightly */ /* VOP couldn't output YUV video format for eDP rightly */
u32 mask = DRM_COLOR_FORMAT_YCRCB444 | DRM_COLOR_FORMAT_YCRCB422; u32 mask = DRM_COLOR_FORMAT_YCBCR444 | DRM_COLOR_FORMAT_YCBCR422;
if ((di->color_formats & mask)) { if ((di->color_formats & mask)) {
DRM_DEBUG_KMS("Swapping display color format from YUV to RGB\n"); DRM_DEBUG_KMS("Swapping display color format from YUV to RGB\n");
......
...@@ -522,9 +522,9 @@ struct drm_display_info { ...@@ -522,9 +522,9 @@ struct drm_display_info {
enum subpixel_order subpixel_order; enum subpixel_order subpixel_order;
#define DRM_COLOR_FORMAT_RGB444 (1<<0) #define DRM_COLOR_FORMAT_RGB444 (1<<0)
#define DRM_COLOR_FORMAT_YCRCB444 (1<<1) #define DRM_COLOR_FORMAT_YCBCR444 (1<<1)
#define DRM_COLOR_FORMAT_YCRCB422 (1<<2) #define DRM_COLOR_FORMAT_YCBCR422 (1<<2)
#define DRM_COLOR_FORMAT_YCRCB420 (1<<3) #define DRM_COLOR_FORMAT_YCBCR420 (1<<3)
/** /**
* @panel_orientation: Read only connector property for built-in panels, * @panel_orientation: Read only connector property for built-in panels,
......
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