tegra: delete pipe_context surface hooks

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40462>
This commit is contained in:
Mike Blumenkrantz 2026-03-16 11:06:38 -04:00 committed by Marge Bot
parent 199eff7538
commit 1af551ed9f

View file

@ -863,48 +863,6 @@ tegra_sampler_view_destroy(struct pipe_context *pcontext,
free(view);
}
static struct pipe_surface *
tegra_create_surface(struct pipe_context *pcontext,
struct pipe_resource *presource,
const struct pipe_surface *template)
{
struct tegra_resource *resource = to_tegra_resource(presource);
struct tegra_context *context = to_tegra_context(pcontext);
struct tegra_surface *surface;
surface = calloc(1, sizeof(*surface));
if (!surface)
return NULL;
surface->gpu = context->gpu->create_surface(context->gpu, resource->gpu,
template);
if (!surface->gpu) {
free(surface);
return NULL;
}
memcpy(&surface->base, surface->gpu, sizeof(*surface->gpu));
/* overwrite to prevent reference from being released */
surface->base.texture = NULL;
pipe_reference_init(&surface->base.reference, 1);
pipe_resource_reference(&surface->base.texture, presource);
surface->base.context = &context->base;
return &surface->base;
}
static void
tegra_surface_destroy(struct pipe_context *pcontext,
struct pipe_surface *psurface)
{
struct tegra_surface *surface = to_tegra_surface(psurface);
pipe_resource_reference(&surface->base.texture, NULL);
pipe_surface_reference(&surface->gpu, NULL);
free(surface);
}
static void *
tegra_transfer_map(struct pipe_context *pcontext,
struct pipe_resource *presource,
@ -1359,9 +1317,6 @@ tegra_screen_context_create(struct pipe_screen *pscreen, void *priv,
context->base.sampler_view_release = u_default_sampler_view_release;
context->base.resource_release = u_default_resource_release;
context->base.create_surface = tegra_create_surface;
context->base.surface_destroy = tegra_surface_destroy;
context->base.buffer_map = tegra_transfer_map;
context->base.texture_map = tegra_transfer_map;
context->base.transfer_flush_region = tegra_transfer_flush_region;