summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_context.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_context.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_context.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_context.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/gallium/drivers/vc4/vc4_context.c b/src/gallium/drivers/vc4/vc4_context.c
index 87f025142ce..b1f0f353fcc 100644
--- a/src/gallium/drivers/vc4/vc4_context.c
+++ b/src/gallium/drivers/vc4/vc4_context.c
@@ -350,13 +350,13 @@ vc4_pipe_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
*
* This helps avoid flushing the command buffers when unnecessary.
*/
-void
-vc4_flush_for_bo(struct pipe_context *pctx, struct vc4_bo *bo)
+bool
+vc4_cl_references_bo(struct pipe_context *pctx, struct vc4_bo *bo)
{
struct vc4_context *vc4 = vc4_context(pctx);
if (!vc4->needs_flush)
- return;
+ return false;
/* Walk all the referenced BOs in the drawing command list to see if
* they match.
@@ -365,8 +365,7 @@ vc4_flush_for_bo(struct pipe_context *pctx, struct vc4_bo *bo)
for (int i = 0; i < (vc4->bo_handles.next -
vc4->bo_handles.base) / 4; i++) {
if (referenced_bos[i] == bo) {
- vc4_flush(pctx);
- return;
+ return true;
}
}
@@ -377,8 +376,7 @@ vc4_flush_for_bo(struct pipe_context *pctx, struct vc4_bo *bo)
if (csurf) {
struct vc4_resource *ctex = vc4_resource(csurf->base.texture);
if (ctex->bo == bo) {
- vc4_flush(pctx);
- return;
+ return true;
}
}
@@ -387,10 +385,11 @@ vc4_flush_for_bo(struct pipe_context *pctx, struct vc4_bo *bo)
struct vc4_resource *ztex =
vc4_resource(zsurf->base.texture);
if (ztex->bo == bo) {
- vc4_flush(pctx);
- return;
+ return true;
}
}
+
+ return false;
}
static void