summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2018-08-20 09:55:12 -0400
committerRob Clark <[email protected]>2018-08-20 10:03:05 -0400
commite11e9d639439c32fe9dfa5af22abda2b54157771 (patch)
treecbf4b30c677fbe193f16539d6927eea04cd81b29 /src/gallium/drivers/freedreno
parent5fab32ddad8b32c4a05517c43623653f8634c4d9 (diff)
freedreno: fix context teardown race
We could still have batches queued up to flush, so fd_context_destroy() (which will kill and sync on the flush_queue) before deleting buffers that might be referenced from fdN_gmem() from context of flush_queue. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_context.c4
-rw-r--r--src/gallium/drivers/freedreno/a4xx/fd4_context.c4
-rw-r--r--src/gallium/drivers/freedreno/a5xx/fd5_context.c4
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_context.c4
4 files changed, 8 insertions, 8 deletions
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_context.c b/src/gallium/drivers/freedreno/a3xx/fd3_context.c
index bb9dd2893e7..c045133a27f 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));
+ fd_context_destroy(pctx);
+
fd_bo_del(fd3_ctx->vs_pvt_mem);
fd_bo_del(fd3_ctx->fs_pvt_mem);
fd_bo_del(fd3_ctx->vsc_size_mem);
@@ -54,8 +56,6 @@ fd3_context_destroy(struct pipe_context *pctx)
fd_hw_query_fini(pctx);
- fd_context_destroy(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 12505e83a6c..97aae13bc64 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));
+ fd_context_destroy(pctx);
+
fd_bo_del(fd4_ctx->vs_pvt_mem);
fd_bo_del(fd4_ctx->fs_pvt_mem);
fd_bo_del(fd4_ctx->vsc_size_mem);
@@ -54,8 +56,6 @@ fd4_context_destroy(struct pipe_context *pctx)
fd_hw_query_fini(pctx);
- fd_context_destroy(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 96e89bc8542..d69b787064a 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));
+ fd_context_destroy(pctx);
+
fd_bo_del(fd5_ctx->vs_pvt_mem);
fd_bo_del(fd5_ctx->fs_pvt_mem);
fd_bo_del(fd5_ctx->vsc_size_mem);
@@ -53,8 +55,6 @@ fd5_context_destroy(struct pipe_context *pctx)
u_upload_destroy(fd5_ctx->border_color_uploader);
- fd_context_destroy(pctx);
-
free(fd5_ctx);
}
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_context.c b/src/gallium/drivers/freedreno/a6xx/fd6_context.c
index 4c415480875..f67a0a76140 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));
+ fd_context_destroy(pctx);
+
fd_bo_del(fd6_ctx->vs_pvt_mem);
fd_bo_del(fd6_ctx->fs_pvt_mem);
fd_bo_del(fd6_ctx->vsc_size_mem);
@@ -52,8 +54,6 @@ fd6_context_destroy(struct pipe_context *pctx)
u_upload_destroy(fd6_ctx->border_color_uploader);
- fd_context_destroy(pctx);
-
free(fd6_ctx);
}