anv: Do not support the tiling of DRM modifier if DECODE_DST

Fixes: 04709e4f ("anv: fix video profile lists");

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33784>
This commit is contained in:
Hyunjun Ko 2025-02-27 11:44:14 +09:00 committed by Marge Bot
parent b6b8193534
commit f7ff9b240d

View file

@ -345,6 +345,14 @@ anv_GetPhysicalDeviceVideoFormatPropertiesKHR(VkPhysicalDevice physicalDevice,
const struct VkVideoProfileListInfoKHR *prof_list = (struct VkVideoProfileListInfoKHR *) const struct VkVideoProfileListInfoKHR *prof_list = (struct VkVideoProfileListInfoKHR *)
vk_find_struct_const(pVideoFormatInfo->pNext, VIDEO_PROFILE_LIST_INFO_KHR); vk_find_struct_const(pVideoFormatInfo->pNext, VIDEO_PROFILE_LIST_INFO_KHR);
/* We only support VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT with
* Y-tiling/Tile4, as supported by the hardware for video decoding.
* However, we are unable to determine the tiling without modifiers here.
* So just disable them all.
*/
const bool decode_dst = !!(pVideoFormatInfo->imageUsage &
VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR);
if (prof_list) { if (prof_list) {
for (unsigned i = 0; i < prof_list->profileCount; i++) { for (unsigned i = 0; i < prof_list->profileCount; i++) {
const VkVideoProfileInfoKHR *profile = &prof_list->pProfiles[i]; const VkVideoProfileInfoKHR *profile = &prof_list->pProfiles[i];
@ -359,6 +367,7 @@ anv_GetPhysicalDeviceVideoFormatPropertiesKHR(VkPhysicalDevice physicalDevice,
p->imageUsageFlags = pVideoFormatInfo->imageUsage; p->imageUsageFlags = pVideoFormatInfo->imageUsage;
} }
if (!decode_dst) {
vk_outarray_append_typed(VkVideoFormatPropertiesKHR, &out, p) { vk_outarray_append_typed(VkVideoFormatPropertiesKHR, &out, p) {
p->format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM; p->format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM;
p->imageCreateFlags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT; p->imageCreateFlags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
@ -367,6 +376,7 @@ anv_GetPhysicalDeviceVideoFormatPropertiesKHR(VkPhysicalDevice physicalDevice,
p->imageUsageFlags = pVideoFormatInfo->imageUsage; p->imageUsageFlags = pVideoFormatInfo->imageUsage;
} }
} }
}
if (profile->lumaBitDepth & VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR || if (profile->lumaBitDepth & VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR ||
profile->chromaBitDepth & VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR) { profile->chromaBitDepth & VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR) {
@ -377,6 +387,7 @@ anv_GetPhysicalDeviceVideoFormatPropertiesKHR(VkPhysicalDevice physicalDevice,
p->imageTiling = VK_IMAGE_TILING_OPTIMAL; p->imageTiling = VK_IMAGE_TILING_OPTIMAL;
p->imageUsageFlags = pVideoFormatInfo->imageUsage; p->imageUsageFlags = pVideoFormatInfo->imageUsage;
} }
if (!decode_dst) {
vk_outarray_append_typed(VkVideoFormatPropertiesKHR, &out, p) { vk_outarray_append_typed(VkVideoFormatPropertiesKHR, &out, p) {
p->format = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16; p->format = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16;
p->imageCreateFlags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT; p->imageCreateFlags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
@ -387,6 +398,7 @@ anv_GetPhysicalDeviceVideoFormatPropertiesKHR(VkPhysicalDevice physicalDevice,
} }
} }
} }
}
if (*pVideoFormatPropertyCount == 0) if (*pVideoFormatPropertyCount == 0)
return VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR; return VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR;