public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: Maxime Ripard <mripard@kernel.org>,
	Nicolas Frattaroli	 <nicolas.frattaroli@collabora.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie	 <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	Harry Wentland	 <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Rodrigo Siqueira	 <siqueira@igalia.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Christian König	 <christian.koenig@amd.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>,
	Laurent Pinchart	 <Laurent.pinchart@ideasonboard.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Andy Yan <andy.yan@rock-chips.com>,
	Liviu Dudau	 <liviu.dudau@arm.com>,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno	
	<angelogioacchino.delregno@collabora.com>,
	Sandy Huang <hjc@rock-chips.com>,
	 Heiko Stübner	 <heiko@sntech.de>, Liu Ying <victor.liu@nxp.com>,
	Chen-Yu Tsai <wens@kernel.org>,
	 Samuel Holland <samuel@sholland.org>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	 Maíra Canal	 <mcanal@igalia.com>,
	Raspberry Pi Kernel Maintenance	 <kernel-list@raspberrypi.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	amd-gfx@lists.freedesktop.org,
	linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-sunxi@lists.linux.dev
Subject: Re: [PATCH 01/14] drm/connector: Introduce drm_output_color_format enum
Date: Thu, 26 Feb 2026 10:12:02 +0100	[thread overview]
Message-ID: <4ea869750681f5eee3bbb2978f4ff0ace70310a9.camel@pengutronix.de> (raw)
In-Reply-To: <20260224-drm-rework-color-formats-v1-1-bebc76604ada@kernel.org>

On Di, 2026-02-24 at 11:58 +0100, Maxime Ripard wrote:
> The EDID parsing code initially introduced the DRM_COLOR_FORMAT_*
> defines to represent the sink capabilities. Since a given sink could
> support multiple formats, it was first defined as a bitmask.
> 
> However, the core and drivers have since leveraged those defines to
> represent both the supported formats but also the current format being
> used.
> 
> Considering the latter case, the more natural, and consistent, thing to
> do would be to create an enum of all the possible formats, and then list
> the supported formats using a bitmask of the individual enum values.
> 
> Let's create a new enum following that pattern, drm_output_color_format,
> while maintaining the DRM_COLOR_FORMAT_* compatibility to make the
> transition easier.
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> ---
>  include/drm/drm_connector.h | 42 ++++++++++++++++++++++++++++++++++--------
>  1 file changed, 34 insertions(+), 8 deletions(-)
> 
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 7eaec37ae1c735334afa7dad15a38cf0c8b761b8..c67539708f636ae3905bb8424c63799bd1811f28 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -554,10 +554,35 @@ enum drm_colorspace {
>  	DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT	= 14,
>  	DRM_MODE_COLORIMETRY_BT601_YCC		= 15,
>  	DRM_MODE_COLORIMETRY_COUNT
>  };
>  
> +/**
> + * enum drm_output_color_format - Output Color Format
> + *
> + * This enum is a consolidated color format list supported by
> + * connectors. It's only ever really been used for HDMI and DP so far,
> + * so it's not exhaustive and can be extended to represent other formats
> + * in the future.
> + *
> + *
> + * @DRM_OUTPUT_COLOR_FORMAT_RGB444:
> + *   RGB output format
> + * @DRM_OUTPUT_COLOR_FORMAT_YCBCR444:
> + *   YCbCr 4:4:4 output format (ie. not subsampled)
> + * @DRM_OUTPUT_COLOR_FORMAT_YCBCR422:
> + *   YCbCr 4:2:2 output format (ie. with horizontal subsampling)
> + * @DRM_OUTPUT_COLOR_FORMAT_YCBCR420:
> + *   YCbCr 4:2:0 output format (ie. with horizontal and vertical subsampling)
> + */
> +enum drm_output_color_format {
> +	DRM_OUTPUT_COLOR_FORMAT_RGB444 = 0,
> +	DRM_OUTPUT_COLOR_FORMAT_YCBCR444,
> +	DRM_OUTPUT_COLOR_FORMAT_YCBCR422,
> +	DRM_OUTPUT_COLOR_FORMAT_YCBCR420,
> +};
> +
>  /**
>   * enum drm_bus_flags - bus_flags info for &drm_display_info
>   *
>   * This enum defines signal polarities and clock edge information for signals on
>   * a bus as bitmask flags.
> @@ -697,14 +722,14 @@ struct drm_display_info {
>  	/**
>  	 * @subpixel_order: Subpixel order of LCD panels.
>  	 */
>  	enum subpixel_order subpixel_order;
>  
> -#define DRM_COLOR_FORMAT_RGB444		(1<<0)
> -#define DRM_COLOR_FORMAT_YCBCR444	(1<<1)
> -#define DRM_COLOR_FORMAT_YCBCR422	(1<<2)
> -#define DRM_COLOR_FORMAT_YCBCR420	(1<<3)
> +#define DRM_COLOR_FORMAT_RGB444		(1 << DRM_OUTPUT_COLOR_FORMAT_RGB444)
> +#define DRM_COLOR_FORMAT_YCBCR444	(1 << DRM_OUTPUT_COLOR_FORMAT_YCBCR444)
> +#define DRM_COLOR_FORMAT_YCBCR422	(1 << DRM_OUTPUT_COLOR_FORMAT_YCBCR422)
> +#define DRM_COLOR_FORMAT_YCBCR420	(1 << DRM_OUTPUT_COLOR_FORMAT_YCBCR420)

Can we move this? Either up, directly after drm_output_color_format, or
down, directly before color_formats.

I think 8d70f395e6cb ("drm: Add support for a panel-orientation
connector property, v6") didn't separate the two on purpose.

>  	/**
>  	 * @panel_orientation: Read only connector property for built-in panels,
>  	 * indicating the orientation of the panel vs the device's casing.
>  	 * drm_connector_init() sets this to DRM_MODE_PANEL_ORIENTATION_UNKNOWN.
> @@ -712,14 +737,15 @@ struct drm_display_info {
>  	 * fb to compensate and gets exported as prop to userspace.
>  	 */
>  	int panel_orientation;
>  
>  	/**
> -	 * @color_formats: HDMI Color formats, selects between RGB and YCrCb
> -	 * modes. Used DRM_COLOR_FORMAT\_ defines, which are _not_ the same ones
> -	 * as used to describe the pixel format in framebuffers, and also don't
> -	 * match the formats in @bus_formats which are shared with v4l.
> +	 * @color_formats: HDMI Color formats, selects between RGB and
> +	 * YCrCb modes. Uses a bitmask of DRM_OUTPUT_COLOR_FORMAT\_

Maybe s/YCrCb/YCbCr/ for consistency?

> +	 * defines, which are _not_ the same ones as used to describe
> +	 * the pixel format in framebuffers, and also don't match the
> +	 * formats in @bus_formats which are shared with v4l.
>  	 */
>  	u32 color_formats;
>  
>  	/**
>  	 * @bus_formats: Pixel data format on the wire, somewhat redundant with

regards
Philipp

  reply	other threads:[~2026-02-26  9:12 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-24 10:58 [PATCH 00/14] drm: Create drm_output_color_format enum Maxime Ripard
2026-02-24 10:58 ` [PATCH 01/14] drm/connector: Introduce " Maxime Ripard
2026-02-26  9:12   ` Philipp Zabel [this message]
2026-02-27  5:17   ` Claude review: " Claude Code Review Bot
2026-02-24 10:58 ` [PATCH 02/14] drm/edid: Convert to " Maxime Ripard
2026-02-27  5:17   ` Claude review: " Claude Code Review Bot
2026-02-24 10:58 ` [PATCH 03/14] drm/display: hdmi: Convert to drm_output_color_format Maxime Ripard
2026-02-27  5:17   ` Claude review: " Claude Code Review Bot
2026-02-24 10:58 ` [PATCH 04/14] drm/amdgpu: display: " Maxime Ripard
2026-02-27  5:17   ` Claude review: " Claude Code Review Bot
2026-02-24 10:58 ` [PATCH 05/14] drm/bridge: adv7511: " Maxime Ripard
2026-02-27  5:17   ` Claude review: " Claude Code Review Bot
2026-02-24 10:58 ` [PATCH 06/14] drm/bridge: analogix: " Maxime Ripard
2026-02-27  5:17   ` Claude review: " Claude Code Review Bot
2026-02-24 10:58 ` [PATCH 07/14] drm/bridge: cadence: " Maxime Ripard
2026-02-27  5:17   ` Claude review: " Claude Code Review Bot
2026-02-24 10:58 ` [PATCH 08/14] drm/bridge: synopsys: dw-dp: " Maxime Ripard
2026-02-27  5:17   ` Claude review: " Claude Code Review Bot
2026-02-24 10:58 ` [PATCH 09/14] drm/bridge: synopsys: dw-hdmi: " Maxime Ripard
2026-02-26  8:59   ` Philipp Zabel
2026-02-27  5:17   ` Claude review: " Claude Code Review Bot
2026-02-24 10:58 ` [PATCH 10/14] drm/arm: komeda: " Maxime Ripard
2026-02-25 16:12   ` Liviu Dudau
2026-02-27  5:17   ` Claude review: " Claude Code Review Bot
2026-02-24 10:58 ` [PATCH 11/14] drm/mediatek: dp: " Maxime Ripard
2026-02-26  8:58   ` Philipp Zabel
2026-02-27  5:17   ` Claude review: " Claude Code Review Bot
2026-02-24 10:58 ` [PATCH 12/14] drm/rockchip: analogix: " Maxime Ripard
2026-02-27  5:17   ` Claude review: " Claude Code Review Bot
2026-02-24 10:58 ` [PATCH 13/14] drm/connector: Remove DRM_COLOR_FORMAT defines Maxime Ripard
2026-02-27  5:17   ` Claude review: " Claude Code Review Bot
2026-02-24 10:58 ` [PATCH 14/14] drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace Maxime Ripard
2026-02-24 12:43   ` Jani Nikula
2026-02-25 17:03   ` Nicolas Frattaroli
2026-02-25 17:21     ` Nicolas Frattaroli
2026-02-26 16:24   ` Nicolas Frattaroli
2026-02-27  5:17   ` Claude review: " Claude Code Review Bot
2026-02-24 12:44 ` [PATCH 00/14] drm: Create drm_output_color_format enum Jani Nikula
2026-02-27  5:17 ` Claude review: " Claude Code Review Bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ea869750681f5eee3bbb2978f4ff0ace70310a9.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andrzej.hajda@intel.com \
    --cc=andy.yan@rock-chips.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=christian.koenig@amd.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=jani.nikula@linux.intel.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel-list@raspberrypi.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=liviu.dudau@arm.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mcanal@igalia.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=nicolas.frattaroli@collabora.com \
    --cc=rfoss@kernel.org \
    --cc=samuel@sholland.org \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@amd.com \
    --cc=tzimmermann@suse.de \
    --cc=victor.liu@nxp.com \
    --cc=wens@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox