anv: rename total_batch_size
This name is confusing, the real thing it represents is the allocated amount of batch space. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24628>
This commit is contained in:

committed by
Marge Bot

parent
b492f73f87
commit
94e3e05b93
@@ -546,14 +546,14 @@ anv_cmd_buffer_chain_batch(struct anv_batch *batch, uint32_t size, void *_data)
|
||||
const uint32_t batch_padding = GFX8_MI_BATCH_BUFFER_START_length * 4;
|
||||
/* Cap reallocation to chunk. */
|
||||
uint32_t alloc_size = MIN2(
|
||||
MAX2(batch->total_batch_size, size + batch_padding),
|
||||
MAX2(batch->allocated_batch_size, size + batch_padding),
|
||||
ANV_MAX_CMD_BUFFER_BATCH_SIZE);
|
||||
|
||||
VkResult result = anv_batch_bo_create(cmd_buffer, alloc_size, &new_bbo);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
batch->total_batch_size += alloc_size;
|
||||
batch->allocated_batch_size += alloc_size;
|
||||
|
||||
struct anv_batch_bo **seen_bbo = u_vector_add(&cmd_buffer->seen_bbos);
|
||||
if (seen_bbo == NULL) {
|
||||
@@ -583,14 +583,14 @@ anv_cmd_buffer_chain_generation_batch(struct anv_batch *batch, uint32_t size, vo
|
||||
struct anv_batch_bo *new_bbo = NULL;
|
||||
/* Cap reallocation to chunk. */
|
||||
uint32_t alloc_size = MIN2(
|
||||
MAX2(batch->total_batch_size, size),
|
||||
MAX2(batch->allocated_batch_size, size),
|
||||
ANV_MAX_CMD_BUFFER_BATCH_SIZE);
|
||||
|
||||
VkResult result = anv_batch_bo_create(cmd_buffer, alloc_size, &new_bbo);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
batch->total_batch_size += alloc_size;
|
||||
batch->allocated_batch_size += alloc_size;
|
||||
|
||||
struct anv_batch_bo **seen_bbo = u_vector_add(&cmd_buffer->seen_bbos);
|
||||
if (seen_bbo == NULL) {
|
||||
@@ -823,7 +823,7 @@ anv_cmd_buffer_init_batch_bo_chain(struct anv_cmd_buffer *cmd_buffer)
|
||||
|
||||
cmd_buffer->batch.alloc = &cmd_buffer->vk.pool->alloc;
|
||||
cmd_buffer->batch.user_data = cmd_buffer;
|
||||
cmd_buffer->batch.total_batch_size = ANV_MIN_CMD_BUFFER_BATCH_SIZE;
|
||||
cmd_buffer->batch.allocated_batch_size = ANV_MIN_CMD_BUFFER_BATCH_SIZE;
|
||||
|
||||
cmd_buffer->batch.extend_cb = anv_cmd_buffer_chain_batch;
|
||||
|
||||
@@ -837,7 +837,7 @@ anv_cmd_buffer_init_batch_bo_chain(struct anv_cmd_buffer *cmd_buffer)
|
||||
|
||||
cmd_buffer->generation_batch.alloc = &cmd_buffer->vk.pool->alloc;
|
||||
cmd_buffer->generation_batch.user_data = cmd_buffer;
|
||||
cmd_buffer->generation_batch.total_batch_size = 0;
|
||||
cmd_buffer->generation_batch.allocated_batch_size = 0;
|
||||
cmd_buffer->generation_batch.extend_cb = anv_cmd_buffer_chain_generation_batch;
|
||||
|
||||
int success = u_vector_init_pow2(&cmd_buffer->seen_bbos, 8,
|
||||
@@ -929,7 +929,7 @@ anv_cmd_buffer_reset_batch_bo_chain(struct anv_cmd_buffer *cmd_buffer)
|
||||
*(struct anv_batch_bo **)u_vector_add(&cmd_buffer->seen_bbos) = first_bbo;
|
||||
|
||||
assert(first_bbo->bo->size == ANV_MIN_CMD_BUFFER_BATCH_SIZE);
|
||||
cmd_buffer->batch.total_batch_size = first_bbo->bo->size;
|
||||
cmd_buffer->batch.allocated_batch_size = first_bbo->bo->size;
|
||||
|
||||
/* Delete all generation batch bos */
|
||||
list_for_each_entry_safe(struct anv_batch_bo, bbo,
|
||||
@@ -939,7 +939,7 @@ anv_cmd_buffer_reset_batch_bo_chain(struct anv_cmd_buffer *cmd_buffer)
|
||||
}
|
||||
|
||||
/* And reset generation batch */
|
||||
cmd_buffer->generation_batch.total_batch_size = 0;
|
||||
cmd_buffer->generation_batch.allocated_batch_size = 0;
|
||||
cmd_buffer->generation_batch.start = NULL;
|
||||
cmd_buffer->generation_batch.end = NULL;
|
||||
cmd_buffer->generation_batch.next = NULL;
|
||||
|
@@ -1491,7 +1491,7 @@ struct anv_batch {
|
||||
* Sum of all the anv_batch_bo sizes allocated for this command buffer.
|
||||
* Used to increase allocation size for long command buffers.
|
||||
*/
|
||||
size_t total_batch_size;
|
||||
size_t allocated_batch_size;
|
||||
|
||||
struct anv_address start_addr;
|
||||
|
||||
|
Reference in New Issue
Block a user