[Mesa-dev] [PATCH 17.5/18] anv/allocator: Add support for large stream allocations
Juan A. Suarez Romero
jasuarez at igalia.com
Thu May 4 08:04:34 UTC 2017
Reviewed-by: Juan A. Suarez Romero <jasuarez at igalia.com>
On Wed, 2017-04-26 at 10:01 -0700, Jason Ekstrand wrote:
> ---
> src/intel/vulkan/anv_allocator.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c
> index 8f3b31f..61d09f3 100644
> --- a/src/intel/vulkan/anv_allocator.c
> +++ b/src/intel/vulkan/anv_allocator.c
> @@ -881,9 +881,13 @@ anv_state_stream_alloc(struct anv_state_stream *stream,
> return ANV_STATE_NULL;
>
> uint32_t offset = align_u32(stream->next, alignment);
> - if (offset + size > stream->block_size) {
> + if (offset + size > stream->block.alloc_size) {
> + uint32_t block_size = stream->block_size;
> + if (block_size < size)
> + block_size = round_to_power_of_two(size);
> +
> stream->block = anv_state_pool_alloc_no_vg(stream->state_pool,
> - stream->block_size,
> + block_size,
> stream->block_size);
>
> struct anv_state_stream_block *sb = stream->block.map;
> @@ -898,7 +902,7 @@ anv_state_stream_alloc(struct anv_state_stream *stream,
> stream->next = sizeof(*sb);
>
> offset = align_u32(stream->next, alignment);
> - assert(offset + size <= stream->block_size);
> + assert(offset + size <= stream->block.alloc_size);
> }
>
> struct anv_state state = stream->block;
More information about the mesa-dev
mailing list