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 <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8771>
This commit is contained in:
Jason Ekstrand
2021-01-26 10:38:47 -06:00
committed by Marge Bot
parent 2a90420bbe
commit 1326e1c0fe
2 changed files with 25 additions and 6 deletions

View File

@@ -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) {

View File

@@ -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 */