[Mesa-dev] [PATCH v2 08/32] anv/image: Add a drm_format_mod field

Jason Ekstrand jason at jlekstrand.net
Wed Nov 29 00:28:20 UTC 2017


At the moment, this is always initialized to DRM_FORMAT_MOD_INVALID.
---
 src/intel/vulkan/anv_image.c   | 2 ++
 src/intel/vulkan/anv_private.h | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 7e89f75..d986395 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -27,6 +27,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/mman.h>
+#include <drm_fourcc.h>
 
 #include "anv_private.h"
 #include "util/debug.h"
@@ -527,6 +528,7 @@ anv_image_create(VkDevice _device,
    image->samples = pCreateInfo->samples;
    image->usage = pCreateInfo->usage;
    image->tiling = pCreateInfo->tiling;
+   image->drm_format_mod = DRM_FORMAT_MOD_INVALID;
    image->disjoint = pCreateInfo->flags & VK_IMAGE_CREATE_DISJOINT_BIT_KHR;
 
    const struct anv_format *format = anv_get_format(image->vk_format);
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index e875705..9c4a1cf 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -2345,6 +2345,11 @@ struct anv_image {
    VkImageUsageFlags usage; /**< Superset of VkImageCreateInfo::usage. */
    VkImageTiling tiling; /** VkImageCreateInfo::tiling */
 
+   /**
+    * DRM format modifier for this image or DRM_FORMAT_MOD_INVALID.
+    */
+   uint64_t drm_format_mod;
+
    VkDeviceSize size;
    uint32_t alignment;
 
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list