summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_resource.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-10-24 16:45:04 +0100
committerEric Anholt <[email protected]>2014-10-24 18:04:26 +0100
commita71c3b885a532016aa426b5bb753291cffe39a44 (patch)
treedd53953868e0f58a935b0c3ef3db8baf8408b6d5 /src/gallium/drivers/vc4/vc4_resource.c
parent52824811b9c0a9bb78a40fcb43af00b315f612d0 (diff)
vc4: Refactor flushing before mapping a BO.
I'm going to want to make some other decisions here before flushing.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_resource.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_resource.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/vc4/vc4_resource.c b/src/gallium/drivers/vc4/vc4_resource.c
index c198ab94f43..62667bf2586 100644
--- a/src/gallium/drivers/vc4/vc4_resource.c
+++ b/src/gallium/drivers/vc4/vc4_resource.c
@@ -80,8 +80,10 @@ vc4_resource_transfer_map(struct pipe_context *pctx,
rsc->bo = vc4_bo_alloc(vc4->screen, size, "resource");
}
- if (!(usage & PIPE_TRANSFER_UNSYNCHRONIZED))
- vc4_flush_for_bo(pctx, rsc->bo);
+ if (!(usage & PIPE_TRANSFER_UNSYNCHRONIZED)) {
+ if (vc4_cl_references_bo(pctx, rsc->bo))
+ vc4_flush(pctx);
+ }
if (usage & PIPE_TRANSFER_WRITE)
rsc->writes++;