Mesa (main): iris: add the workaround_bo directly to the batch

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Aug 11 22:38:14 UTC 2021


Module: Mesa
Branch: main
Commit: 155a7a9b0f80f59e6406ab5db5e956b5f871e666
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=155a7a9b0f80f59e6406ab5db5e956b5f871e666

Author: Paulo Zanoni <paulo.r.zanoni at intel.com>
Date:   Mon Aug  2 13:32:20 2021 -0700

iris: add the workaround_bo directly to the batch

Don't use iris_use_pinned_bo(), go directly with add_bo_to_batch(),
skipping every check. This allows us to early return from
iris_use_pinned_bo when the workaround bo is used, saving us the call
to find_validation_entry() which ends up doing nothing except
iterating over every bo in the batch. Also don't bother with
ensure_exec_obj_space() since we just reset the batch and this is the
second BO we're adding to it.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12194>

---

 src/gallium/drivers/iris/iris_batch.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c
index 34a40a8abd0..a2ff24b9fef 100644
--- a/src/gallium/drivers/iris/iris_batch.c
+++ b/src/gallium/drivers/iris/iris_batch.c
@@ -300,11 +300,13 @@ iris_use_pinned_bo(struct iris_batch *batch,
    /* Never mark the workaround BO with EXEC_OBJECT_WRITE.  We don't care
     * about the order of any writes to that buffer, and marking it writable
     * would introduce data dependencies between multiple batches which share
-    * the buffer.
+    * the buffer. It is added directly to the batch using add_bo_to_batch()
+    * during batch reset time.
     */
-   if (bo == batch->screen->workaround_bo) {
-      writable = false;
-   } else if (access < NUM_IRIS_DOMAINS) {
+   if (bo == batch->screen->workaround_bo)
+      return;
+
+   if (access < NUM_IRIS_DOMAINS) {
       assert(batch->sync_region_depth);
       iris_bo_bump_seqno(bo, batch->next_seqno, access);
    }
@@ -417,7 +419,7 @@ iris_batch_reset(struct iris_batch *batch)
    /* Always add the workaround BO, it contains a driver identifier at the
     * beginning quite helpful to debug error states.
     */
-   iris_use_pinned_bo(batch, screen->workaround_bo, false, IRIS_DOMAIN_NONE);
+   add_bo_to_batch(batch, screen->workaround_bo, false);
 
    iris_batch_maybe_noop(batch);
 }



More information about the mesa-commit mailing list