OSDN Git Service

freedreno: move free() into fdN_context_destroy()
authorRob Clark <robdclark@gmail.com>
Mon, 30 Jul 2018 12:38:28 +0000 (08:38 -0400)
committerRob Clark <robdclark@gmail.com>
Tue, 14 Aug 2018 19:46:34 +0000 (15:46 -0400)
Following patches will be doing further cleanup after calling
fd_context_destroy() so it is easier if we move the free() into
the per-gen backend code.

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/a2xx/fd2_context.c
src/gallium/drivers/freedreno/a3xx/fd3_context.c
src/gallium/drivers/freedreno/a4xx/fd4_context.c
src/gallium/drivers/freedreno/a5xx/fd5_context.c
src/gallium/drivers/freedreno/freedreno_context.c

index 4f6e432..71fc17b 100644 (file)
@@ -41,6 +41,7 @@ static void
 fd2_context_destroy(struct pipe_context *pctx)
 {
        fd_context_destroy(pctx);
+       free(pctx);
 }
 
 static struct pipe_resource *
index 3623b9c..bb9dd28 100644 (file)
@@ -55,6 +55,8 @@ fd3_context_destroy(struct pipe_context *pctx)
        fd_hw_query_fini(pctx);
 
        fd_context_destroy(pctx);
+
+       free(fd3_ctx);
 }
 
 static const uint8_t primtypes[] = {
index 1f5546d..12505e8 100644 (file)
@@ -55,6 +55,8 @@ fd4_context_destroy(struct pipe_context *pctx)
        fd_hw_query_fini(pctx);
 
        fd_context_destroy(pctx);
+
+       free(fd4_ctx);
 }
 
 static const uint8_t primtypes[] = {
index c43a8ad..96e89bc 100644 (file)
@@ -54,6 +54,8 @@ fd5_context_destroy(struct pipe_context *pctx)
        u_upload_destroy(fd5_ctx->border_color_uploader);
 
        fd_context_destroy(pctx);
+
+       free(fd5_ctx);
 }
 
 static const uint8_t primtypes[] = {
index e1324e8..2eeb85e 100644 (file)
@@ -172,8 +172,6 @@ fd_context_destroy(struct pipe_context *pctx)
                        (uint32_t)ctx->stats.batch_gmem, (uint32_t)ctx->stats.batch_nondraw,
                        (uint32_t)ctx->stats.batch_restore);
        }
-
-       FREE(ctx);
 }
 
 static void