Skip to content

Commit

Permalink
drm/connector: Fix typo in output format
Browse files Browse the repository at this point in the history
The HDMI specification mentions YCbCr everywhere, but our enums have
YCrCb. Let's rename it to match.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
  • Loading branch information
mripard authored and intel-lab-lkp committed Jan 13, 2022
1 parent 89efd2a commit 52bba93
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
Expand Up @@ -5831,7 +5831,7 @@ static void fill_stream_properties_from_drm_display_mode(
else if (drm_mode_is_420_also(info, mode_in)
&& aconnector->force_yuv420_output)
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)
timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR444;
else
Expand Down
12 changes: 6 additions & 6 deletions drivers/gpu/drm/arm/display/komeda/d71/d71_component.c
Expand Up @@ -1078,11 +1078,11 @@ static void d71_improc_update(struct komeda_component *c,
mask |= IPS_CTRL_YUV | IPS_CTRL_CHD422 | IPS_CTRL_CHD420;

/* 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;
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;
else if (st->color_format == DRM_COLOR_FORMAT_YCRCB444)
else if (st->color_format == DRM_COLOR_FORMAT_YCBCR444)
ctrl |= IPS_CTRL_YUV;

malidp_write32_mask(reg, BLK_CONTROL, mask, ctrl);
Expand Down Expand Up @@ -1144,11 +1144,11 @@ static int d71_improc_init(struct d71_dev *d71,
improc = to_improc(c);
improc->supported_color_depths = BIT(8) | BIT(10);
improc->supported_color_formats = DRM_COLOR_FORMAT_RGB444 |
DRM_COLOR_FORMAT_YCRCB444 |
DRM_COLOR_FORMAT_YCRCB422;
DRM_COLOR_FORMAT_YCBCR444 |
DRM_COLOR_FORMAT_YCBCR422;
value = malidp_read32(reg, BLK_INFO);
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_gamma = true;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
Expand Up @@ -223,7 +223,7 @@ static void adv7511_set_config_csc(struct adv7511 *adv7511,
config.csc_coefficents = adv7511_csc_ycbcr_to_rgb;

if ((connector->display_info.color_formats &
DRM_COLOR_FORMAT_YCRCB422) &&
DRM_COLOR_FORMAT_YCBCR422) &&
config.hdmi_mode) {
config.csc_enable = false;
config.avi_infoframe.colorspace =
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
Expand Up @@ -1537,9 +1537,9 @@ static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge,
video->color_depth = COLOR_8;
break;
}
if (display_info->color_formats & DRM_COLOR_FORMAT_YCRCB444)
if (display_info->color_formats & DRM_COLOR_FORMAT_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;
else
video->color_space = COLOR_RGB;
Expand Down
18 changes: 9 additions & 9 deletions drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
Expand Up @@ -1553,13 +1553,13 @@ static u32 cdns_mhdp_get_bpp(struct cdns_mhdp_display_fmt *fmt)

switch (fmt->color_format) {
case DRM_COLOR_FORMAT_RGB444:
case DRM_COLOR_FORMAT_YCRCB444:
case DRM_COLOR_FORMAT_YCBCR444:
bpp = fmt->bpc * 3;
break;
case DRM_COLOR_FORMAT_YCRCB422:
case DRM_COLOR_FORMAT_YCBCR422:
bpp = fmt->bpc * 2;
break;
case DRM_COLOR_FORMAT_YCRCB420:
case DRM_COLOR_FORMAT_YCBCR420:
bpp = fmt->bpc * 3 / 2;
break;
default:
Expand Down Expand Up @@ -1767,8 +1767,8 @@ static void cdns_mhdp_configure_video(struct cdns_mhdp_device *mhdp,
* If YCBCR supported and stream not SD, use ITU709
* Need to handle ITU version with YCBCR420 when supported
*/
if ((pxlfmt == DRM_COLOR_FORMAT_YCRCB444 ||
pxlfmt == DRM_COLOR_FORMAT_YCRCB422) && mode->crtc_vdisplay >= 720)
if ((pxlfmt == DRM_COLOR_FORMAT_YCBCR444 ||
pxlfmt == DRM_COLOR_FORMAT_YCBCR422) && mode->crtc_vdisplay >= 720)
misc0 = DP_YCBCR_COEFFICIENTS_ITU709;

bpp = cdns_mhdp_get_bpp(&mhdp->display_fmt);
Expand All @@ -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;
misc0 |= DP_COLOR_FORMAT_RGB;
break;
case DRM_COLOR_FORMAT_YCRCB444:
case DRM_COLOR_FORMAT_YCBCR444:
pxl_repr = CDNS_DP_FRAMER_YCBCR444 << CDNS_DP_FRAMER_PXL_FORMAT;
misc0 |= DP_COLOR_FORMAT_YCbCr444 | DP_TEST_DYNAMIC_RANGE_CEA;
break;
case DRM_COLOR_FORMAT_YCRCB422:
case DRM_COLOR_FORMAT_YCBCR422:
pxl_repr = CDNS_DP_FRAMER_YCBCR422 << CDNS_DP_FRAMER_PXL_FORMAT;
misc0 |= DP_COLOR_FORMAT_YCbCr422 | DP_TEST_DYNAMIC_RANGE_CEA;
break;
case DRM_COLOR_FORMAT_YCRCB420:
case DRM_COLOR_FORMAT_YCBCR420:
pxl_repr = CDNS_DP_FRAMER_YCBCR420 << CDNS_DP_FRAMER_PXL_FORMAT;
break;
default:
Expand Down Expand Up @@ -1882,7 +1882,7 @@ static void cdns_mhdp_configure_video(struct cdns_mhdp_device *mhdp,
if (mhdp->display_fmt.y_only)
misc1 |= CDNS_DP_TEST_COLOR_FORMAT_RAW_Y_ONLY;
/* Use VSC SDP for Y420 */
if (pxlfmt == DRM_COLOR_FORMAT_YCRCB420)
if (pxlfmt == DRM_COLOR_FORMAT_YCBCR420)
misc1 = CDNS_DP_TEST_VSC_SDP;

cdns_mhdp_reg_write(mhdp, CDNS_DP_MSA_MISC(stream_id),
Expand Down
16 changes: 8 additions & 8 deletions drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
Expand Up @@ -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;
u8 max_bpc = conn_state->max_requested_bpc;
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;
unsigned int i = 0;

Expand Down Expand Up @@ -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 (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_RGB161616_1X48;
}

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;

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_RGB121212_1X36;
}

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;

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_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;

if (info->color_formats & DRM_COLOR_FORMAT_YCRCB444)
if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444)
output_fmts[i++] = MEDIA_BUS_FMT_YUV8_1X24;

/* Default 8bit RGB fallback */
Expand Down
16 changes: 8 additions & 8 deletions drivers/gpu/drm/drm_edid.c
Expand Up @@ -3776,7 +3776,7 @@ static int do_y420vdb_modes(struct drm_connector *connector,
}

if (modes > 0)
info->color_formats |= DRM_COLOR_FORMAT_YCRCB420;
info->color_formats |= DRM_COLOR_FORMAT_YCBCR420;
return modes;
}

Expand Down Expand Up @@ -4279,7 +4279,7 @@ static void drm_parse_y420cmdb_bitmap(struct drm_connector *connector,
if (map_len == 0) {
/* All CEA modes support ycbcr420 sampling also.*/
hdmi->y420_cmdb_map = U64_MAX;
info->color_formats |= DRM_COLOR_FORMAT_YCRCB420;
info->color_formats |= DRM_COLOR_FORMAT_YCBCR420;
return;
}

Expand All @@ -4302,7 +4302,7 @@ static void drm_parse_y420cmdb_bitmap(struct drm_connector *connector,
map |= (u64)db[2 + count] << (8 * count);

if (map)
info->color_formats |= DRM_COLOR_FORMAT_YCRCB420;
info->color_formats |= DRM_COLOR_FORMAT_YCBCR420;

hdmi->y420_cmdb_map = map;
}
Expand Down Expand Up @@ -5158,9 +5158,9 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
/* The existence of a CEA block should imply RGB support */
info->color_formats = DRM_COLOR_FORMAT_RGB444;
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)
info->color_formats |= DRM_COLOR_FORMAT_YCRCB422;
info->color_formats |= DRM_COLOR_FORMAT_YCBCR422;

if (cea_db_offsets(edid_ext, &start, &end))
return;
Expand Down Expand Up @@ -5388,9 +5388,9 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi

info->color_formats |= DRM_COLOR_FORMAT_RGB444;
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)
info->color_formats |= DRM_COLOR_FORMAT_YCRCB422;
info->color_formats |= DRM_COLOR_FORMAT_YCBCR422;

drm_update_mso(connector, edid);

Expand Down Expand Up @@ -5645,7 +5645,7 @@ static bool is_hdmi2_sink(const struct drm_connector *connector)
return true;

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)
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
Expand Up @@ -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;
/* 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_YCRCB422;

if ((di->color_formats & mask)) {
DRM_DEBUG_KMS("Swapping display color format from YUV to RGB\n");
Expand Down
6 changes: 3 additions & 3 deletions include/drm/drm_connector.h
Expand Up @@ -522,9 +522,9 @@ struct drm_display_info {
enum subpixel_order subpixel_order;

#define DRM_COLOR_FORMAT_RGB444 (1<<0)
#define DRM_COLOR_FORMAT_YCRCB444 (1<<1)
#define DRM_COLOR_FORMAT_YCRCB422 (1<<2)
#define DRM_COLOR_FORMAT_YCRCB420 (1<<3)
#define DRM_COLOR_FORMAT_YCBCR444 (1<<1)
#define DRM_COLOR_FORMAT_YCBCR422 (1<<2)
#define DRM_COLOR_FORMAT_YCBCR420 (1<<3)

/**
* @panel_orientation: Read only connector property for built-in panels,
Expand Down

0 comments on commit 52bba93

Please sign in to comment.