diff options
author | Kenneth Graunke <[email protected]> | 2018-11-06 21:34:58 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-02-21 10:26:09 -0800 |
commit | fbe5d75f114b7510f6b486c76e19c789275b3294 (patch) | |
tree | 9672501ed01f151d43da88313152ebafe9b47aef /src/gallium/drivers/iris/iris_batch.c | |
parent | c3cc525c7a837241b2833a1f5a4da2eb1dd74808 (diff) |
iris: cross batch flushing
Diffstat (limited to 'src/gallium/drivers/iris/iris_batch.c')
-rw-r--r-- | src/gallium/drivers/iris/iris_batch.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c index 8f53dacb9dd..7196691f73c 100644 --- a/src/gallium/drivers/iris/iris_batch.c +++ b/src/gallium/drivers/iris/iris_batch.c @@ -205,6 +205,16 @@ add_exec_bo(struct iris_batch *batch, struct iris_bo *bo) return index; } + /* This is the first time our batch has seen this BO. Before we use it, + * we need to see if other batches reference it - if so, we should flush + * those first. + */ + for (int b = 0; b < ARRAY_SIZE(batch->other_batches); b++) { + if (iris_batch_references(batch->other_batches[b], bo)) + iris_batch_flush(batch->other_batches[b]); + } + + /* Now, take a reference and add it to the validation list. */ iris_bo_reference(bo); if (batch->exec_count == batch->exec_array_size) { |