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!
This commit is contained in:
Kenneth Graunke
2018-11-07 09:35:19 -08:00
parent cb5f47f585
commit 9ec927497e

View File

@@ -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);