From: Liviu Dudau <liviu.dudau@arm.com>
To: Maxime Ripard <mripard@kernel.org>
Cc: 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>,
Chun-Kuang Hu <chunkuang.hu@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
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>,
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 10/14] drm/arm: komeda: Convert to drm_output_color_format
Date: Wed, 25 Feb 2026 16:12:08 +0000 [thread overview]
Message-ID: <aZ8fWNYrwyxr0vqC@e142607> (raw)
In-Reply-To: <20260224-drm-rework-color-formats-v1-10-bebc76604ada@kernel.org>
On Tue, Feb 24, 2026 at 11:58:49AM +0100, Maxime Ripard wrote:
> 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 different 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.
>
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
For the first patch in the series that introduces the enum and this one:
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Best regards,
Liviu
> ---
> drivers/gpu/drm/arm/display/komeda/d71/d71_component.c | 14 +++++++-------
> drivers/gpu/drm/arm/display/komeda/komeda_crtc.c | 2 +-
> drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h | 5 +++--
> drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c | 2 +-
> 4 files changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c b/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c
> index 67e5d3b4190f62549bc8da700deb4b15e138b515..27ca2930cdac6e76a058102ea2c1d8306d85e751 100644
> --- a/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c
> +++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_component.c
> @@ -1078,15 +1078,15 @@ 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_YCBCR420)
> + if (st->color_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR420)
> ctrl |= IPS_CTRL_YUV | IPS_CTRL_CHD422 | IPS_CTRL_CHD420;
> - else if (st->color_format == DRM_COLOR_FORMAT_YCBCR422)
> + else if (st->color_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR422)
> ctrl |= IPS_CTRL_YUV | IPS_CTRL_CHD422;
> - else if (st->color_format == DRM_COLOR_FORMAT_YCBCR444)
> + else if (st->color_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR444)
> ctrl |= IPS_CTRL_YUV;
>
> malidp_write32_mask(reg, BLK_CONTROL, mask, ctrl);
> }
>
> @@ -1143,16 +1143,16 @@ static int d71_improc_init(struct d71_dev *d71,
> return PTR_ERR(c);
> }
>
> improc = to_improc(c);
> improc->supported_color_depths = BIT(8) | BIT(10);
> - improc->supported_color_formats = DRM_COLOR_FORMAT_RGB444 |
> - DRM_COLOR_FORMAT_YCBCR444 |
> - DRM_COLOR_FORMAT_YCBCR422;
> + improc->supported_color_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) |
> + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444) |
> + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
> value = malidp_read32(reg, BLK_INFO);
> if (value & IPS_INFO_CHD420)
> - improc->supported_color_formats |= DRM_COLOR_FORMAT_YCBCR420;
> + improc->supported_color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420);
>
> improc->supports_csc = true;
> improc->supports_gamma = true;
>
> return 0;
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
> index 5a66948ffd24343cfc144e9b500679fd0c6bf43b..e78604469ef74800a4cac1e854821578b7e7bce8 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
> @@ -38,11 +38,11 @@ void komeda_crtc_get_color_config(struct drm_crtc_state *crtc_st,
> min_bpc = conn_bpc;
> }
>
> /* connector doesn't config any color_format, use RGB444 as default */
> if (!conn_color_formats)
> - conn_color_formats = DRM_COLOR_FORMAT_RGB444;
> + conn_color_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444);
>
> *color_depths = GENMASK(min_bpc, 0);
> *color_formats = conn_color_formats;
> }
>
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
> index ac8725e248537e5737d16cd36860401c42073500..dbe93894b2f6a193e24963d497ebb7b717ce3ebb 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
> @@ -315,20 +315,21 @@ struct komeda_splitter_state {
> u16 overlap;
> };
>
> struct komeda_improc {
> struct komeda_component base;
> - u32 supported_color_formats; /* DRM_RGB/YUV444/YUV420*/
> + u32 supported_color_formats; /* BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444/YUV444/YUV420) */
> u32 supported_color_depths; /* BIT(8) | BIT(10)*/
> u8 supports_degamma : 1;
> u8 supports_csc : 1;
> u8 supports_gamma : 1;
> };
>
> struct komeda_improc_state {
> struct komeda_component_state base;
> - u8 color_format, color_depth;
> + enum drm_output_color_format color_format;
> + u8 color_depth;
> u16 hsize, vsize;
> u32 fgamma_coeffs[KOMEDA_N_GAMMA_COEFFS];
> u32 ctm_coeffs[KOMEDA_N_CTM_COEFFS];
> };
>
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
> index f4e76b46ca327a1c5db9bdbdd9550b45190b30d8..6f9b10cc831ff748296b9ed30b6de398c90c4786 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
> @@ -797,11 +797,11 @@ komeda_improc_validate(struct komeda_improc *improc,
> improc->supported_color_formats);
> return -EINVAL;
> }
>
> st->color_depth = __fls(avail_depths);
> - st->color_format = BIT(__ffs(avail_formats));
> + st->color_format = __ffs(avail_formats);
> }
>
> if (kcrtc_st->base.color_mgmt_changed) {
> drm_lut_to_fgamma_coeffs(kcrtc_st->base.gamma_lut,
> st->fgamma_coeffs);
>
> --
> 2.52.0
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
next prev parent reply other threads:[~2026-02-25 16:14 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
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 [this message]
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=aZ8fWNYrwyxr0vqC@e142607 \
--to=liviu.dudau@arm.com \
--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=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=p.zabel@pengutronix.de \
--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