From a4c0f5ba6f3a6f7d15cbfb1854099edefd1efae0 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 16 Mar 2026 11:43:23 -0400 Subject: [PATCH] svga: simplify some surface management MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/svga/svga_pipe_clear.c | 6 +++--- src/gallium/drivers/svga/svga_surface.c | 2 +- src/gallium/drivers/svga/svga_surface.h | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/svga/svga_pipe_clear.c b/src/gallium/drivers/svga/svga_pipe_clear.c index 16337b01850..05d9e9c41fb 100644 --- a/src/gallium/drivers/svga/svga_pipe_clear.c +++ b/src/gallium/drivers/svga/svga_pipe_clear.c @@ -315,7 +315,7 @@ svga_clear_texture(struct pipe_context *pipe, svga_validate_surface_view(svga, svga_surface_dst); if (!dsv) { - pipe_surface_reference(&surface, NULL); + svga_surface_destroy(pipe, surface); return; } @@ -355,7 +355,7 @@ svga_clear_texture(struct pipe_context *pipe, svga_validate_surface_view(svga, svga_surface_dst); if (!rtv) { - pipe_surface_reference(&surface, NULL); + svga_surface_destroy(pipe, surface); return; } @@ -430,7 +430,7 @@ svga_clear_texture(struct pipe_context *pipe, } } } - pipe_surface_reference(&surface, NULL); + svga_surface_destroy(pipe, surface); } diff --git a/src/gallium/drivers/svga/svga_surface.c b/src/gallium/drivers/svga/svga_surface.c index ed13eeb60d4..594abc8c69a 100644 --- a/src/gallium/drivers/svga/svga_surface.c +++ b/src/gallium/drivers/svga/svga_surface.c @@ -627,7 +627,7 @@ svga_validate_surface_view(struct svga_context *svga, struct svga_surface *s) } -static void +void svga_surface_destroy(struct pipe_context *pipe, struct pipe_surface *surf) { diff --git a/src/gallium/drivers/svga/svga_surface.h b/src/gallium/drivers/svga/svga_surface.h index 5afc49a2fa2..a43462a8ce1 100644 --- a/src/gallium/drivers/svga/svga_surface.h +++ b/src/gallium/drivers/svga/svga_surface.h @@ -140,6 +140,10 @@ svga_create_surface(struct pipe_context *pipe, struct pipe_resource *pt, const struct pipe_surface *surf_tmpl); +void +svga_surface_destroy(struct pipe_context *pipe, + struct pipe_surface *surf); + static inline struct svga_surface * svga_surface(struct pipe_surface *surface) {