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

Author: Jason Ekstrand <[email protected]>
Date:   Tue Jan 26 10:38:47 2021 -0600

anv: Add fake graphics-only and compute-only queue families

Rework:
 * Jordan: Add graphics-only queue
 * Jordan: Bump ANV_MAX_QUEUE_FAMILIES and add related asserts
 * Jordan: Fix queueCount on compute-only family

Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8771>

---

 src/intel/vulkan/anv_device.c  | 29 ++++++++++++++++++++++++-----
 src/intel/vulkan/anv_private.h |  2 +-
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index b694f48a5e8..d9f743a088d 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -483,21 +483,40 @@ anv_physical_device_init_queue_families(struct 
anv_physical_device *pdevice)
    uint32_t family_count = 0;
 
    if (pdevice->engine_info) {
-      int render_count = anv_gem_count_engines(pdevice->engine_info,
-                                               I915_ENGINE_CLASS_RENDER);
-      if (render_count > 0) {
+      int gc_count =
+         anv_gem_count_engines(pdevice->engine_info, I915_ENGINE_CLASS_RENDER);
+      int g_count = 0;
+      int c_count = 0;
+
+      if (gc_count > 0) {
          pdevice->queue.families[family_count++] = (struct anv_queue_family) {
             .queueFlags = VK_QUEUE_GRAPHICS_BIT |
                           VK_QUEUE_COMPUTE_BIT |
                           VK_QUEUE_TRANSFER_BIT,
-            .queueCount = render_count,
+            .queueCount = gc_count,
+            .engine_class = I915_ENGINE_CLASS_RENDER,
+         };
+      }
+      if (g_count > 0) {
+         pdevice->queue.families[family_count++] = (struct anv_queue_family) {
+            .queueFlags = VK_QUEUE_GRAPHICS_BIT |
+                          VK_QUEUE_TRANSFER_BIT,
+            .queueCount = g_count,
+            .engine_class = I915_ENGINE_CLASS_RENDER,
+         };
+      }
+      if (c_count > 0) {
+         pdevice->queue.families[family_count++] = (struct anv_queue_family) {
+            .queueFlags = VK_QUEUE_COMPUTE_BIT |
+                          VK_QUEUE_TRANSFER_BIT,
+            .queueCount = c_count,
             .engine_class = I915_ENGINE_CLASS_RENDER,
          };
       }
       /* Increase count below when other families are added as a reminder to
        * increase the ANV_MAX_QUEUE_FAMILIES value.
        */
-      STATIC_ASSERT(ANV_MAX_QUEUE_FAMILIES >= 1);
+      STATIC_ASSERT(ANV_MAX_QUEUE_FAMILIES >= 3);
    } else {
       /* Default to a single render queue */
       pdevice->queue.families[family_count++] = (struct anv_queue_family) {
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 367c7bd13c5..b235b2aef52 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -941,7 +941,7 @@ struct anv_queue_family {
    enum drm_i915_gem_engine_class engine_class;
 };
 
-#define ANV_MAX_QUEUE_FAMILIES 1
+#define ANV_MAX_QUEUE_FAMILIES 3
 
 struct anv_memory_type {
    /* Standard bits passed on to the client */

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to