panfrost: add PAN_MESA_DEBUG=yuv for debugging yuv sampler

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21109>
This commit is contained in:
Italo Nicola 2023-06-28 22:25:26 +00:00 committed by Marge Bot
parent bba74a84a9
commit 109a6b8cd7
3 changed files with 13 additions and 0 deletions

View file

@ -71,6 +71,7 @@ static const struct debug_named_value panfrost_debug_options[] = {
#ifdef PAN_DBG_OVERFLOW
{"overflow", PAN_DBG_OVERFLOW, "Check for buffer overflows in pool uploads"},
#endif
{"yuv", PAN_DBG_YUV, "Tint YUV textures with blue for 1-plane and green for 2-plane"},
DEBUG_NAMED_VALUE_END
};
/* clang-format on */

View file

@ -670,6 +670,16 @@ GENX(panfrost_new_texture)(const struct panfrost_device *dev,
memcpy(swizzle, iview->swizzle, sizeof(swizzle));
}
if ((dev->debug & PAN_DBG_YUV) && PAN_ARCH == 7 &&
panfrost_needs_multiplanar_descriptor(desc->layout)) {
if (desc->layout == UTIL_FORMAT_LAYOUT_SUBSAMPLED) {
swizzle[2] = PIPE_SWIZZLE_1;
} else if (desc->layout == UTIL_FORMAT_LAYOUT_PLANAR2) {
swizzle[1] = PIPE_SWIZZLE_0;
swizzle[2] = PIPE_SWIZZLE_0;
}
}
panfrost_emit_texture_payload(iview, format, payload->cpu);
unsigned array_size = iview->last_layer - iview->first_layer + 1;

View file

@ -52,6 +52,8 @@
#define PAN_DBG_OVERFLOW 0x8000
#endif
#define PAN_DBG_YUV 0x20000
struct panfrost_device;
unsigned panfrost_translate_swizzle_4(const unsigned char swizzle[4]);