From a9759dd0e4c2bfa8aebfa4f4a55645d8e349a454 Mon Sep 17 00:00:00 2001 From: Rebecca Mckeever Date: Tue, 10 Dec 2024 21:07:31 -0800 Subject: [PATCH] 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 Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/vulkan/panvk_physical_device.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/panfrost/vulkan/panvk_physical_device.c b/src/panfrost/vulkan/panvk_physical_device.c index 747076ac0a2..e9abc9323ba 100644 --- a/src/panfrost/vulkan/panvk_physical_device.c +++ b/src/panfrost/vulkan/panvk_physical_device.c @@ -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;