iris: Replace unconditional QBO flush with iris_dirty_for_history().
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 7 Feb 2020 04:58:40 +0000 (20:58 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 4 Apr 2022 17:32:31 +0000 (10:32 -0700)
We can now use the same cache tracking mechanism for synchronizing QBO
writes instead of the unconditional PIPE_CONTROL performed currently,
which is unable to invalidate any incoherent caches which may contain
stale data for the buffer object.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15738>

src/gallium/drivers/iris/iris_query.c

index bb7ad66..49201d5 100644 (file)
@@ -699,13 +699,8 @@ iris_get_query_result_resource(struct pipe_context *ctx,
          batch->screen->vtbl.store_data_imm64(batch, dst_bo, offset, q->result);
       }
 
-      /* Make sure the result lands before they use bind the QBO elsewhere
-       * and use the result.
-       */
-      // XXX: Why?  i965 doesn't do this.
-      iris_emit_pipe_control_flush(batch,
-                                   "query: unknown QBO flushing hack",
-                                   PIPE_CONTROL_CS_STALL);
+      /* Make sure QBO is flushed before its result is used elsewhere. */
+      iris_dirty_for_history(ice, res);
       return;
    }