aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/etnaviv
diff options
context:
space:
mode:
authorChristian Gmeiner <[email protected]>2019-07-31 12:38:53 +0200
committerMarge Bot <[email protected]>2020-04-05 18:01:43 +0000
commitf47b4eddd93ca538d2ebc90666955b7e2ee06494 (patch)
treed77fcc6625d57e9420e9b29e688efd62288cc23a /src/gallium/drivers/etnaviv
parentd1697fef1a92c9be74ff7447e1e16a9e8e4314f1 (diff)
etnaviv: rework wait/flush logic
Saves us from doing an extra flush in !wait case and seems more logical now. Also evaluate etna_bo_cpu_prep(..) retun value. Signed-off-by: Christian Gmeiner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1530>
Diffstat (limited to 'src/gallium/drivers/etnaviv')
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_query_acc.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_query_acc.c b/src/gallium/drivers/etnaviv/etnaviv_query_acc.c
index a1628534d27..446a629c6e8 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_query_acc.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_query_acc.c
@@ -167,10 +167,8 @@ etna_acc_get_query_result(struct etna_context *ctx, struct etna_query *q,
assert(list_is_empty(&aq->node));
- if (!wait) {
- int ret;
-
- if (rsc->status & ETNA_PENDING_WRITE) {
+ if (rsc->status & ETNA_PENDING_WRITE) {
+ if (!wait) {
/* piglit spec@arb_occlusion_query@occlusion_query_conform
* test, and silly apps perhaps, get stuck in a loop trying
* to get query result forever with wait==false.. we don't
@@ -183,20 +181,16 @@ etna_acc_get_query_result(struct etna_context *ctx, struct etna_query *q,
}
return false;
+ } else {
+ /* flush that GPU executes all query related actions */
+ ctx->base.flush(&ctx->base, NULL, 0);
}
-
- ret = etna_bo_cpu_prep(rsc->bo, DRM_ETNA_PREP_READ | DRM_ETNA_PREP_NOSYNC);
- if (ret)
- return false;
-
- etna_bo_cpu_fini(rsc->bo);
}
- /* flush that GPU executes all query related actions */
- ctx->base.flush(&ctx->base, NULL, 0);
-
/* get the result */
- etna_bo_cpu_prep(rsc->bo, DRM_ETNA_PREP_READ);
+ int ret = etna_bo_cpu_prep(rsc->bo, DRM_ETNA_PREP_READ);
+ if (ret)
+ return false;
void *ptr = etna_bo_map(rsc->bo);
p->result(aq, ptr, result);