From 3f15ba7d681cb3eb0bda55a7edc82f16672e23e9 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Thu, 20 Oct 2022 22:10:47 +0800 Subject: [PATCH] st: Remove st_api::destroy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's a global variable and have no need destroy Signed-off-by: Yonggang Luo Reviewed-by: Jesse Natalie Reviewed-by: Marek Olšák Part-of: --- src/gallium/frontends/dri/dri_screen.c | 3 --- src/gallium/frontends/hgl/hgl.c | 2 -- src/gallium/frontends/osmesa/osmesa.c | 4 ---- src/gallium/frontends/wgl/stw_device.c | 3 --- src/gallium/include/frontend/api.h | 5 ----- src/mesa/state_tracker/st_manager.c | 7 ------- 6 files changed, 24 deletions(-) diff --git a/src/gallium/frontends/dri/dri_screen.c b/src/gallium/frontends/dri/dri_screen.c index 5e4119df43d..ba3b52ef9ec 100644 --- a/src/gallium/frontends/dri/dri_screen.c +++ b/src/gallium/frontends/dri/dri_screen.c @@ -774,9 +774,6 @@ dri_destroy_screen_helper(struct dri_screen * screen) if (screen->base.destroy) screen->base.destroy(&screen->base); - if (screen->st_api && screen->st_api->destroy) - screen->st_api->destroy(screen->st_api); - if (screen->base.screen) screen->base.screen->destroy(screen->base.screen); diff --git a/src/gallium/frontends/hgl/hgl.c b/src/gallium/frontends/hgl/hgl.c index 731781e37cd..c4455a7a961 100644 --- a/src/gallium/frontends/hgl/hgl.c +++ b/src/gallium/frontends/hgl/hgl.c @@ -359,7 +359,5 @@ hgl_destroy_display(struct hgl_display *display) if (display->manager->destroy) display->manager->destroy(display->manager); FREE(display->manager); - if (display->api->destroy) - display->api->destroy(display->api); FREE(display); } diff --git a/src/gallium/frontends/osmesa/osmesa.c b/src/gallium/frontends/osmesa/osmesa.c index 91a250d6421..3173fb6c46b 100644 --- a/src/gallium/frontends/osmesa/osmesa.c +++ b/src/gallium/frontends/osmesa/osmesa.c @@ -142,10 +142,6 @@ destroy_st_manager(void) stmgr->screen->destroy(stmgr->screen); FREE(stmgr); } - - if (stapi && stapi->destroy) { - stapi->destroy(stapi); - } } static void diff --git a/src/gallium/frontends/wgl/stw_device.c b/src/gallium/frontends/wgl/stw_device.c index 5e3b6e1b6f2..467bd780fee 100644 --- a/src/gallium/frontends/wgl/stw_device.c +++ b/src/gallium/frontends/wgl/stw_device.c @@ -169,8 +169,6 @@ stw_init(const struct stw_winsys *stw_winsys) error1: FREE(stw_dev->smapi); - if (stw_dev->stapi) - stw_dev->stapi->destroy(stw_dev->stapi); stw_dev = NULL; return FALSE; @@ -256,7 +254,6 @@ stw_cleanup(void) stw_dev->smapi->destroy(stw_dev->smapi); FREE(stw_dev->smapi); - stw_dev->stapi->destroy(stw_dev->stapi); stw_dev->screen->destroy(stw_dev->screen); diff --git a/src/gallium/include/frontend/api.h b/src/gallium/include/frontend/api.h index d38d78e1247..637cc410588 100644 --- a/src/gallium/include/frontend/api.h +++ b/src/gallium/include/frontend/api.h @@ -512,11 +512,6 @@ struct st_api */ const char *name; - /** - * Destroy the API. - */ - void (*destroy)(struct st_api *stapi); - /** * Query supported OpenGL versions. (if applicable) * The format is (major*10+minor). diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index d10a8d3b47c..c0e4c46c06f 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -1281,12 +1281,6 @@ st_api_make_current(struct st_api *stapi, struct st_context_iface *stctxi, } -static void -st_api_destroy(struct st_api *stapi) -{ -} - - /** * Flush the front buffer if the current context renders to the front buffer. */ @@ -1458,7 +1452,6 @@ st_api_query_versions(struct st_api *stapi, struct st_manager *sm, static const struct st_api st_gl_api = { .name = "Mesa " PACKAGE_VERSION, - .destroy = st_api_destroy, .query_versions = st_api_query_versions, .create_context = st_api_create_context, .make_current = st_api_make_current,