summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-04-26 09:54:41 -0700
committerJason Ekstrand <[email protected]>2017-05-04 19:07:54 -0700
commit955127db9376b49a41a428f5f89137cafec89b1c (patch)
treedc37e2034c60d7b00ca4d5f93d0aaa977debb3de
parentf82d3d38b62048246c4df999a1789b5cb60184c6 (diff)
anv/allocator: Add support for large stream allocations
Reviewed-by: Juan A. Suarez Romero <[email protected]>
-rw-r--r--src/intel/vulkan/anv_allocator.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c
index 3988a1ab2b8..a05aaf8fabd 100644
--- a/src/intel/vulkan/anv_allocator.c
+++ b/src/intel/vulkan/anv_allocator.c
@@ -916,10 +916,13 @@ anv_state_stream_alloc(struct anv_state_stream *stream,
assert(alignment <= PAGE_SIZE);
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,
- PAGE_SIZE);
+ block_size, PAGE_SIZE);
struct anv_state_stream_block *sb = stream->block.map;
VG_NOACCESS_WRITE(&sb->block, stream->block);
@@ -933,7 +936,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;