Re: [PATCH 2/2] drm/amd/display: fix BT.2020 YCbCr output CSC matrices for DCE

Igor Paunovic <[email protected]> Mon, 3 Aug 2026 17:25:33 +0200
Newsgroups org.freedesktop.lists.amd-gfx,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Hi Nathan,

I hit exactly this on a DCE 11.2 part, so here is a data point for the
path you could not test.

Setup: XFX RX 580 8GB (Polaris10, DCE 11.2) as an external GPU on an
Orange Pi 5 Plus (RK3588, arm64) over PCIe Gen3 x4, driving a Sony 65"
HDR10 TV at 3840x2160@60 with HDR enabled under KWin/Wayland. The sink
lists 3840x2160@60 only in its YCbCr 4:2:0 video data block and caps
TMDS at 300 MHz, so the stream comes out as PIXEL_ENCODING_YCBCR420
(confirmed in hardware: FMT_CONTROL = 0x002a0000, FMT_PIXEL_ENCODING = 2),
and with the compositor setting Colorspace=BT2020_RGB the output color
space ends up COLOR_SPACE_2020_YCBCR_LIMITED.

My tree predates 51e6668ab4ba, so global_color_matrix[] had no BT.2020
row at all. That is worth recording as its own failure mode: with no
matching entry, dce110_opp_set_csc_default() programs no matrix and
configure_graphics_mode() leaves OUTPUT_CSC_GRPH_MODE at 0, so the
output CSC stays bypassed and plain RGB is fed to the 4:2:0 formatter
while the AVI infoframe declares YCbCr 4:2:0 with BT.2020 colorimetry.
The sink then applies a BT.2020 YCbCr to RGB matrix to RGB data: luma
lands on green, Cb/Cr sit near mid scale, and the picture is washed out
with a heavy green cast. SDR on the same link was fine, since it stays
on the BT.709 entry.

Applying 51e6668ab4ba plus this series on top of 7.0 fixes it: colors
are correct on that TV in HDR, across a reboot, with no amdgpu errors in
the log. As a cross-check, the same desktop on a second monitor driven
by a completely different pipeline (the SoC's own display controller)
now matches it.

I also booted 51e6668ab4ba without this series on the same setup and
could not tell the two apart by eye. That is not a counter-argument to
the fix, just a note on sensitivity: the compositor maps SDR content to
around 350 nits, so nothing gets near the top of the PQ range where the
full-range luma scaling would clip, and the residual difference stays
below what this TV's processing reveals.

Tested-by: Igor Paunovic <[email protected]>

Thanks,
Igor