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/bridge: synopsys: dw-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.

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
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-9-f3935f6db579@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>

+8 -8
+8 -8
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
··· 2664 2664 struct drm_display_mode *mode = &crtc_state->mode; 2665 2665 u8 max_bpc = conn_state->max_requested_bpc; 2666 2666 bool is_hdmi2_sink = info->hdmi.scdc.supported || 2667 - (info->color_formats & DRM_COLOR_FORMAT_YCBCR420); 2667 + (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420)); 2668 2668 u32 *output_fmts; 2669 2669 unsigned int i = 0; 2670 2670 ··· 2723 2723 output_fmts[i++] = MEDIA_BUS_FMT_RGB888_1X24; 2724 2724 2725 2725 if (max_bpc >= 16 && info->bpc == 16) { 2726 - if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444) 2726 + if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444)) 2727 2727 output_fmts[i++] = MEDIA_BUS_FMT_YUV16_1X48; 2728 2728 2729 2729 output_fmts[i++] = MEDIA_BUS_FMT_RGB161616_1X48; 2730 2730 } 2731 2731 2732 2732 if (max_bpc >= 12 && info->bpc >= 12) { 2733 - if (info->color_formats & DRM_COLOR_FORMAT_YCBCR422) 2733 + if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422)) 2734 2734 output_fmts[i++] = MEDIA_BUS_FMT_UYVY12_1X24; 2735 2735 2736 - if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444) 2736 + if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444)) 2737 2737 output_fmts[i++] = MEDIA_BUS_FMT_YUV12_1X36; 2738 2738 2739 2739 output_fmts[i++] = MEDIA_BUS_FMT_RGB121212_1X36; 2740 2740 } 2741 2741 2742 2742 if (max_bpc >= 10 && info->bpc >= 10) { 2743 - if (info->color_formats & DRM_COLOR_FORMAT_YCBCR422) 2743 + if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422)) 2744 2744 output_fmts[i++] = MEDIA_BUS_FMT_UYVY10_1X20; 2745 2745 2746 - if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444) 2746 + if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444)) 2747 2747 output_fmts[i++] = MEDIA_BUS_FMT_YUV10_1X30; 2748 2748 2749 2749 output_fmts[i++] = MEDIA_BUS_FMT_RGB101010_1X30; 2750 2750 } 2751 2751 2752 - if (info->color_formats & DRM_COLOR_FORMAT_YCBCR422) 2752 + if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422)) 2753 2753 output_fmts[i++] = MEDIA_BUS_FMT_UYVY8_1X16; 2754 2754 2755 - if (info->color_formats & DRM_COLOR_FORMAT_YCBCR444) 2755 + if (info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444)) 2756 2756 output_fmts[i++] = MEDIA_BUS_FMT_YUV8_1X24; 2757 2757 2758 2758 *num_output_fmts = i;