Mesa (master): anv/gen12: Initialize aux map context

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Oct 28 07:46:34 UTC 2019


Module: Mesa
Branch: master
Commit: d4a3299ba1a40c48f74e963a6451e9ebb63993b8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d4a3299ba1a40c48f74e963a6451e9ebb63993b8

Author: Jordan Justen <jordan.l.justen at intel.com>
Date:   Wed Mar 28 01:42:50 2018 -0700

anv/gen12: Initialize aux map context

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

---

 src/intel/vulkan/anv_device.c  | 21 +++++++++++++++++++--
 src/intel/vulkan/anv_private.h |  3 +++
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 9f7dc9aaaeb..9e6eaab8c80 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -43,7 +43,7 @@
 #include "util/xmlpool.h"
 #include "git_sha1.h"
 #include "vk_util.h"
-#include "common/gen_buffer_alloc.h"
+#include "common/gen_aux_map.h"
 #include "common/gen_defines.h"
 #include "compiler/glsl_types.h"
 
@@ -2655,9 +2655,16 @@ VkResult anv_CreateDevice(
          goto fail_surface_state_pool;
    }
 
+   if (device->info.gen >= 12) {
+      device->aux_map_ctx = gen_aux_map_init(device, &aux_map_allocator,
+                                             &physical_device->info);
+      if (!device->aux_map_ctx)
+         goto fail_binding_table_pool;
+   }
+
    result = anv_bo_init_new(&device->workaround_bo, device, 4096);
    if (result != VK_SUCCESS)
-      goto fail_binding_table_pool;
+      goto fail_surface_aux_map_pool;
 
    if (physical_device->use_softpin)
       device->workaround_bo.flags |= EXEC_OBJECT_PINNED;
@@ -2721,6 +2728,11 @@ VkResult anv_CreateDevice(
    anv_scratch_pool_finish(device, &device->scratch_pool);
    anv_gem_munmap(device->workaround_bo.map, device->workaround_bo.size);
    anv_gem_close(device, device->workaround_bo.gem_handle);
+ fail_surface_aux_map_pool:
+   if (device->info.gen >= 12) {
+      gen_aux_map_finish(device->aux_map_ctx);
+      device->aux_map_ctx = NULL;
+   }
  fail_binding_table_pool:
    if (physical_device->use_softpin)
       anv_state_pool_finish(&device->binding_table_pool);
@@ -2789,6 +2801,11 @@ void anv_DestroyDevice(
    if (device->info.gen >= 10)
       anv_gem_close(device, device->hiz_clear_bo.gem_handle);
 
+   if (device->info.gen >= 12) {
+      gen_aux_map_finish(device->aux_map_ctx);
+      device->aux_map_ctx = NULL;
+   }
+
    if (physical_device->use_softpin)
       anv_state_pool_finish(&device->binding_table_pool);
    anv_state_pool_finish(&device->surface_state_pool);
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 30f1da39425..33614bb9426 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -73,6 +73,7 @@ struct anv_buffer_view;
 struct anv_image_view;
 struct anv_instance;
 
+struct gen_aux_map_context;
 struct gen_l3_config;
 struct gen_perf_config;
 
@@ -1174,6 +1175,8 @@ struct anv_device {
 
     int                                         perf_fd; /* -1 if no opened */
     uint64_t                                    perf_metric; /* 0 if unset */
+
+    struct gen_aux_map_context                  *aux_map_ctx;
 };
 
 static inline struct anv_state_pool *




More information about the mesa-commit mailing list