From 9ec927497e6e9aa3ee12619baf035472b81c17e0 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 7 Nov 2018 09:35:19 -0800 Subject: [PATCH] iris: Actually create/destroy HW contexts The intention is that render and compute use their own contexts, and each is PIPELINE_SELECT'd to the right pipeline. But we hadn't actually made them, so we got the fd-default context. Thanks to Chris Wilson for catching this! --- src/gallium/drivers/iris/iris_batch.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c index 7196691f73c..45fda4cd0b5 100644 --- a/src/gallium/drivers/iris/iris_batch.c +++ b/src/gallium/drivers/iris/iris_batch.c @@ -151,6 +151,9 @@ iris_init_batch(struct iris_batch *batch, assert(util_bitcount(engine) == 1); batch->engine = engine; + batch->hw_ctx_id = iris_create_hw_context(screen->bufmgr); + assert(batch->hw_ctx_id); + batch->exec_count = 0; batch->exec_array_size = 100; batch->exec_bos = @@ -279,6 +282,9 @@ iris_batch_reset(struct iris_batch *batch) void iris_batch_free(struct iris_batch *batch) { + struct iris_screen *screen = batch->screen; + struct iris_bufmgr *bufmgr = screen->bufmgr; + for (int i = 0; i < batch->exec_count; i++) { iris_bo_unreference(batch->exec_bos[i]); } @@ -291,6 +297,8 @@ iris_batch_free(struct iris_batch *batch) iris_bo_unreference(batch->last_bo); + iris_destroy_hw_context(bufmgr, batch->hw_ctx_id); + _mesa_hash_table_destroy(batch->cache.render, NULL); _mesa_set_destroy(batch->cache.depth, NULL); -- 2.30.2