Lines Matching refs:stream
95 * The state stream allocator works similar to how the i965 DRI driver streams
1207 /* The state stream allocator is a one-shot, single threaded allocator for
1211 anv_state_stream_init(struct anv_state_stream *stream,
1215 stream->state_pool = state_pool;
1216 stream->block_size = block_size;
1218 stream->block = ANV_STATE_NULL;
1223 stream->next = block_size;
1225 util_dynarray_init(&stream->all_blocks, NULL);
1227 VG(VALGRIND_CREATE_MEMPOOL(stream, 0, false));
1231 anv_state_stream_finish(struct anv_state_stream *stream)
1233 util_dynarray_foreach(&stream->all_blocks, struct anv_state, block) {
1234 VG(VALGRIND_MEMPOOL_FREE(stream, block->map));
1236 anv_state_pool_free_no_vg(stream->state_pool, *block);
1238 util_dynarray_fini(&stream->all_blocks);
1240 VG(VALGRIND_DESTROY_MEMPOOL(stream));
1244 anv_state_stream_alloc(struct anv_state_stream *stream,
1252 uint32_t offset = align_u32(stream->next, alignment);
1253 if (offset + size > stream->block.alloc_size) {
1254 uint32_t block_size = stream->block_size;
1258 stream->block = anv_state_pool_alloc_no_vg(stream->state_pool,
1260 util_dynarray_append(&stream->all_blocks,
1261 struct anv_state, stream->block);
1262 VG(VALGRIND_MAKE_MEM_NOACCESS(stream->block.map, block_size));
1265 stream->next = offset = 0;
1266 assert(offset + size <= stream->block.alloc_size);
1268 const bool new_block = stream->next == 0;
1270 struct anv_state state = stream->block;
1275 stream->next = offset + size;
1278 assert(state.map == stream->block.map);
1279 VG(VALGRIND_MEMPOOL_ALLOC(stream, state.map, size));
1283 VG(VALGRIND_MEMPOOL_CHANGE(stream, stream->block.map, stream->block.map,
1284 stream->next));