From a9ab5b4f166163d0e7e263bad8a5f921d9193b93 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 19 Mar 2021 17:21:38 -0400 Subject: [PATCH] zink: break out surface destroy function into a screen function Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_surface.c | 13 +++++++++---- src/gallium/drivers/zink/zink_surface.h | 3 +++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/zink/zink_surface.c b/src/gallium/drivers/zink/zink_surface.c index 2e3309f43df..2f11bd05e62 100644 --- a/src/gallium/drivers/zink/zink_surface.c +++ b/src/gallium/drivers/zink/zink_surface.c @@ -177,11 +177,9 @@ zink_create_surface(struct pipe_context *pctx, return zink_get_surface(zink_context(pctx), pres, templ, &ivci); } -static void -zink_surface_destroy(struct pipe_context *pctx, - struct pipe_surface *psurface) +void +zink_destroy_surface(struct zink_screen *screen, struct pipe_surface *psurface) { - struct zink_screen *screen = zink_screen(pctx->screen); struct zink_surface *surface = zink_surface(psurface); simple_mtx_lock(&screen->surface_mtx); struct hash_entry *he = _mesa_hash_table_search_pre_hashed(&screen->surface_cache, surface->hash, &surface->ivci); @@ -193,6 +191,13 @@ zink_surface_destroy(struct pipe_context *pctx, FREE(surface); } +static void +zink_surface_destroy(struct pipe_context *pctx, + struct pipe_surface *psurface) +{ + zink_destroy_surface(zink_screen(pctx->screen), psurface); +} + void zink_context_surface_init(struct pipe_context *context) { diff --git a/src/gallium/drivers/zink/zink_surface.h b/src/gallium/drivers/zink/zink_surface.h index afed99d8143..61bc9c94fc4 100644 --- a/src/gallium/drivers/zink/zink_surface.h +++ b/src/gallium/drivers/zink/zink_surface.h @@ -44,6 +44,9 @@ zink_surface(struct pipe_surface *pipe) return (struct zink_surface *)pipe; } +void +zink_destroy_surface(struct zink_screen *screen, struct pipe_surface *psurface); + void zink_context_surface_init(struct pipe_context *context);