r600: Report multi-plane formats as unsupported
authorAndres Calderon Jaramillo <andrescj@chromium.org>
Sat, 15 Apr 2023 06:34:14 +0000 (06:34 +0000)
committerMarge Bot <emma+marge@anholt.net>
Mon, 17 Apr 2023 09:43:14 +0000 (09:43 +0000)
commit4405e8a9e1482f455d0a6407f6b18e2cb0b6c425
tree4b151ff96bf48746a1b8f8567a6e76e8d6867b3f
parenteb7e9068865e312a0efb5c863d0d3be6e7571d8d
r600: Report multi-plane formats as unsupported

This is the analogous of
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9490 but for
r600.

Discoloration of NV12 video frames was observed in Chrome/ChromeOS and
the problem was tracked down to the fact that Mesa was following the
PIPE_FORMAT_R8_G8B8_420_UNORM/lower_yuv_external() path. The symptom is
that (for an unknown reason) the YUV-to-RGB conversion is using the
value of Y as the value of Y, U, and V. So, for example, if the input
value is YUV = (50, 120, 130), then what actually gets converted to RGB
is YUV = (50, 50, 50).

Considering that PIPE_FORMAT_R8_G8B8_420_UNORM was introduced for
freedreno
(https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6693) and it
is already being reported as unsupported for radeonsi, it's reasonable
to assume that GPUs targeted by r600 don't support this path either.

Note: I tested this patch with an AMD Palm device which follows the
evergreen_is_format_supported() path. I did not have access to a device
to test the r600_is_format_supported() path.

v2: Changed >= 2 to > 1.

Fixes: 826a10255f5 ("st/mesa: Add NV12 lowering to PIPE_FORMAT_R8_G8B8_420_UNORM")
Tested-by: Andres Calderon Jaramillo <andrescj@chromium.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22511>
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_state.c