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

Configure Feed

Select the types of activity you want to include in your feed.

drm/edid: Convert to drm_output_color_format enum

Now that we introduced a new drm_output_color_format enum to represent
what DRM_COLOR_FORMAT_* bits were representing, we can switch to the new
enum.

The main difference is that while DRM_COLOR_FORMAT_ was a bitmask,
drm_output_color_format is a proper enum. However, the enum was done is
such a way than DRM_COLOR_FORMAT_X = BIT(DRM_OUTPUT_COLOR_FORMAT_X) so
the transitition is easier.

The only thing we need to consider is if the original code meant to use
that value as a bitmask, in which case we do need to keep the bit shift,
or as a discriminant in which case we don't.

Acked-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260305-drm-rework-color-formats-v3-2-f3935f6db579@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>

+9 -9
+9 -9
drivers/gpu/drm/drm_edid.c
··· 5316 5316 5317 5317 out: 5318 5318 if (map) 5319 - info->color_formats |= DRM_COLOR_FORMAT_YCBCR420; 5319 + info->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420); 5320 5320 5321 5321 *y420cmdb_map = map; 5322 5322 } ··· 6092 6092 continue; 6093 6093 6094 6094 bitmap_set(hdmi->y420_vdb_modes, vic, 1); 6095 - info->color_formats |= DRM_COLOR_FORMAT_YCBCR420; 6095 + info->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420); 6096 6096 } 6097 6097 } 6098 6098 ··· 6426 6426 info->cea_rev, edid_ext[1]); 6427 6427 6428 6428 /* The existence of a CTA extension should imply RGB support */ 6429 - info->color_formats = DRM_COLOR_FORMAT_RGB444; 6429 + info->color_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444); 6430 6430 if (edid_ext[3] & EDID_CEA_YCRCB444) 6431 - info->color_formats |= DRM_COLOR_FORMAT_YCBCR444; 6431 + info->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444); 6432 6432 if (edid_ext[3] & EDID_CEA_YCRCB422) 6433 - info->color_formats |= DRM_COLOR_FORMAT_YCBCR422; 6433 + info->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422); 6434 6434 if (edid_ext[3] & EDID_BASIC_AUDIO) 6435 6435 info->has_audio = true; 6436 6436 ··· 6698 6698 if (!drm_edid_is_digital(drm_edid)) 6699 6699 goto out; 6700 6700 6701 - info->color_formats |= DRM_COLOR_FORMAT_RGB444; 6701 + info->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444); 6702 6702 drm_parse_cea_ext(connector, drm_edid); 6703 6703 6704 6704 update_displayid_info(connector, drm_edid); ··· 6752 6752 connector->base.id, connector->name, info->bpc); 6753 6753 6754 6754 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444) 6755 - info->color_formats |= DRM_COLOR_FORMAT_YCBCR444; 6755 + info->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444); 6756 6756 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422) 6757 - info->color_formats |= DRM_COLOR_FORMAT_YCBCR422; 6757 + info->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422); 6758 6758 6759 6759 drm_update_mso(connector, drm_edid); 6760 6760 ··· 7229 7229 return true; 7230 7230 7231 7231 return connector->display_info.hdmi.scdc.supported || 7232 - connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420; 7232 + connector->display_info.color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420); 7233 7233 } 7234 7234 7235 7235 static u8 drm_mode_hdmi_vic(const struct drm_connector *connector,