From 0cafd100fa5acb8250bbec44c2b9fbe9684e1c63 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 16 Mar 2026 11:07:06 -0400 Subject: [PATCH] freedreno: delete pipe_context surface hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- .../drivers/freedreno/freedreno_resource.c | 3 -- .../drivers/freedreno/freedreno_surface.c | 46 ------------------- .../drivers/freedreno/freedreno_surface.h | 19 -------- src/gallium/drivers/freedreno/meson.build | 2 - 4 files changed, 70 deletions(-) delete mode 100644 src/gallium/drivers/freedreno/freedreno_surface.c delete mode 100644 src/gallium/drivers/freedreno/freedreno_surface.h diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index 158df79fc6c..75b3f6f5ccf 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -27,7 +27,6 @@ #include "freedreno_query_hw.h" #include "freedreno_resource.h" #include "freedreno_screen.h" -#include "freedreno_surface.h" #include "freedreno_util.h" #include @@ -1840,8 +1839,6 @@ fd_resource_context_init(struct pipe_context *pctx) pctx->texture_unmap = u_transfer_helper_transfer_unmap; pctx->buffer_subdata = u_default_buffer_subdata; pctx->texture_subdata = u_default_texture_subdata; - pctx->create_surface = fd_create_surface; - pctx->surface_destroy = fd_surface_destroy; pctx->resource_copy_region = fd_resource_copy_region; pctx->blit = fd_blit_pipe; pctx->flush_resource = fd_flush_resource; diff --git a/src/gallium/drivers/freedreno/freedreno_surface.c b/src/gallium/drivers/freedreno/freedreno_surface.c deleted file mode 100644 index 0279117aa44..00000000000 --- a/src/gallium/drivers/freedreno/freedreno_surface.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright © 2012 Rob Clark - * SPDX-License-Identifier: MIT - * - * Authors: - * Rob Clark - */ - -#include "freedreno_surface.h" -#include "freedreno_resource.h" -#include "freedreno_util.h" - -#include "util/u_inlines.h" -#include "util/u_memory.h" - -struct pipe_surface * -fd_create_surface(struct pipe_context *pctx, struct pipe_resource *ptex, - const struct pipe_surface *surf_tmpl) -{ - struct pipe_surface *psurf = CALLOC_STRUCT(pipe_surface); - - if (!psurf) - return NULL; - - unsigned level = surf_tmpl->level; - - pipe_reference_init(&psurf->reference, 1); - pipe_resource_reference(&psurf->texture, ptex); - - psurf->context = pctx; - psurf->format = surf_tmpl->format; - psurf->nr_samples = surf_tmpl->nr_samples; - - psurf->level = level; - psurf->first_layer = surf_tmpl->first_layer; - psurf->last_layer = surf_tmpl->last_layer; - - return psurf; -} - -void -fd_surface_destroy(struct pipe_context *pctx, struct pipe_surface *psurf) -{ - pipe_resource_reference(&psurf->texture, NULL); - FREE(psurf); -} diff --git a/src/gallium/drivers/freedreno/freedreno_surface.h b/src/gallium/drivers/freedreno/freedreno_surface.h deleted file mode 100644 index 81cf9c1a1db..00000000000 --- a/src/gallium/drivers/freedreno/freedreno_surface.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright © 2012 Rob Clark - * SPDX-License-Identifier: MIT - * - * Authors: - * Rob Clark - */ - -#ifndef FREEDRENO_SURFACE_H_ -#define FREEDRENO_SURFACE_H_ - -#include "pipe/p_state.h" - -struct pipe_surface *fd_create_surface(struct pipe_context *pctx, - struct pipe_resource *ptex, - const struct pipe_surface *surf_tmpl); -void fd_surface_destroy(struct pipe_context *pctx, struct pipe_surface *psurf); - -#endif /* FREEDRENO_SURFACE_H_ */ diff --git a/src/gallium/drivers/freedreno/meson.build b/src/gallium/drivers/freedreno/meson.build index 57cda5ffb43..b04379b7616 100644 --- a/src/gallium/drivers/freedreno/meson.build +++ b/src/gallium/drivers/freedreno/meson.build @@ -35,8 +35,6 @@ files_libfreedreno = files( 'freedreno_screen.h', 'freedreno_state.c', 'freedreno_state.h', - 'freedreno_surface.c', - 'freedreno_surface.h', 'freedreno_texture.c', 'freedreno_texture.h', 'freedreno_util.c',