#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)
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
struct iris_context *ice = (void *) ctx;
struct iris_query *q = (void *) query;
struct iris_batch *batch = &ice->batches[q->batch_idx];
- struct iris_screen *screen = (void *) ctx->screen;
if (q->type == PIPE_QUERY_TIMESTAMP) {
iris_begin_query(ctx, query);
- struct iris_syncpt *syncpt =
- ((struct iris_syncpt **) util_dynarray_begin(&batch->syncpts))[0];
- iris_syncpt_reference(screen, &q->syncpt, syncpt);
+ iris_batch_reference_signal_syncpt(batch, &q->syncpt);
mark_available(ice, q);
return true;
}
q->query_state_ref.offset +
offsetof(struct iris_query_snapshots, end));
- struct iris_syncpt *syncpt =
- ((struct iris_syncpt **) util_dynarray_begin(&batch->syncpts))[0];
- iris_syncpt_reference(screen, &q->syncpt, syncpt);
+ iris_batch_reference_signal_syncpt(batch, &q->syncpt);
mark_available(ice, q);
return true;