anv: Export anv_exec_batch_debug() and chain_command_buffers()

This functions will be used by i915 and Xe KMD.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Acked-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20428>
This commit is contained in:
José Roberto de Souza
2022-11-21 11:45:21 -08:00
committed by Marge Bot
parent 80c89c4606
commit 94ca73b356
2 changed files with 22 additions and 11 deletions

View File

@@ -1427,9 +1427,9 @@ setup_execbuf_for_cmd_buffer(struct anv_execbuf *execbuf,
return VK_SUCCESS;
}
static void
chain_command_buffers(struct anv_cmd_buffer **cmd_buffers,
uint32_t num_cmd_buffers)
void
anv_cmd_buffer_chain_command_buffers(struct anv_cmd_buffer **cmd_buffers,
uint32_t num_cmd_buffers)
{
if (!anv_cmd_buffer_is_chainable(cmd_buffers[0])) {
assert(num_cmd_buffers == 1);
@@ -1470,7 +1470,7 @@ setup_execbuf_for_cmd_buffers(struct anv_execbuf *execbuf,
/* Edit the tail of the command buffers to chain them all together if they
* can be.
*/
chain_command_buffers(cmd_buffers, num_cmd_buffers);
anv_cmd_buffer_chain_command_buffers(cmd_buffers, num_cmd_buffers);
for (uint32_t i = 0; i < num_cmd_buffers; i++) {
anv_measure_submit(cmd_buffers[i]);
@@ -1683,11 +1683,12 @@ anv_queue_exec_utrace_locked(struct anv_queue *queue,
return result;
}
static void
anv_exec_batch_debug(struct anv_queue *queue, uint32_t cmd_buffer_count,
struct anv_cmd_buffer **cmd_buffers,
struct anv_query_pool *perf_query_pool,
uint32_t perf_query_pass)
void
anv_cmd_buffer_exec_batch_debug(struct anv_queue *queue,
uint32_t cmd_buffer_count,
struct anv_cmd_buffer **cmd_buffers,
struct anv_query_pool *perf_query_pool,
uint32_t perf_query_pass)
{
if (!INTEL_DEBUG(DEBUG_BATCH))
return;
@@ -1849,8 +1850,8 @@ anv_queue_exec_locked(struct anv_queue *queue,
}
}
anv_exec_batch_debug(queue, cmd_buffer_count, cmd_buffers, perf_query_pool,
perf_query_pass);
anv_cmd_buffer_exec_batch_debug(queue, cmd_buffer_count, cmd_buffers,
perf_query_pool, perf_query_pass);
if (execbuf.syncobj_values) {
execbuf.timeline_fences.fence_count = execbuf.syncobj_count;

View File

@@ -2822,6 +2822,16 @@ struct anv_state
anv_cmd_buffer_alloc_dynamic_state(struct anv_cmd_buffer *cmd_buffer,
uint32_t size, uint32_t alignment);
void
anv_cmd_buffer_chain_command_buffers(struct anv_cmd_buffer **cmd_buffers,
uint32_t num_cmd_buffers);
void
anv_cmd_buffer_exec_batch_debug(struct anv_queue *queue,
uint32_t cmd_buffer_count,
struct anv_cmd_buffer **cmd_buffers,
struct anv_query_pool *perf_query_pool,
uint32_t perf_query_pass);
/**
* A allocation tied to a command buffer.
*