radv/video: Only enable VP9 decode with supported firmware

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35543>
This commit is contained in:
David Rosca 2025-06-16 10:35:51 +02:00 committed by Marge Bot
parent 3b6f23a8e1
commit 58085da743
3 changed files with 27 additions and 1 deletions

View file

@ -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,

View file

@ -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;
}

View file

@ -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 */