radeonsi: remove si_create_surface_custom
authorMarek Olšák <marek.olsak@amd.com>
Mon, 25 Apr 2022 07:54:49 +0000 (03:54 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 3 May 2022 15:11:08 +0000 (11:11 -0400)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16215>

src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_texture.c

index e389110..a80e1f6 100644 (file)
@@ -1579,10 +1579,6 @@ bool vi_dcc_formats_are_incompatible(struct pipe_resource *tex, unsigned level,
                                      enum pipe_format view_format);
 void vi_disable_dcc_if_incompatible_format(struct si_context *sctx, struct pipe_resource *tex,
                                            unsigned level, enum pipe_format view_format);
-struct pipe_surface *si_create_surface_custom(struct pipe_context *pipe,
-                                              struct pipe_resource *texture,
-                                              const struct pipe_surface *templ, unsigned width0,
-                                              unsigned height0, unsigned width, unsigned height);
 unsigned si_translate_colorswap(enum chip_class chip_class, enum pipe_format format,
                                 bool do_endian_swap);
 bool si_texture_disable_dcc(struct si_context *sctx, struct si_texture *tex);
index 5149558..eda37fb 100644 (file)
@@ -2061,36 +2061,6 @@ void vi_disable_dcc_if_incompatible_format(struct si_context *sctx, struct pipe_
          si_decompress_dcc(sctx, stex);
 }
 
-struct pipe_surface *si_create_surface_custom(struct pipe_context *pipe,
-                                              struct pipe_resource *texture,
-                                              const struct pipe_surface *templ, unsigned width0,
-                                              unsigned height0, unsigned width, unsigned height)
-{
-   struct si_surface *surface = CALLOC_STRUCT(si_surface);
-
-   if (!surface)
-      return NULL;
-
-   assert(templ->u.tex.first_layer <= util_max_layer(texture, templ->u.tex.level));
-   assert(templ->u.tex.last_layer <= util_max_layer(texture, templ->u.tex.level));
-
-   pipe_reference_init(&surface->base.reference, 1);
-   pipe_resource_reference(&surface->base.texture, texture);
-   surface->base.context = pipe;
-   surface->base.format = templ->format;
-   surface->base.width = width;
-   surface->base.height = height;
-   surface->base.u = templ->u;
-
-   surface->width0 = width0;
-   surface->height0 = height0;
-
-   surface->dcc_incompatible =
-      texture->target != PIPE_BUFFER &&
-      vi_dcc_formats_are_incompatible(texture, templ->u.tex.level, templ->format);
-   return &surface->base;
-}
-
 static struct pipe_surface *si_create_surface(struct pipe_context *pipe, struct pipe_resource *tex,
                                               const struct pipe_surface *templ)
 {
@@ -2121,7 +2091,29 @@ static struct pipe_surface *si_create_surface(struct pipe_context *pipe, struct
       }
    }
 
-   return si_create_surface_custom(pipe, tex, templ, width0, height0, width, height);
+   struct si_surface *surface = CALLOC_STRUCT(si_surface);
+
+   if (!surface)
+      return NULL;
+
+   assert(templ->u.tex.first_layer <= util_max_layer(tex, templ->u.tex.level));
+   assert(templ->u.tex.last_layer <= util_max_layer(tex, templ->u.tex.level));
+
+   pipe_reference_init(&surface->base.reference, 1);
+   pipe_resource_reference(&surface->base.texture, tex);
+   surface->base.context = pipe;
+   surface->base.format = templ->format;
+   surface->base.width = width;
+   surface->base.height = height;
+   surface->base.u = templ->u;
+
+   surface->width0 = width0;
+   surface->height0 = height0;
+
+   surface->dcc_incompatible =
+      tex->target != PIPE_BUFFER &&
+      vi_dcc_formats_are_incompatible(tex, templ->u.tex.level, templ->format);
+   return &surface->base;
 }
 
 static void si_surface_destroy(struct pipe_context *pipe, struct pipe_surface *surface)