From df9bc11589bb855629243248b167af663e18a4c0 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 22 Jan 2024 12:15:54 +1000 Subject: [PATCH] radv/uvd: uvd kernel checks for full dpb allocation. The CTS image allocation sometimes doesn't try to allocate a complete DPB, but the amdgpu kernel module checks for this, so always make the DPB max sized on uvd instances. Fixes part of video decode on Fiji/Polaris Cc: mesa-stable Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_image.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c index 4921d2d7ea5..29a0ff599b3 100644 --- a/src/amd/vulkan/radv_image.c +++ b/src/amd/vulkan/radv_image.c @@ -1075,6 +1075,11 @@ radv_image_create_layout(struct radv_device *device, struct radv_image_create_in radv_video_get_profile_alignments(device->physical_device, profile_list, &width_align, &height_align); image_info.width = align(image_info.width, width_align); image_info.height = align(image_info.height, height_align); + + if (radv_has_uvd(device->physical_device) && image->vk.usage & VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR) { + /* UVD and kernel demand a full DPB allocation. */ + image_info.array_size = MIN2(16, image_info.array_size); + } } unsigned plane_count = radv_get_internal_plane_count(device->physical_device, image->vk.format);