From: Lynne Date: Tue, 13 Jun 2023 15:40:50 +0000 (+0200) Subject: radv/video: reject general unsupported video formats X-Git-Tag: upstream/23.3.3~7052 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=758e6a8f2fc7b8b99adf126285e46895353eaabd;p=platform%2Fupstream%2Fmesa.git radv/video: reject general unsupported video formats Reviewed-by: Dave Airlie Part-of: --- diff --git a/src/amd/vulkan/radv_video.c b/src/amd/vulkan/radv_video.c index c658554..1875fc7 100644 --- a/src/amd/vulkan/radv_video.c +++ b/src/amd/vulkan/radv_video.c @@ -428,6 +428,13 @@ radv_GetPhysicalDeviceVideoCapabilitiesKHR(VkPhysicalDevice physicalDevice, if (dec_caps) dec_caps->flags = VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR; + /* H264 allows different luma and chroma bit depths */ + if (pVideoProfile->lumaBitDepth != pVideoProfile->chromaBitDepth) + return VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR; + + if (pVideoProfile->chromaSubsampling != VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR) + return VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR; + switch (pVideoProfile->videoCodecOperation) { case VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR: { struct VkVideoDecodeH264CapabilitiesKHR *ext = (struct VkVideoDecodeH264CapabilitiesKHR *)