iris: Make a iris_batch_reference_signal_syncpt helper function.
Suggested by Chris Wilson. More obvious what's going on.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#include "util/u_inlines.h"
|
||||
|
||||
struct pipe_screen;
|
||||
struct iris_screen;
|
||||
struct iris_batch;
|
||||
|
||||
struct iris_syncpt {
|
||||
struct pipe_reference ref;
|
||||
|
||||
@@ -811,13 +811,10 @@ iris_end_query(struct pipe_context *ctx, struct pipe_query *query)
|
||||
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;
|
||||
}
|
||||
@@ -835,9 +832,7 @@ iris_end_query(struct pipe_context *ctx, struct pipe_query *query)
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user