From 210e68874bbf5321adc6e6464a80526c177f8741 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 1 Oct 2018 16:14:24 -0500 Subject: vulkan/wsi: Use the interface from the real modifiers extension The anv implementation still isn't quite complete, but we can at least start using the structs from the real extension. v2: Fix circular pNext list (Lionel) Reviewed-by: Bas Nieuwenhuizen Reviewed-by: Lionel Landwerlin Part-of: --- src/freedreno/vulkan/tu_formats.c | 15 ++++++++------- src/freedreno/vulkan/tu_image.c | 11 ++++++----- 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'src/freedreno') diff --git a/src/freedreno/vulkan/tu_formats.c b/src/freedreno/vulkan/tu_formats.c index a0a18c1728d..1f5dfc4a232 100644 --- a/src/freedreno/vulkan/tu_formats.c +++ b/src/freedreno/vulkan/tu_formats.c @@ -786,20 +786,21 @@ tu_GetPhysicalDeviceFormatProperties2( tu_physical_device_get_format_properties( physical_device, format, &pFormatProperties->formatProperties); - struct wsi_format_modifier_properties_list *list = - vk_find_struct(pFormatProperties->pNext, WSI_FORMAT_MODIFIER_PROPERTIES_LIST_MESA); + VkDrmFormatModifierPropertiesListEXT *list = + vk_find_struct(pFormatProperties->pNext, DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT); if (list) { - VK_OUTARRAY_MAKE(out, list->modifier_properties, &list->modifier_count); + VK_OUTARRAY_MAKE(out, list->pDrmFormatModifierProperties, + &list->drmFormatModifierCount); vk_outarray_append(&out, mod_props) { - mod_props->modifier = DRM_FORMAT_MOD_LINEAR; - mod_props->modifier_plane_count = 1; + mod_props->drmFormatModifier = DRM_FORMAT_MOD_LINEAR; + mod_props->drmFormatModifierPlaneCount = 1; } /* TODO: any cases where this should be disabled? */ vk_outarray_append(&out, mod_props) { - mod_props->modifier = DRM_FORMAT_MOD_QCOM_COMPRESSED; - mod_props->modifier_plane_count = 1; + mod_props->drmFormatModifier = DRM_FORMAT_MOD_QCOM_COMPRESSED; + mod_props->drmFormatModifierPlaneCount = 1; } } } diff --git a/src/freedreno/vulkan/tu_image.c b/src/freedreno/vulkan/tu_image.c index 83e0d9e9b2a..1f4c454299d 100644 --- a/src/freedreno/vulkan/tu_image.c +++ b/src/freedreno/vulkan/tu_image.c @@ -346,14 +346,15 @@ tu_CreateImage(VkDevice device, pAllocator, pImage); #endif - const struct wsi_image_create_info *wsi_info = - vk_find_struct_const(pCreateInfo->pNext, WSI_IMAGE_CREATE_INFO_MESA); uint64_t modifier = DRM_FORMAT_MOD_INVALID; + if (pCreateInfo->tiling == VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT) { + const VkImageDrmFormatModifierListCreateInfoEXT *mod_info = + vk_find_struct_const(pCreateInfo->pNext, + IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT); - if (wsi_info) { modifier = DRM_FORMAT_MOD_LINEAR; - for (unsigned i = 0; i < wsi_info->modifier_count; i++) { - if (wsi_info->modifiers[i] == DRM_FORMAT_MOD_QCOM_COMPRESSED) + for (unsigned i = 0; i < mod_info->drmFormatModifierCount; i++) { + if (mod_info->pDrmFormatModifiers[i] == DRM_FORMAT_MOD_QCOM_COMPRESSED) modifier = DRM_FORMAT_MOD_QCOM_COMPRESSED; } } -- cgit v1.2.3