diff options
author | Francisco Jerez <[email protected]> | 2020-04-23 17:58:48 -0700 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-06-03 23:12:22 +0000 |
commit | e81c07de41c7f6f585a2c6aa0c67b1082b609b8f (patch) | |
tree | 6b0fc595e0e7858afcaff98f138313c1de72ee21 /src/gallium/drivers/iris/iris_query.c | |
parent | 8cbe9535482f3efd27fbcbb90a329e6567e8c961 (diff) |
iris: Bracket batch operations which access memory within sync regions.
This delimits all batch operations which access memory between
iris_batch_sync_region_start() and iris_batch_sync_region_end() calls.
This makes sure that any buffer objects accessed within the region are
considered in use through the same caching domain until the end of the
region.
Adding any buffer to the batch validation list outside of a sync
region will lead to an assertion failure in a future commit, unless
the caller explicitly opted out of the cache tracking mechanism.
Reviewed-by: Kenneth Graunke <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3875>
Diffstat (limited to 'src/gallium/drivers/iris/iris_query.c')
-rw-r--r-- | src/gallium/drivers/iris/iris_query.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_query.c b/src/gallium/drivers/iris/iris_query.c index 8888a8fd284..aaed40e5e08 100644 --- a/src/gallium/drivers/iris/iris_query.c +++ b/src/gallium/drivers/iris/iris_query.c @@ -711,6 +711,8 @@ iris_get_query_result_resource(struct pipe_context *ctx, struct gen_mi_builder b; gen_mi_builder_init(&b, batch); + iris_batch_sync_region_start(batch); + struct gen_mi_value result = calculate_result_on_gpu(devinfo, &b, q); struct gen_mi_value dst = result_type <= PIPE_QUERY_TYPE_U32 ? gen_mi_mem32(rw_bo(dst_bo, offset)) @@ -723,6 +725,8 @@ iris_get_query_result_resource(struct pipe_context *ctx, } else { gen_mi_store(&b, dst, result); } + + iris_batch_sync_region_end(batch); } static void @@ -763,6 +767,8 @@ set_predicate_for_result(struct iris_context *ice, struct iris_batch *batch = &ice->batches[IRIS_BATCH_RENDER]; struct iris_bo *bo = iris_resource_bo(q->query_state_ref.res); + iris_batch_sync_region_start(batch); + /* The CPU doesn't have the query result yet; use hardware predication */ ice->state.predicate = IRIS_PREDICATE_STATE_USE_BIT; @@ -809,6 +815,8 @@ set_predicate_for_result(struct iris_context *ice, gen_mi_store(&b, query_mem64(q, offsetof(struct iris_query_snapshots, predicate_result)), result); ice->state.compute_predicate = bo; + + iris_batch_sync_region_end(batch); } static void |