From: Jason Ekstrand Date: Wed, 2 Nov 2016 17:33:54 +0000 (-0700) Subject: anv: Add a cmd_buffer_execbuf helper X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=db9f4b2a2bbf1aff3c6c878735495fc7accbb11e;p=mesa.git anv: Add a cmd_buffer_execbuf helper This puts the actual execbuf2 call in anv_batch_chain.c along with the other relocation stuff. Signed-off-by: Jason Ekstrand Reviewed-by: Kristian H. Kristensen Cc: "13.0" --- diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index 1e348cfb004..325da83324e 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++ b/src/intel/vulkan/anv_batch_chain.c @@ -1202,3 +1202,11 @@ anv_cmd_buffer_prepare_execbuf(struct anv_cmd_buffer *cmd_buffer) if (!cmd_buffer->execbuf2.need_reloc) cmd_buffer->execbuf2.execbuf.flags |= I915_EXEC_NO_RELOC; } + +VkResult +anv_cmd_buffer_execbuf(struct anv_device *device, + struct anv_cmd_buffer *cmd_buffer) +{ + return anv_device_execbuf(device, &cmd_buffer->execbuf2.execbuf, + cmd_buffer->execbuf2.bos); +} diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 6d8de90bf70..27402ceba52 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -1103,8 +1103,7 @@ VkResult anv_QueueSubmit( pSubmits[i].pCommandBuffers[j]); assert(cmd_buffer->level == VK_COMMAND_BUFFER_LEVEL_PRIMARY); - result = anv_device_execbuf(device, &cmd_buffer->execbuf2.execbuf, - cmd_buffer->execbuf2.bos); + result = anv_cmd_buffer_execbuf(device, cmd_buffer); if (result != VK_SUCCESS) return result; } diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index bc09208dec1..7f4a27d86dc 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -1200,6 +1200,8 @@ void anv_cmd_buffer_end_batch_buffer(struct anv_cmd_buffer *cmd_buffer); void anv_cmd_buffer_add_secondary(struct anv_cmd_buffer *primary, struct anv_cmd_buffer *secondary); void anv_cmd_buffer_prepare_execbuf(struct anv_cmd_buffer *cmd_buffer); +VkResult anv_cmd_buffer_execbuf(struct anv_device *device, + struct anv_cmd_buffer *cmd_buffer); VkResult anv_cmd_buffer_reset(struct anv_cmd_buffer *cmd_buffer);