diff --git a/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c b/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c index 559003ca2f5..233c658e31e 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c +++ b/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c @@ -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" diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.c b/src/gallium/drivers/etnaviv/etnaviv_context.c index fe1e8d8fc68..2b0ad59857d 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_context.c +++ b/src/gallium/drivers/etnaviv/etnaviv_context.c @@ -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); diff --git a/src/gallium/drivers/etnaviv/etnaviv_surface.c b/src/gallium/drivers/etnaviv/etnaviv_surface.c deleted file mode 100644 index 841d2e6f942..00000000000 --- a/src/gallium/drivers/etnaviv/etnaviv_surface.c +++ /dev/null @@ -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 - */ - -#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; -} diff --git a/src/gallium/drivers/etnaviv/etnaviv_surface.h b/src/gallium/drivers/etnaviv/etnaviv_surface.h deleted file mode 100644 index 0557572ee68..00000000000 --- a/src/gallium/drivers/etnaviv/etnaviv_surface.h +++ /dev/null @@ -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 - */ - -#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 diff --git a/src/gallium/drivers/etnaviv/meson.build b/src/gallium/drivers/etnaviv/meson.build index 8cc971a36e4..c140897b78d 100644 --- a/src/gallium/drivers/etnaviv/meson.build +++ b/src/gallium/drivers/etnaviv/meson.build @@ -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',