summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_context.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-07-31 12:19:29 -0700
committerEric Anholt <[email protected]>2014-08-11 14:45:30 -0700
commit027d730aff4abf89f8c01049d245c670c6740a26 (patch)
tree902a2eafb47db0b485be662b50d838cef76d3014 /src/gallium/drivers/vc4/vc4_context.c
parent771d86abd6c204cef82c5838b1ed20e4b8dbfa85 (diff)
vc4: Keep a reference to BOs queued for rendering.
Otherwise, once we're not flushing at the end of every draw, we'll free things like gallium resources, and free the backing GEM object, before we've flushed the rendering using it to the kernel.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_context.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_context.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/vc4/vc4_context.c b/src/gallium/drivers/vc4/vc4_context.c
index c69d620d6b6..6799e7ebf61 100644
--- a/src/gallium/drivers/vc4/vc4_context.c
+++ b/src/gallium/drivers/vc4/vc4_context.c
@@ -226,9 +226,10 @@ vc4_flush(struct pipe_context *pctx)
vc4_reset_cl(&vc4->shader_rec);
vc4_reset_cl(&vc4->uniforms);
vc4_reset_cl(&vc4->bo_handles);
-#ifdef USE_VC4_SIMULATOR
+ struct vc4_bo **referenced_bos = vc4->bo_pointers.base;
+ for (int i = 0; i < submit.bo_handle_count; i++)
+ vc4_bo_unreference(&referenced_bos[i]);
vc4_reset_cl(&vc4->bo_pointers);
-#endif
vc4->shader_rec_count = 0;
vc4->needs_flush = false;