From 4cc7d6a85f2eccf90307989bbdae6fc9b0a301c0 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Tue, 1 Sep 2020 08:56:47 +0200 Subject: [PATCH] v3dv: expose DRM modifiers based on supported features So far we have only been exposing linear for WSI formats and UIF on everythig else, but we should instead expose linear or UIF based on whether the underlying format supports any features for the given layout. Part-of: --- src/broadcom/vulkan/v3dv_formats.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_formats.c b/src/broadcom/vulkan/v3dv_formats.c index 75c4c431f80..3e898d66c00 100644 --- a/src/broadcom/vulkan/v3dv_formats.c +++ b/src/broadcom/vulkan/v3dv_formats.c @@ -529,16 +529,13 @@ v3dv_GetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice, struct VkDrmFormatModifierPropertiesListEXT *list = (void *)ext; VK_OUTARRAY_MAKE(out, list->pDrmFormatModifierProperties, &list->drmFormatModifierCount); - /* Only expose LINEAR for winsys formats. - * FIXME: is this correct? - */ - if (format == VK_FORMAT_B8G8R8A8_SRGB || - format == VK_FORMAT_B8G8R8A8_UNORM) { + if (pFormatProperties->formatProperties.linearTilingFeatures) { vk_outarray_append(&out, mod_props) { mod_props->drmFormatModifier = DRM_FORMAT_MOD_LINEAR; mod_props->drmFormatModifierPlaneCount = 1; } - } else { + } + if (pFormatProperties->formatProperties.optimalTilingFeatures) { vk_outarray_append(&out, mod_props) { mod_props->drmFormatModifier = DRM_FORMAT_MOD_BROADCOM_UIF; mod_props->drmFormatModifierPlaneCount = 1;