Commit db878a72 authored by Kenneth Graunke's avatar Kenneth Graunke

iris: Make an iris_batch_get_signal_syncpt() helper.

This returns a pointer to the signalling syncpt, without incrementing
the reference count.  This can be useful for comparisons.
Reviewed-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent 443e5301
......@@ -202,6 +202,19 @@ iris_batch_emit(struct iris_batch *batch, const void *data, unsigned size)
memcpy(map, data, size);
}
/**
* Get a pointer to the batch's signalling syncpt. Does not refcount.
*/
static inline struct iris_syncpt *
iris_batch_get_signal_syncpt(struct iris_batch *batch)
{
/* The signalling syncpt is the first one in the list. */
struct iris_syncpt *syncpt =
((struct iris_syncpt **) util_dynarray_begin(&batch->syncpts))[0];
return syncpt;
}
/**
* Take a reference to the batch's signalling syncpt.
*
......@@ -212,9 +225,7 @@ 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];
struct iris_syncpt *syncpt = iris_batch_get_signal_syncpt(batch);
iris_syncpt_reference(batch->screen, out_syncpt, syncpt);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment