From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
To: Daniel Stone <daniel@fooishbar.org>
Cc: "Sandy Huang" <hjc@rock-chips.com>,
"Heiko Stübner" <heiko@sntech.de>,
"Andy Yan" <andy.yan@rock-chips.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>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Daniel Stone" <daniels@collabora.com>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"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>,
"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
"Nicolas Frattaroli" <nicolas.frattaroli@collabora.com>,
kernel@collabora.com, "Andy Yan" <andyshrk@163.com>,
dri-devel@lists.freedesktop.org,
linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
"Igor Paunovic" <royalnet026@gmail.com>
Subject: Re: [PATCH v5 08/15] drm/rockchip: vop2: Avoid DCLK source switch for 10-bit YUV422 output
Date: Wed, 4 Nov 2026 22:38:09 +0200 [thread overview]
Message-ID: <c823ced3-693a-4620-8a88-81cca7062c01@collabora.com> (raw)
In-Reply-To: <CAPj87rPsh_cVQWtGEisDrXWiT+Zj6D6n5wXpmbuoFvMKtOi7TA@mail.gmail.com>
Hi Daniel,
On 10/30/26 1:42 PM, Daniel Stone wrote:
> Hi,
>
> On Tue, 13 Oct 2026 at 23:51, Cristian Ciocaltea
> <cristian.ciocaltea@collabora.com> wrote:
>> if (vop2->pll_hdmiphy0 || vop2->pll_hdmiphy1) {
>> - unsigned int bpc = vcstate->output_bpc ?: 8;
>> + /*
>> + * YUV422 always transmits two 12-bit components per clock
>> + * cycle, regardless of the color depth, which from a rate
>> + * perspective is equivalent to three 8-bit RGB components.
>> + * Force 8 bpc here so the bandwidth check reflects the actual
>> + * TMDS rate and avoids an unnecessary DCLK source switch.
>> + */
>> + unsigned int bpc = vcstate->output_mode == ROCKCHIP_OUT_MODE_YUV422 ?
>> + 8 : (vcstate->output_bpc ?: 8);
>
> The nested ternary is pretty violent; please write it out explicitly.
> Either way, the equivalent clock adjustment for YUV420 is handled in
> the setup_intf_mux() handler, so would it be better for YUV422 to also
> live there, rather than mashed in with bpc here?
Moving YUV422 into setup_intf_mux() wouldn't work, because that function returns
the real DCLK rate. The YUV420 halving there is justified, but for YUV422 the
DCLK simply equals the pixel clock.
What's actually not great here is the bandwidth check, as it tries to rebuild
the TMDS rate from DCLK.
Apart from the YUV422 special handling, there's another complication: when vop2
processes multiple pixels per clock cycle, DCLK is only a fraction of the pixel
clock, e.g. RK3576 halves it for pixel clocks above 600 MHz. This will
interfere with upcoming HDMI 2.1 support - e.g. FRL mode such as 4K@120Hz 8-bit
RGB, with a pixel clock of 1188 MHz, ends up with a 594 MHz DCLK, which slips
under the limit and wrongly selects the HDMI PHY PLL as DCLK source.
I've reworked the source switch logic to rely on the actual TMDS character rate
computed by the HDMI connector state helpers, which already accounts for the
output color format and depth. It gives the same result as today for RGB and
YUV420, corrects the behaviour for YUV422 and upcoming FRL, and removes the bpc
handling entirely.
Thanks,
Cristian
next prev parent reply other threads:[~2026-11-04 20:38 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 22:51 [PATCH v5 00/15] Support 10-bit YUV422 and 8/10-bit YUV420 color format on DW HDMI QP Cristian Ciocaltea
2026-10-13 22:51 ` [PATCH v5 01/15] dt-bindings: display: vop2: Add missing reset properties Cristian Ciocaltea
2026-10-13 22:51 ` [PATCH v5 02/15] drm/rockchip: vop2: Fix resource leak on vop2_enable() error path Cristian Ciocaltea
2026-10-30 11:34 ` Daniel Stone
2026-10-13 22:51 ` [PATCH v5 03/15] drm/rockchip: vop2: Balance state on atomic_enable() error paths Cristian Ciocaltea
2026-10-13 22:51 ` [PATCH v5 04/15] drm/rockchip: vop2: Send pending event when atomic_enable() fails Cristian Ciocaltea
2026-10-30 11:21 ` Daniel Stone
2026-11-04 20:13 ` Cristian Ciocaltea
2026-10-13 22:51 ` [PATCH v5 05/15] drm/rockchip: vop2: Avoid division by zero when computing max_dclk Cristian Ciocaltea
2026-10-30 11:34 ` Daniel Stone
2026-10-13 22:51 ` [PATCH v5 06/15] drm/rockchip: vop2: Fix VOP2_MAX_DCLK_RATE overflow on 32-bit Cristian Ciocaltea
2026-10-30 11:36 ` Daniel Stone
2026-10-13 22:51 ` [PATCH v5 07/15] drm/rockchip: vop2: Reset AXI and DCLK to improve robustness Cristian Ciocaltea
2026-10-13 22:51 ` [PATCH v5 08/15] drm/rockchip: vop2: Avoid DCLK source switch for 10-bit YUV422 output Cristian Ciocaltea
2026-10-30 11:42 ` Daniel Stone
2026-11-04 20:38 ` Cristian Ciocaltea [this message]
2026-10-13 22:51 ` [PATCH v5 09/15] drm/rockchip: vop2: Consolidate HDMI PHY PLL clock parent switch Cristian Ciocaltea
2026-10-30 11:44 ` Daniel Stone
2026-11-04 20:41 ` Cristian Ciocaltea
2026-10-13 22:51 ` [PATCH v5 10/15] drm/rockchip: vop2: Switch to enum vop_csc_format Cristian Ciocaltea
2026-10-30 11:47 ` Daniel Stone
2026-10-13 22:51 ` [PATCH v5 11/15] drm/bridge: dw-hdmi-qp: Log resolution and refresh rate in atomic_enable() Cristian Ciocaltea
2026-10-30 11:48 ` Daniel Stone
2026-10-13 22:51 ` [PATCH v5 12/15] drm/rockchip: dw_hdmi_qp: Do not mask error code in atomic_check() Cristian Ciocaltea
2026-10-13 22:51 ` [PATCH v5 13/15] drm/rockchip: dw_hdmi_qp: Support 10-bit YUV422 output format Cristian Ciocaltea
2026-10-30 11:52 ` Daniel Stone
2026-11-04 20:56 ` Cristian Ciocaltea
2026-10-13 22:51 ` [PATCH v5 14/15] drm/rockchip: dw_hdmi_qp: Enable YUV420 " Cristian Ciocaltea
2026-10-13 22:51 ` [PATCH v5 15/15] arm64: dts: rockchip: Add RK3588 VOP2 resets Cristian Ciocaltea
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=c823ced3-693a-4620-8a88-81cca7062c01@collabora.com \
--to=cristian.ciocaltea@collabora.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=andy.yan@rock-chips.com \
--cc=andyshrk@163.com \
--cc=conor+dt@kernel.org \
--cc=daniel@fooishbar.org \
--cc=daniels@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=hjc@rock-chips.com \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=kernel@collabora.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=luca.ceresoli@bootlin.com \
--cc=maarten.lankhorst@linux.intel.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=robh@kernel.org \
--cc=royalnet026@gmail.com \
--cc=s.hauer@pengutronix.de \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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
all inboxes | Powered by JetHome®