aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno/vulkan/tu_image.c
diff options
context:
space:
mode:
authorJonathan Marek <[email protected]>2020-01-21 08:32:32 -0500
committerMarge Bot <[email protected]>2020-01-23 18:34:07 +0000
commit11f6fba1c95b1a391d43fed44db3a8176b111493 (patch)
treead2f79c13d6a46babdf1656eadcd35d8dc3d0e0a /src/freedreno/vulkan/tu_image.c
parentc5334d2943edc34052269cdb5c1052f6eb65335c (diff)
turnip: hook up GetImageDrmFormatModifierPropertiesEXT
Fixes: 210e6887 "vulkan/wsi: Use the interface from the real modifiers extension" Signed-off-by: Jonathan Marek <[email protected]> Acked-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3485>
Diffstat (limited to 'src/freedreno/vulkan/tu_image.c')
-rw-r--r--src/freedreno/vulkan/tu_image.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/freedreno/vulkan/tu_image.c b/src/freedreno/vulkan/tu_image.c
index 08028e52063..7dbbcb99682 100644
--- a/src/freedreno/vulkan/tu_image.c
+++ b/src/freedreno/vulkan/tu_image.c
@@ -444,6 +444,29 @@ tu_GetImageSubresourceLayout(VkDevice _device,
}
}
+VkResult tu_GetImageDrmFormatModifierPropertiesEXT(
+ VkDevice device,
+ VkImage _image,
+ VkImageDrmFormatModifierPropertiesEXT* pProperties)
+{
+ TU_FROM_HANDLE(tu_image, image, _image);
+
+ assert(pProperties->sType ==
+ VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT);
+
+ /* TODO invent a modifier for tiled but not UBWC buffers */
+
+ if (!image->layout.tile_mode)
+ pProperties->drmFormatModifier = DRM_FORMAT_MOD_LINEAR;
+ else if (image->layout.ubwc_size)
+ pProperties->drmFormatModifier = DRM_FORMAT_MOD_QCOM_COMPRESSED;
+ else
+ pProperties->drmFormatModifier = DRM_FORMAT_MOD_INVALID;
+
+ return VK_SUCCESS;
+}
+
+
VkResult
tu_CreateImageView(VkDevice _device,
const VkImageViewCreateInfo *pCreateInfo,