summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_batch.h
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2019-02-07 08:48:38 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:11 -0800
commit1cd001aa63ed55e26775fdb1a16a595265c10d43 (patch)
tree13c2d748368d953144409a56af75558b8ca1c2da /src/gallium/drivers/iris/iris_batch.h
parent9376799bd623d3e547afc2d31483f1cb44c2ba65 (diff)
iris: Make a iris_batch_reference_signal_syncpt helper function.
Suggested by Chris Wilson. More obvious what's going on.
Diffstat (limited to 'src/gallium/drivers/iris/iris_batch.h')
-rw-r--r--src/gallium/drivers/iris/iris_batch.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_batch.h b/src/gallium/drivers/iris/iris_batch.h
index d398c3c473e..3dd33663f11 100644
--- a/src/gallium/drivers/iris/iris_batch.h
+++ b/src/gallium/drivers/iris/iris_batch.h
@@ -33,6 +33,8 @@
#include "i915_drm.h"
#include "common/gen_decoder.h"
+#include "iris_fence.h"
+
/* The kernel assumes batchbuffers are smaller than 256kB. */
#define MAX_BATCH_SIZE (256 * 1024)
@@ -193,4 +195,20 @@ iris_batch_emit(struct iris_batch *batch, const void *data, unsigned size)
memcpy(map, data, size);
}
+/**
+ * Take a reference to the batch's signalling syncpt.
+ *
+ * Callers can use this to wait for the the current batch under construction
+ * to complete (after flushing it).
+ */
+static inline void
+iris_batch_reference_signal_syncpt(struct iris_batch *batch,
+ struct iris_syncpt **out_syncpt)
+{
+ /* The signalling syncpt is the first one in the list. */
+ struct iris_syncpt *syncpt =
+ ((struct iris_syncpt **) util_dynarray_begin(&batch->syncpts))[0];
+ iris_syncpt_reference(batch->screen, out_syncpt, syncpt);
+}
+
#endif