public inbox for linux-mediatek@lists.infradead.org
 help / color / mirror / Atom feed
From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
To: "Jani Nikula" <jani.nikula@linux.intel.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"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>,
	"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>,
	"Maxime Ripard" <mripard@kernel.org>
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,
	Jani Nikula <jani.nikula@intel.com>
Subject: Re: [PATCH v3 12/14] drm/rockchip: analogix: Convert to drm_output_color_format
Date: Tue, 24 Mar 2026 10:16:14 +0100	[thread overview]
Message-ID: <5921295.GXAFRqVoOG@workhorse> (raw)
In-Reply-To: <20260305-drm-rework-color-formats-v3-12-f3935f6db579@kernel.org>

On Thursday, 5 March 2026 10:05:04 Central European Standard Time 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 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>
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> ---
>  drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> index fdab71d51e2a71d644f128b1bf1c39429b4ad52a..96bd3dd239d251af3d5a7d0fbd4dd74942d44f2d 100644
> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> @@ -169,16 +169,16 @@ static int rockchip_dp_powerdown(struct analogix_dp_plat_data *plat_data)
>  static int rockchip_dp_get_modes(struct analogix_dp_plat_data *plat_data,
>  				 struct drm_connector *connector)
>  {
>  	struct drm_display_info *di = &connector->display_info;
>  	/* VOP couldn't output YUV video format for eDP rightly */
> -	u32 mask = DRM_COLOR_FORMAT_YCBCR444 | DRM_COLOR_FORMAT_YCBCR422;
> +	u32 mask = BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444) | BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
>  
>  	if ((di->color_formats & mask)) {
>  		DRM_DEBUG_KMS("Swapping display color format from YUV to RGB\n");
>  		di->color_formats &= ~mask;
> -		di->color_formats |= DRM_COLOR_FORMAT_RGB444;
> +		di->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444);
>  		di->bpc = 8;
>  	}
>  
>  	return 0;
>  }
> 
> 

Reviewed-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>

I'm not the maintainer of this driver, but touched both the color
formats and rockchip code enough to confidently state that this
patch is trivially correct. I'm sure Heiko and Andy will agree. :)

Kind regards,
Nicolas Frattaroli




  reply	other threads:[~2026-03-24  9:17 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-05  9:04 [PATCH v3 00/14] drm: Create drm_output_color_format enum Maxime Ripard
2026-03-05  9:04 ` [PATCH v3 01/14] drm/connector: Introduce " Maxime Ripard
2026-03-23  4:07   ` Dmitry Baryshkov
2026-03-05  9:04 ` [PATCH v3 02/14] drm/edid: Convert to " Maxime Ripard
2026-03-23  4:07   ` Dmitry Baryshkov
2026-03-05  9:04 ` [PATCH v3 03/14] drm/display: hdmi: Convert to drm_output_color_format Maxime Ripard
2026-03-23  4:07   ` Dmitry Baryshkov
2026-03-05  9:04 ` [PATCH v3 04/14] drm/amdgpu: display: " Maxime Ripard
2026-03-24  9:11   ` Nicolas Frattaroli
2026-03-05  9:04 ` [PATCH v3 05/14] drm/bridge: adv7511: " Maxime Ripard
2026-03-23  4:07   ` Dmitry Baryshkov
2026-03-05  9:04 ` [PATCH v3 06/14] drm/bridge: analogix: " Maxime Ripard
2026-03-23  4:08   ` Dmitry Baryshkov
2026-03-05  9:04 ` [PATCH v3 07/14] drm/bridge: cadence: " Maxime Ripard
2026-03-23  4:03   ` Dmitry Baryshkov
2026-03-05  9:05 ` [PATCH v3 08/14] drm/bridge: synopsys: dw-dp: " Maxime Ripard
2026-03-23  4:08   ` Dmitry Baryshkov
2026-03-05  9:05 ` [PATCH v3 09/14] drm/bridge: synopsys: dw-hdmi: " Maxime Ripard
2026-03-23  4:08   ` Dmitry Baryshkov
2026-03-05  9:05 ` [PATCH v3 10/14] drm/arm: komeda: " Maxime Ripard
2026-03-05  9:05 ` [PATCH v3 11/14] drm/mediatek: dp: " Maxime Ripard
2026-03-22 14:01   ` Chun-Kuang Hu
2026-03-05  9:05 ` [PATCH v3 12/14] drm/rockchip: analogix: " Maxime Ripard
2026-03-24  9:16   ` Nicolas Frattaroli [this message]
2026-03-05  9:05 ` [PATCH v3 13/14] drm/connector: Remove DRM_COLOR_FORMAT defines Maxime Ripard
2026-03-23  4:08   ` Dmitry Baryshkov
2026-03-05  9:05 ` [PATCH v3 14/14] drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace Maxime Ripard
2026-03-23  4:10   ` Dmitry Baryshkov
2026-03-24  9:08   ` Nicolas Frattaroli
2026-03-24 12:55 ` [PATCH v3 00/14] drm: Create drm_output_color_format enum Maxime Ripard

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=5921295.GXAFRqVoOG@workhorse \
    --to=nicolas.frattaroli@collabora.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@intel.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=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