Mesa (master): etnaviv: explicitly call resource_written(..)

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Apr 5 18:12:00 UTC 2020


Module: Mesa
Branch: master
Commit: 238190403068edf4c6a9b761095193a88bea841d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=238190403068edf4c6a9b761095193a88bea841d

Author: Christian Gmeiner <christian.gmeiner at gmail.com>
Date:   Wed Jul 31 20:10:14 2019 +0200

etnaviv: explicitly call resource_written(..)

We might end in cases where etna_acc_get_query_result(..) gets called
within one draw call (aka before flushing). At this point the status
of the resource was not set but gets used in etna_acc_get_query_result(..)
to handle different wait cases. Fix this issue by calling resource_written(..)
explicitly.

Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1530>

---

 src/gallium/drivers/etnaviv/etnaviv_context.c   | 3 ---
 src/gallium/drivers/etnaviv/etnaviv_query_acc.c | 2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.c b/src/gallium/drivers/etnaviv/etnaviv_context.c
index e91e6f11a3b..9f9c539a413 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_context.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_context.c
@@ -347,9 +347,6 @@ etna_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
       }
    }
 
-   list_for_each_entry(struct etna_acc_query, aq, &ctx->active_acc_queries, node)
-      resource_written(ctx, aq->prsc);
-
    ctx->stats.prims_emitted += u_reduced_prims_for_vertices(info->mode, info->count);
    ctx->stats.draw_calls++;
 
diff --git a/src/gallium/drivers/etnaviv/etnaviv_query_acc.c b/src/gallium/drivers/etnaviv/etnaviv_query_acc.c
index 6e6fb6599ca..c025ee7144a 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_query_acc.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_query_acc.c
@@ -59,6 +59,7 @@ occlusion_resume(struct etna_acc_query *aq, struct etna_context *ctx)
    r.offset = aq->samples * 8; /* 64bit value */
 
    etna_set_state_reloc(ctx->stream, VIVS_GL_OCCLUSION_QUERY_ADDR, &r);
+   resource_written(ctx, aq->prsc);
 }
 
 static void
@@ -66,6 +67,7 @@ occlusion_suspend(struct etna_acc_query *aq, struct etna_context *ctx)
 {
    /* 0x1DF5E76 is the value used by blob - but any random value will work */
    etna_set_state(ctx->stream, VIVS_GL_OCCLUSION_QUERY_CONTROL, 0x1DF5E76);
+   resource_written(ctx, aq->prsc);
 }
 
 static void



More information about the mesa-commit mailing list