From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0FD8ACF257C for ; Wed, 19 Nov 2025 04:18:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8y/YJ/TJv8GqyQ/qPJ6fD96C3WkbWvrxy79YMGT7hN8=; b=vxrZh9ThngQJAl j9mRDTJB6jBb86AEDat9UE2WTrASuhFKgPDN7TxKPSx/XP6rWgy902L2OXmQvhPf+yrQzDYRZj7UH ySKyZ6I7rK1/Ip1jh7Wq6H8u7kNSoD1L6RClu36O+6CJMedm27Ps9dl7GBoYJI4ORyx6gYWdYlQ1D LRIx9yBFHpwkPyyCegd5YSXMhXzKKyVw7dpaAGujUx/cvsQXeiXFwyIHiTYrSbgRM0NbCULA1slWV MEyGDTeEAihCyXpiZ4lYEMDmNCGZyO9ls+UtjaFXgfr4upctgHGE+TP52/J/v8pud/mAwbZoE+D1v 6Rb6nzsR/l/O/Xpa9Ulg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vLZe6-00000001eSZ-3YZh; Wed, 19 Nov 2025 04:18:18 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vLZe3-00000001eP7-2l4g; Wed, 19 Nov 2025 04:18:16 +0000 Received: from pendragon.ideasonboard.com (unknown [205.220.129.225]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 08E8FDD9; Wed, 19 Nov 2025 05:16:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1763525770; bh=Co0SQdTL8Op1neOiTCduNOiGp6gu3Kt8Xc6qs6rJnZw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Avztu/6TS5bq2e/sK12229OUVbG1IkQ3SJlt5Fqo3xPeyTSpPD8yNyN0X5siBD4en mW9jba6o5mX6EH5BjkWy76EjvT/FJ7O1k2YlK4EJ66NWd3pc5/gguO1iuq6F8EhpQ/ g24tg3xmkJxc5vkin6RTxvPBT08bdLkKnWYztSDE= Date: Wed, 19 Nov 2025 13:17:47 +0900 From: Laurent Pinchart To: Nicolas Frattaroli Cc: Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , Christian =?utf-8?B?S8O2bmln?= , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Sandy Huang , Heiko =?utf-8?Q?St=C3=BCbner?= , Andy Yan , Jani Nikula , Rodrigo Vivi , Joonas Lahtinen , Tvrtko Ursulin , kernel@collabora.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Subject: Re: [PATCH v4 06/10] drm/rockchip: dw_hdmi_qp: Set supported_formats platdata Message-ID: <20251119041747.GF10711@pendragon.ideasonboard.com> References: <20251117-color-format-v4-0-0ded72bd1b00@collabora.com> <20251117-color-format-v4-6-0ded72bd1b00@collabora.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20251117-color-format-v4-6-0ded72bd1b00@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251118_201815_832379_BCB835C2 X-CRM114-Status: GOOD ( 24.76 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org On Mon, Nov 17, 2025 at 08:11:50PM +0100, Nicolas Frattaroli wrote: > With the introduction of the supported_formats member in the > dw-hdmi-qp platform data struct, drivers that have access to this > information should now set it. > > Set it in the rockchip dw_hdmi_qp glue driver, where such a bitmask of > supported color formats already exists. It just needs to be converted to > the appropriate HDMI_COLORSPACE_ mask. > > This allows this information to be passed down to the dw-hdmi-qp core, > which sets it in the bridge it creates, and consequently will allow the > common HDMI bridge code to act on it. > > Signed-off-by: Nicolas Frattaroli > --- > drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c > index c9fe6aa3e3e3..7c294751de19 100644 > --- a/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c > +++ b/drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c > @@ -468,6 +468,28 @@ static const struct of_device_id dw_hdmi_qp_rockchip_dt_ids[] = { > }; > MODULE_DEVICE_TABLE(of, dw_hdmi_qp_rockchip_dt_ids); > > +static const u32 supported_colorformats = DRM_COLOR_FORMAT_AUTO | > + DRM_COLOR_FORMAT_RGB444 | > + DRM_COLOR_FORMAT_YCBCR444; > + > +static unsigned int __pure drm_to_hdmi_fmts(const u32 fmt) > +{ > + unsigned int res = 0; > + > + if (fmt & DRM_COLOR_FORMAT_AUTO) > + res |= BIT(HDMI_COLORSPACE_RGB); > + if (fmt & DRM_COLOR_FORMAT_RGB444) > + res |= BIT(HDMI_COLORSPACE_RGB); > + if (fmt & DRM_COLOR_FORMAT_YCBCR444) > + res |= BIT(HDMI_COLORSPACE_YUV444); > + if (fmt & DRM_COLOR_FORMAT_YCBCR422) > + res |= BIT(HDMI_COLORSPACE_YUV422); > + if (fmt & DRM_COLOR_FORMAT_YCBCR420) > + res |= BIT(HDMI_COLORSPACE_YUV420); > + > + return res; > +} > + This would be greatly simplified by turning supported_formats into a bitmask of DRM_MODE_COLOR_FORMAT_* values, as suggested in 05/10. > static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master, > void *data) > { > @@ -521,6 +543,8 @@ static int dw_hdmi_qp_rockchip_bind(struct device *dev, struct device *master, > plat_data.phy_data = hdmi; > plat_data.max_bpc = 10; > > + plat_data.supported_formats = drm_to_hdmi_fmts(supported_colorformats); > + > encoder = &hdmi->encoder.encoder; > encoder->possible_crtcs = drm_of_find_possible_crtcs(drm, dev->of_node); > -- Regards, Laurent Pinchart _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip