anv/image: Add a drm_format_mod field
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 28 Nov 2017 17:28:12 +0000 (09:28 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 4 Dec 2017 18:04:19 +0000 (10:04 -0800)
At the moment, this is always initialized to DRM_FORMAT_MOD_INVALID.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
src/intel/vulkan/anv_image.c
src/intel/vulkan/anv_private.h

index ba932ba47c3e530901405426c2e27ff60afd759b..5c63d676d6a3a50e03cc30226643612fcf189726 100644 (file)
@@ -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);
index ca3644d61e9ed09b0250000084902e71334c8287..b7bde4b8ce6724e19e8c4159e1c70362d019c272 100644 (file)
@@ -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;