summaryrefslogtreecommitdiffstats
path: root/src/freedreno
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-10-01 16:14:24 -0500
committerMarge Bot <[email protected]>2020-01-17 18:27:29 +0000
commit210e68874bbf5321adc6e6464a80526c177f8741 (patch)
treea9b8e8497822c81abc772cac0610314e1789b907 /src/freedreno
parentc78926b84df245cd77a881f9c4a79e4145eac42d (diff)
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 <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3434>
Diffstat (limited to 'src/freedreno')
-rw-r--r--src/freedreno/vulkan/tu_formats.c15
-rw-r--r--src/freedreno/vulkan/tu_image.c11
2 files changed, 14 insertions, 12 deletions
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;
}
}