anv: track total state stream allocated blocks from the pool
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26843>
This commit is contained in:

committed by
Marge Bot

parent
6933257211
commit
8229ee43ac
@@ -995,6 +995,7 @@ anv_state_stream_init(struct anv_state_stream *stream,
|
||||
*/
|
||||
stream->next = block_size;
|
||||
|
||||
stream->total_size = 0;
|
||||
util_dynarray_init(&stream->all_blocks, NULL);
|
||||
|
||||
VG(VALGRIND_CREATE_MEMPOOL(stream, 0, false));
|
||||
@@ -1037,6 +1038,7 @@ anv_state_stream_alloc(struct anv_state_stream *stream,
|
||||
/* Reset back to the start */
|
||||
stream->next = offset = 0;
|
||||
assert(offset + size <= stream->block.alloc_size);
|
||||
stream->total_size += block_size;
|
||||
}
|
||||
const bool new_block = stream->next == 0;
|
||||
|
||||
|
@@ -742,6 +742,9 @@ struct anv_state_stream {
|
||||
/* Offset into the current block at which to allocate the next state */
|
||||
uint32_t next;
|
||||
|
||||
/* Sum of all the blocks in all_blocks */
|
||||
uint32_t total_size;
|
||||
|
||||
/* List of all blocks allocated from this pool */
|
||||
struct util_dynarray all_blocks;
|
||||
};
|
||||
|
Reference in New Issue
Block a user