From c47dbea2a0c01612935fb47acdcaed855834a7fb 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: (cherry picked from commit df9bc11589bb855629243248b167af663e18a4c0) --- .pick_status.json | 2 +- src/amd/vulkan/radv_image.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index b9904bb9d35..12d07c0c187 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -754,7 +754,7 @@ "description": "radv/uvd: uvd kernel checks for full dpb allocation.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c index ea1eb749ce4..52965f725ab 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);