anv: Add anv_memregion structure
authorSagar Ghuge <sagar.ghuge@intel.com>
Wed, 1 Apr 2020 01:23:25 +0000 (18:23 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Mon, 8 Mar 2021 20:47:06 +0000 (12:47 -0800)
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9324>

src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_private.h

index 66209da..be345d1 100644 (file)
@@ -719,6 +719,10 @@ anv_physical_device_try_create(struct anv_instance *instance,
 
    device->has_context_priority = anv_gem_has_context_priority(fd);
 
+   /* Initialize memory regions struct to 0. */
+   memset(&device->vram, 0, sizeof(device->vram));
+   memset(&device->sys, 0, sizeof(device->sys));
+
    result = anv_physical_device_init_heaps(device, fd);
    if (result != VK_SUCCESS)
       goto fail_base;
index d25d8a8..c9b0dc9 100644 (file)
@@ -964,6 +964,12 @@ struct anv_memory_heap {
     * Align it to 64 bits to make atomic operations faster on 32 bit platforms.
     */
    VkDeviceSize      used __attribute__ ((aligned (8)));
+
+   bool              is_local_mem;
+};
+
+struct anv_memregion {
+   uint64_t size;
 };
 
 struct anv_physical_device {
@@ -1059,6 +1065,8 @@ struct anv_physical_device {
       struct anv_memory_heap                    heaps[VK_MAX_MEMORY_HEAPS];
     } memory;
 
+    struct anv_memregion                        vram;
+    struct anv_memregion                        sys;
     uint8_t                                     driver_build_sha1[20];
     uint8_t                                     pipeline_cache_uuid[VK_UUID_SIZE];
     uint8_t                                     driver_uuid[VK_UUID_SIZE];