iris: Destroy transfer slab after batches
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 1 May 2020 17:57:15 +0000 (10:57 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 1 May 2020 19:00:02 +0000 (19:00 +0000)
Batches are going to have an uploader in the next commit, so destroying
batches will destroy uploaders, which will unmap transfers, which will
return things to the slab allocator.  So we need to reorder destroying
the slab allocator to the end to avoid crashing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3802>

src/gallium/drivers/iris/iris_context.c

index 4d161ac3f411a699f93e06fac84c9c75c38aff85..fcc71f739bbff52a04c0c7579b8088bba8e3143e 100644 (file)
@@ -202,12 +202,12 @@ iris_destroy_context(struct pipe_context *ctx)
    u_upload_destroy(ice->state.dynamic_uploader);
    u_upload_destroy(ice->query_buffer_uploader);
 
-   slab_destroy_child(&ice->transfer_pool);
-
    iris_batch_free(&ice->batches[IRIS_BATCH_RENDER]);
    iris_batch_free(&ice->batches[IRIS_BATCH_COMPUTE]);
    iris_destroy_binder(&ice->state.binder);
 
+   slab_destroy_child(&ice->transfer_pool);
+
    ralloc_free(ice);
 }