panfrost_new_job(&batch->pool, &batch->scoreboard,
JOB_TYPE_COMPUTE, true, 0, &payload,
sizeof(payload), false);
- panfrost_flush_all_batches(ctx, false);
+ panfrost_flush_all_batches(ctx);
}
static void
}
/* Submit all pending jobs */
- panfrost_flush_all_batches(ctx, false);
+ panfrost_flush_all_batches(ctx);
if (fence) {
struct panfrost_fence *f = panfrost_fence_create(ctx, &fences);
panfrost_texture_barrier(struct pipe_context *pipe, unsigned flags)
{
struct panfrost_context *ctx = pan_context(pipe);
- panfrost_flush_all_batches(ctx, false);
+ panfrost_flush_all_batches(ctx);
}
#define DEFINE_CASE(c) case PIPE_PRIM_##c: return MALI_##c;
case PIPE_QUERY_PRIMITIVES_GENERATED:
case PIPE_QUERY_PRIMITIVES_EMITTED:
- panfrost_flush_all_batches(ctx, false);
+ panfrost_flush_all_batches(ctx);
vresult->u64 = query->end - query->start;
break;
}
void
-panfrost_flush_all_batches(struct panfrost_context *ctx, bool wait)
+panfrost_flush_all_batches(struct panfrost_context *ctx)
{
- struct util_dynarray fences, syncobjs;
-
- if (wait) {
- util_dynarray_init(&fences, NULL);
- util_dynarray_init(&syncobjs, NULL);
- }
-
hash_table_foreach(ctx->batches, hentry) {
struct panfrost_batch *batch = hentry->data;
-
assert(batch);
- if (wait) {
- panfrost_batch_fence_reference(batch->out_sync);
- util_dynarray_append(&fences, struct panfrost_batch_fence *,
- batch->out_sync);
- util_dynarray_append(&syncobjs, uint32_t,
- batch->out_sync->syncobj);
- }
-
panfrost_batch_submit(batch);
}
/* Collect batch fences before returning */
panfrost_gc_fences(ctx);
-
- if (!wait)
- return;
-
- drmSyncobjWait(pan_device(ctx->base.screen)->fd,
- util_dynarray_begin(&syncobjs),
- util_dynarray_num_elements(&syncobjs, uint32_t),
- INT64_MAX, DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL, NULL);
-
- util_dynarray_foreach(&fences, struct panfrost_batch_fence *, fence)
- panfrost_batch_fence_unreference(*fence);
-
- util_dynarray_fini(&fences);
- util_dynarray_fini(&syncobjs);
}
bool
uint32_t create_flags, uint32_t access_flags);
void
-panfrost_flush_all_batches(struct panfrost_context *ctx, bool wait);
+panfrost_flush_all_batches(struct panfrost_context *ctx);
bool
panfrost_pending_batches_access_bo(struct panfrost_context *ctx,