panvk: Report formats not supported by HW as unsupported

3-plane YUV 444 and 16-bit 3-plane YUV are not supported natively by
the HW. Report these formats as unsupported since we may want to switch
to native YUV support in the future.

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32563>
This commit is contained in:
Rebecca Mckeever 2024-12-10 21:07:31 -08:00 committed by Marge Bot
parent 755953d337
commit a9759dd0e4

View file

@ -1129,6 +1129,23 @@ panvk_DestroyDevice(VkDevice _device, const VkAllocationCallbacks *pAllocator)
panvk_arch_dispatch(arch, destroy_device, device, pAllocator);
}
static bool
unsupported_yuv_format(enum pipe_format pfmt)
{
switch (pfmt) {
/* 3-plane YUV 444 and 16-bit 3-plane YUV are not supported natively by
* the HW.
*/
case PIPE_FORMAT_Y8_U8_V8_444_UNORM:
case PIPE_FORMAT_Y16_U16_V16_420_UNORM:
case PIPE_FORMAT_Y16_U16_V16_422_UNORM:
case PIPE_FORMAT_Y16_U16_V16_444_UNORM:
return true;
default:
return false;
}
}
static bool
format_is_supported(struct panvk_physical_device *physical_device,
const struct panfrost_format fmt,
@ -1137,6 +1154,9 @@ format_is_supported(struct panvk_physical_device *physical_device,
if (pfmt == PIPE_FORMAT_NONE)
return false;
if (unsupported_yuv_format(pfmt))
return false;
/* If the format ID is zero, it's not supported. */
if (!fmt.hw)
return false;