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/display: hdmi: Convert to drm_output_color_format

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-3-f3935f6db579@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>

+4 -4
+4 -4
drivers/gpu/drm/display/drm_hdmi_state_helper.c
··· 428 428 * supported so we can keep things going and light up 429 429 * the display. 430 430 */ 431 - if (!(info->color_formats & DRM_COLOR_FORMAT_RGB444)) 431 + if (!(info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444))) 432 432 drm_warn(dev, "HDMI Sink doesn't support RGB, something's wrong.\n"); 433 433 434 434 if (bpc == 10 && !(info->edid_hdmi_rgb444_dc_modes & DRM_EDID_HDMI_DC_30)) { ··· 448 448 case HDMI_COLORSPACE_YUV420: 449 449 drm_dbg_kms(dev, "YUV420 format, checking the constraints.\n"); 450 450 451 - if (!(info->color_formats & DRM_COLOR_FORMAT_YCBCR420)) { 451 + if (!(info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420))) { 452 452 drm_dbg_kms(dev, "Sink doesn't support YUV420.\n"); 453 453 return false; 454 454 } ··· 480 480 case HDMI_COLORSPACE_YUV422: 481 481 drm_dbg_kms(dev, "YUV422 format, checking the constraints.\n"); 482 482 483 - if (!(info->color_formats & DRM_COLOR_FORMAT_YCBCR422)) { 483 + if (!(info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422))) { 484 484 drm_dbg_kms(dev, "Sink doesn't support YUV422.\n"); 485 485 return false; 486 486 } ··· 503 503 case HDMI_COLORSPACE_YUV444: 504 504 drm_dbg_kms(dev, "YUV444 format, checking the constraints.\n"); 505 505 506 - if (!(info->color_formats & DRM_COLOR_FORMAT_YCBCR444)) { 506 + if (!(info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444))) { 507 507 drm_dbg_kms(dev, "Sink doesn't support YUV444.\n"); 508 508 return false; 509 509 }