diff --git a/src/amd/vulkan/radv_physical_device.c b/src/amd/vulkan/radv_physical_device.c index af24baf8b96..ff1048f23b6 100644 --- a/src/amd/vulkan/radv_physical_device.c +++ b/src/amd/vulkan/radv_physical_device.c @@ -617,7 +617,7 @@ radv_physical_device_get_supported_extensions(const struct radv_physical_device .KHR_video_decode_queue = pdev->video_decode_enabled, .KHR_video_decode_h264 = VIDEO_CODEC_H264DEC && pdev->video_decode_enabled, .KHR_video_decode_h265 = VIDEO_CODEC_H265DEC && pdev->video_decode_enabled, - .KHR_video_decode_vp9 = (pdev->info.vcn_ip_version >= VCN_2_0_0 && + .KHR_video_decode_vp9 = (radv_video_decode_vp9_supported(pdev) && VIDEO_CODEC_VP9DEC && pdev->video_decode_enabled), .KHR_video_encode_h264 = VIDEO_CODEC_H264ENC && pdev->video_encode_enabled, .KHR_video_encode_h265 = VIDEO_CODEC_H265ENC && pdev->video_encode_enabled, diff --git a/src/amd/vulkan/radv_video.c b/src/amd/vulkan/radv_video.c index 4f0c67a9da2..a262d4a48b7 100644 --- a/src/amd/vulkan/radv_video.c +++ b/src/amd/vulkan/radv_video.c @@ -43,6 +43,16 @@ static void set_reg(struct radv_cmd_buffer *cmd_buffer, unsigned reg, uint32_t val); +static inline bool +radv_check_vcn_fw_version(const struct radv_physical_device *pdev, uint32_t dec, uint32_t enc, uint32_t rev) +{ + return pdev->info.vcn_dec_version > dec || + pdev->info.vcn_enc_minor_version > enc || + (pdev->info.vcn_dec_version == dec && + pdev->info.vcn_enc_minor_version == enc && + pdev->info.vcn_fw_revision >= rev); +} + static bool radv_enable_tier2(struct radv_physical_device *pdev) { @@ -3134,3 +3144,18 @@ radv_video_get_profile_alignments(struct radv_physical_device *pdev, const VkVid *width_align_out = MAX2(*width_align_out, db_alignment); *height_align_out = MAX2(*height_align_out, db_alignment); } + +bool +radv_video_decode_vp9_supported(const struct radv_physical_device *pdev) +{ + if (pdev->info.vcn_ip_version >= VCN_5_0_0) + return radv_check_vcn_fw_version(pdev, 9, 7, 18); + else if (pdev->info.vcn_ip_version >= VCN_4_0_0) + return radv_check_vcn_fw_version(pdev, 9, 23, 13); + else if (pdev->info.vcn_ip_version >= VCN_3_0_0) + return radv_check_vcn_fw_version(pdev, 4, 33, 7); + else if (pdev->info.vcn_ip_version >= VCN_2_0_0) + return radv_check_vcn_fw_version(pdev, 8, 24, 4); + else + return false; +} diff --git a/src/amd/vulkan/radv_video.h b/src/amd/vulkan/radv_video.h index cbb00e1a78e..484cb2304b3 100644 --- a/src/amd/vulkan/radv_video.h +++ b/src/amd/vulkan/radv_video.h @@ -90,5 +90,6 @@ void radv_video_get_enc_dpb_image(struct radv_device *device, const struct VkVideoProfileListInfoKHR *profile_list, struct radv_image *image, struct radv_image_create_info *create_info); +bool radv_video_decode_vp9_supported(const struct radv_physical_device *pdev); #endif /* RADV_VIDEO_H */