anv: Turn device->queue into an array

Rework: Lionel
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8667>
This commit is contained in:
Jordan Justen
2018-08-14 02:34:16 -07:00
committed by Marge Bot
parent 40d4799d8a
commit 9fd0806621
4 changed files with 115 additions and 26 deletions

View File

@@ -109,9 +109,10 @@ genX(emit_slice_hashing_state)(struct anv_device *device,
#endif
}
VkResult
genX(init_device_state)(struct anv_device *device)
static VkResult
init_render_queue_state(struct anv_queue *queue)
{
struct anv_device *device = queue->device;
struct anv_batch batch;
uint32_t cmds[64];
@@ -306,7 +307,29 @@ genX(init_device_state)(struct anv_device *device)
assert(batch.next <= batch.end);
return anv_queue_submit_simple_batch(&device->queue, &batch);
return anv_queue_submit_simple_batch(queue, &batch);
}
VkResult
genX(init_device_state)(struct anv_device *device)
{
VkResult res;
for (uint32_t i = 0; i < device->queue_count; i++) {
struct anv_queue *queue = &device->queues[i];
switch (queue->family->engine_class) {
case I915_ENGINE_CLASS_RENDER:
res = init_render_queue_state(queue);
break;
default:
res = vk_error(VK_ERROR_INITIALIZATION_FAILED);
break;
}
if (res != VK_SUCCESS)
return res;
}
return res;
}
void