etnaviv: get rid of etna_surface

Now that nothing calls the driver create/destroy surface hooks
anymore, we can get rid of what's left from the code.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35406>
This commit is contained in:
Lucas Stach 2025-06-08 21:33:12 +02:00 committed by Marge Bot
parent 8b1ee7adb4
commit 03c40b5aa0
5 changed files with 0 additions and 141 deletions

View file

@ -34,7 +34,6 @@
#include "etnaviv_format.h"
#include "etnaviv_resource.h"
#include "etnaviv_rs.h"
#include "etnaviv_surface.h"
#include "etnaviv_translate.h"
#include "etnaviv_yuv.h"

View file

@ -41,7 +41,6 @@
#include "etnaviv_screen.h"
#include "etnaviv_shader.h"
#include "etnaviv_state.h"
#include "etnaviv_surface.h"
#include "etnaviv_texture.h"
#include "etnaviv_transfer.h"
#include "etnaviv_translate.h"
@ -722,7 +721,6 @@ etna_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
etna_clear_blit_init(pctx);
etna_query_context_init(pctx);
etna_state_init(pctx);
etna_surface_init(pctx);
etna_shader_init(pctx);
etna_texture_init(pctx);
etna_transfer_init(pctx);

View file

@ -1,84 +0,0 @@
/*
* Copyright (c) 2012-2013 Etnaviv Project
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sub license,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Wladimir J. van der Laan <laanwj@gmail.com>
*/
#include "etnaviv_surface.h"
#include "etnaviv_screen.h"
#include "etnaviv_clear_blit.h"
#include "etnaviv_context.h"
#include "etnaviv_translate.h"
#include "pipe/p_defines.h"
#include "pipe/p_state.h"
#include "util/u_inlines.h"
#include "util/u_math.h"
#include "util/u_memory.h"
#include "drm-uapi/drm_fourcc.h"
static struct pipe_surface *
etna_create_surface(struct pipe_context *pctx, struct pipe_resource *prsc,
const struct pipe_surface *templat)
{
unsigned layer = templat->first_layer;
unsigned level = templat->level;
struct etna_resource *rsc = etna_resource_get_render_compatible(pctx, prsc);
struct etna_resource_level *lev = &rsc->levels[level];
struct etna_surface *surf = CALLOC_STRUCT(etna_surface);
if (!surf)
return NULL;
assert(templat->first_layer == templat->last_layer);
assert(layer <= util_max_layer(prsc, level));
surf->base.context = pctx;
pipe_reference_init(&surf->base.reference, 1);
pipe_resource_reference(&surf->base.texture, &rsc->base);
pipe_resource_reference(&surf->prsc, prsc);
surf->base.format = templat->format;
surf->base.first_layer = templat->first_layer;
surf->base.last_layer = templat->last_layer;
surf->level = lev;
return &surf->base;
}
static void
etna_surface_destroy(struct pipe_context *pctx, struct pipe_surface *psurf)
{
pipe_resource_reference(&psurf->texture, NULL);
pipe_resource_reference(&etna_surface(psurf)->prsc, NULL);
FREE(psurf);
}
void
etna_surface_init(struct pipe_context *pctx)
{
pctx->create_surface = etna_create_surface;
pctx->surface_destroy = etna_surface_destroy;
}

View file

@ -1,52 +0,0 @@
/*
* Copyright (c) 2012-2015 Etnaviv Project
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sub license,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Wladimir J. van der Laan <laanwj@gmail.com>
*/
#ifndef H_ETNAVIV_SURFACE
#define H_ETNAVIV_SURFACE
#include "etnaviv_resource.h"
#include "etnaviv_rs.h"
#include "etnaviv_tiling.h"
#include "pipe/p_state.h"
struct etna_surface {
struct pipe_surface base;
/* Keep pointer to resource level, for fast clear */
struct etna_resource_level *level;
/* keep pointer to original resource (for when a render compatible resource is used) */
struct pipe_resource *prsc;
};
static inline struct etna_surface *
etna_surface(struct pipe_surface *p)
{
return (struct etna_surface *)p;
}
void
etna_surface_init(struct pipe_context *pctx);
#endif

View file

@ -67,8 +67,6 @@ files_etnaviv = files(
'etnaviv_shader.h',
'etnaviv_state.c',
'etnaviv_state.h',
'etnaviv_surface.c',
'etnaviv_surface.h',
'etnaviv_texture.c',
'etnaviv_texture.h',
'etnaviv_texture_desc.c',