From d69bc4ac121369ac6cfe62c1b720a9dd59bf3483 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 19 Nov 2018 20:41:26 -0800 Subject: [PATCH] iris: Hang on to the last batch's sync-point, so we can wait on it --- src/gallium/drivers/iris/iris_batch.c | 6 ++++++ src/gallium/drivers/iris/iris_batch.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c index 04d71c0bff0..85051186980 100644 --- a/src/gallium/drivers/iris/iris_batch.c +++ b/src/gallium/drivers/iris/iris_batch.c @@ -384,6 +384,8 @@ iris_batch_free(struct iris_batch *batch) iris_syncpt_reference(screen, s, NULL); ralloc_free(batch->syncpts.mem_ctx); + iris_syncpt_reference(screen, &batch->last_syncpt, NULL); + iris_bo_unreference(batch->bo); batch->bo = NULL; batch->map = NULL; @@ -580,6 +582,10 @@ _iris_batch_flush(struct iris_batch *batch, const char *file, int line) batch->exec_count = 0; batch->aperture_space = 0; + struct iris_syncpt *syncpt = + ((struct iris_syncpt **) util_dynarray_begin(&batch->syncpts))[0]; + iris_syncpt_reference(screen, &batch->last_syncpt, syncpt); + util_dynarray_foreach(&batch->syncpts, struct iris_syncpt *, s) iris_syncpt_reference(screen, s, NULL); util_dynarray_clear(&batch->syncpts); diff --git a/src/gallium/drivers/iris/iris_batch.h b/src/gallium/drivers/iris/iris_batch.h index daa57fce6b5..cf119dd326a 100644 --- a/src/gallium/drivers/iris/iris_batch.h +++ b/src/gallium/drivers/iris/iris_batch.h @@ -91,6 +91,9 @@ struct iris_batch { /** The amount of aperture space (in bytes) used by all exec_bos */ int aperture_space; + /** A sync-point for the last batch that was submitted. */ + struct iris_syncpt *last_syncpt; + /** List of other batches which we might need to flush to use a BO */ struct iris_batch *other_batches[IRIS_BATCH_COUNT - 1]; -- 2.30.2