From: Rob Clark Date: Wed, 22 Aug 2018 13:07:37 +0000 (-0400) Subject: freedreno: fix context teardown harder X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=73378013d7ff6ddf7f503c6386d8243463be11f3;p=mesa.git freedreno: fix context teardown harder The border_color_uploaders need to be torn down before the transfer_pool is destroyed. Fixes: e11e9d63943 freedreno: fix context teardown race Signed-off-by: Rob Clark --- diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_context.c b/src/gallium/drivers/freedreno/a3xx/fd3_context.c index c045133a27f..b2dbc520716 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_context.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_context.c @@ -44,6 +44,8 @@ fd3_context_destroy(struct pipe_context *pctx) { struct fd3_context *fd3_ctx = fd3_context(fd_context(pctx)); + u_upload_destroy(fd3_ctx->border_color_uploader); + fd_context_destroy(pctx); fd_bo_del(fd3_ctx->vs_pvt_mem); @@ -52,8 +54,6 @@ fd3_context_destroy(struct pipe_context *pctx) fd_context_cleanup_common_vbos(&fd3_ctx->base); - u_upload_destroy(fd3_ctx->border_color_uploader); - fd_hw_query_fini(pctx); free(fd3_ctx); diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_context.c b/src/gallium/drivers/freedreno/a4xx/fd4_context.c index 97aae13bc64..2e29aafebc6 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_context.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_context.c @@ -44,6 +44,8 @@ fd4_context_destroy(struct pipe_context *pctx) { struct fd4_context *fd4_ctx = fd4_context(fd_context(pctx)); + u_upload_destroy(fd4_ctx->border_color_uploader); + fd_context_destroy(pctx); fd_bo_del(fd4_ctx->vs_pvt_mem); @@ -52,8 +54,6 @@ fd4_context_destroy(struct pipe_context *pctx) fd_context_cleanup_common_vbos(&fd4_ctx->base); - u_upload_destroy(fd4_ctx->border_color_uploader); - fd_hw_query_fini(pctx); free(fd4_ctx); diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_context.c b/src/gallium/drivers/freedreno/a5xx/fd5_context.c index d69b787064a..e6af5d265a6 100644 --- a/src/gallium/drivers/freedreno/a5xx/fd5_context.c +++ b/src/gallium/drivers/freedreno/a5xx/fd5_context.c @@ -44,6 +44,8 @@ fd5_context_destroy(struct pipe_context *pctx) { struct fd5_context *fd5_ctx = fd5_context(fd_context(pctx)); + u_upload_destroy(fd5_ctx->border_color_uploader); + fd_context_destroy(pctx); fd_bo_del(fd5_ctx->vs_pvt_mem); @@ -53,8 +55,6 @@ fd5_context_destroy(struct pipe_context *pctx) fd_context_cleanup_common_vbos(&fd5_ctx->base); - u_upload_destroy(fd5_ctx->border_color_uploader); - free(fd5_ctx); } diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_context.c b/src/gallium/drivers/freedreno/a6xx/fd6_context.c index f67a0a76140..695a4c49bad 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_context.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_context.c @@ -43,6 +43,8 @@ fd6_context_destroy(struct pipe_context *pctx) { struct fd6_context *fd6_ctx = fd6_context(fd_context(pctx)); + u_upload_destroy(fd6_ctx->border_color_uploader); + fd_context_destroy(pctx); fd_bo_del(fd6_ctx->vs_pvt_mem); @@ -52,8 +54,6 @@ fd6_context_destroy(struct pipe_context *pctx) fd_context_cleanup_common_vbos(&fd6_ctx->base); - u_upload_destroy(fd6_ctx->border_color_uploader); - free(fd6_ctx); }