From e307e3df0c7b77fdd27ad1d77dd6f71329d8032b Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sun, 31 Jan 2021 08:58:09 -0800 Subject: [PATCH] mesa: Remove _mesa_destroy_context() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There was only one caller, an error path in mesa/st. But this is now incorrect as we need align_free(). Just remove it. Fixes: 55e853d823e ("mesa/st: Allocate the gl_context with 16-byte alignment.") Signed-off-by: Rob Clark Reviewed-by: Alyssa Rosenzweig Reviewed-by: Marek Olšák Part-of: (cherry picked from commit 824ae644778b1aff2956d18962053f6e1da932e7) --- .pick_status.json | 2 +- src/mesa/main/context.c | 17 ----------------- src/mesa/main/context.h | 4 ---- src/mesa/state_tracker/st_context.c | 3 ++- 4 files changed, 3 insertions(+), 23 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 157cb54b839..d8855a0ac9d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -166,7 +166,7 @@ "description": "mesa: Remove _mesa_destroy_context()", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "55e853d823e860dd232a8be0378bd0519e35b6bd" }, diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 98e189af08a..1376c5b680c 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1404,23 +1404,6 @@ _mesa_free_context_data(struct gl_context *ctx, bool destroy_debug_output) } -/** - * Destroy a struct gl_context structure. - * - * \param ctx GL context. - * - * Calls _mesa_free_context_data() and frees the gl_context object itself. - */ -void -_mesa_destroy_context( struct gl_context *ctx ) -{ - if (ctx) { - _mesa_free_context_data(ctx, true); - free( (void *) ctx ); - } -} - - /** * Copy attribute groups from one context to another. * diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index 9ffd75fbae3..202a2f2d9bf 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -120,10 +120,6 @@ _mesa_initialize_context( struct gl_context *ctx, extern void _mesa_free_context_data(struct gl_context *ctx, bool destroy_debug_output); -extern void -_mesa_destroy_context( struct gl_context *ctx ); - - extern void _mesa_copy_context(const struct gl_context *src, struct gl_context *dst, GLuint mask); diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 95263ea19ad..709511b5991 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -1044,7 +1044,8 @@ st_create_context(gl_api api, struct pipe_context *pipe, st = st_create_context_priv(ctx, pipe, options, no_error); if (!st) { - _mesa_destroy_context(ctx); + _mesa_free_context_data(ctx, true); + align_free(ctx); } return st;