anv/video: Fix to return supported video format correctly.
Since 8-bit decoding is not default, we need to check the flag too. Fixes:a64ae20d0
("anv: support HEVC 10-bit decoding" ) Signed-off-by: Hyunjun Ko <zzoon@igalia.com> Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (cherry picked from commit0fd0a51df6
) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33113>
This commit is contained in:
@@ -964,7 +964,7 @@
|
|||||||
"description": "anv/video: Fix to return supported video format correctly.",
|
"description": "anv/video: Fix to return supported video format correctly.",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 2,
|
"nomination_type": 2,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": "a64ae20d0f023545ec966e7a4e81390adb901cde",
|
"because_sha": "a64ae20d0f023545ec966e7a4e81390adb901cde",
|
||||||
"notes": null
|
"notes": null
|
||||||
|
@@ -310,49 +310,49 @@ anv_GetPhysicalDeviceVideoFormatPropertiesKHR(VkPhysicalDevice physicalDevice,
|
|||||||
pVideoFormatProperties,
|
pVideoFormatProperties,
|
||||||
pVideoFormatPropertyCount);
|
pVideoFormatPropertyCount);
|
||||||
|
|
||||||
bool need_10bit = false;
|
|
||||||
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);
|
||||||
|
|
||||||
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];
|
||||||
|
|
||||||
|
if (profile->lumaBitDepth & VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR ||
|
||||||
|
profile->chromaBitDepth & VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR) {
|
||||||
|
vk_outarray_append_typed(VkVideoFormatPropertiesKHR, &out, p) {
|
||||||
|
p->format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM;
|
||||||
|
p->imageCreateFlags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
|
||||||
|
p->imageType = VK_IMAGE_TYPE_2D;
|
||||||
|
p->imageTiling = VK_IMAGE_TILING_OPTIMAL;
|
||||||
|
p->imageUsageFlags = pVideoFormatInfo->imageUsage;
|
||||||
|
}
|
||||||
|
|
||||||
|
vk_outarray_append_typed(VkVideoFormatPropertiesKHR, &out, p) {
|
||||||
|
p->format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM;
|
||||||
|
p->imageCreateFlags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
|
||||||
|
p->imageType = VK_IMAGE_TYPE_2D;
|
||||||
|
p->imageTiling = VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT;
|
||||||
|
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) {
|
||||||
need_10bit = true;
|
vk_outarray_append_typed(VkVideoFormatPropertiesKHR, &out, p) {
|
||||||
}
|
p->format = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16;
|
||||||
}
|
p->imageCreateFlags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
|
||||||
|
p->imageType = VK_IMAGE_TYPE_2D;
|
||||||
vk_outarray_append_typed(VkVideoFormatPropertiesKHR, &out, p) {
|
p->imageTiling = VK_IMAGE_TILING_OPTIMAL;
|
||||||
p->format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM;
|
p->imageUsageFlags = pVideoFormatInfo->imageUsage;
|
||||||
p->imageCreateFlags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
|
}
|
||||||
p->imageType = VK_IMAGE_TYPE_2D;
|
vk_outarray_append_typed(VkVideoFormatPropertiesKHR, &out, p) {
|
||||||
p->imageTiling = VK_IMAGE_TILING_OPTIMAL;
|
p->format = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16;
|
||||||
p->imageUsageFlags = pVideoFormatInfo->imageUsage;
|
p->imageCreateFlags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
|
||||||
}
|
p->imageType = VK_IMAGE_TYPE_2D;
|
||||||
|
p->imageTiling = VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT;
|
||||||
vk_outarray_append_typed(VkVideoFormatPropertiesKHR, &out, p) {
|
p->imageUsageFlags = pVideoFormatInfo->imageUsage;
|
||||||
p->format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM;
|
}
|
||||||
p->imageCreateFlags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
|
}
|
||||||
p->imageType = VK_IMAGE_TYPE_2D;
|
|
||||||
p->imageTiling = VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT;
|
|
||||||
p->imageUsageFlags = pVideoFormatInfo->imageUsage;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (need_10bit) {
|
|
||||||
vk_outarray_append_typed(VkVideoFormatPropertiesKHR, &out, p) {
|
|
||||||
p->format = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16;
|
|
||||||
p->imageCreateFlags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
|
|
||||||
p->imageType = VK_IMAGE_TYPE_2D;
|
|
||||||
p->imageTiling = VK_IMAGE_TILING_OPTIMAL;
|
|
||||||
p->imageUsageFlags = pVideoFormatInfo->imageUsage;
|
|
||||||
}
|
|
||||||
vk_outarray_append_typed(VkVideoFormatPropertiesKHR, &out, p) {
|
|
||||||
p->format = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16;
|
|
||||||
p->imageCreateFlags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
|
|
||||||
p->imageType = VK_IMAGE_TYPE_2D;
|
|
||||||
p->imageTiling = VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT;
|
|
||||||
p->imageUsageFlags = pVideoFormatInfo->imageUsage;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user