From 9effc49569edde6528c30d1a8d10018012c8c6c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 5 May 2021 14:25:20 -0400 Subject: [PATCH] gallium: remove u_resource_vtbl::resource_destroy Reviewed-By: Mike Blumenkrantz Acked-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/auxiliary/util/u_transfer.c | 7 ------- src/gallium/auxiliary/util/u_transfer.h | 6 ------ src/gallium/drivers/i915/i915_resource_buffer.c | 1 - src/gallium/drivers/i915/i915_resource_texture.c | 1 - src/gallium/drivers/nouveau/nouveau_buffer.c | 2 -- src/gallium/drivers/nouveau/nv30/nv30_miptree.c | 1 - src/gallium/drivers/nouveau/nv50/nv50_miptree.c | 1 - src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c | 1 - src/gallium/drivers/r300/r300_screen_buffer.c | 1 - src/gallium/drivers/r300/r300_texture.c | 1 - src/gallium/drivers/r600/evergreen_compute.c | 1 - src/gallium/drivers/r600/r600_buffer_common.c | 1 - src/gallium/drivers/r600/r600_texture.c | 1 - src/gallium/drivers/radeonsi/si_buffer.c | 1 - src/gallium/drivers/radeonsi/si_texture.c | 2 -- src/gallium/drivers/svga/svga_resource_buffer.c | 1 - src/gallium/drivers/svga/svga_resource_texture.c | 1 - src/gallium/drivers/vc4/vc4_resource.c | 1 - src/gallium/drivers/virgl/virgl_buffer.c | 1 - src/gallium/drivers/virgl/virgl_texture.c | 1 - 20 files changed, 33 deletions(-) diff --git a/src/gallium/auxiliary/util/u_transfer.c b/src/gallium/auxiliary/util/u_transfer.c index 9d080e82638..d0354d5e766 100644 --- a/src/gallium/auxiliary/util/u_transfer.c +++ b/src/gallium/auxiliary/util/u_transfer.c @@ -98,13 +98,6 @@ u_resource( struct pipe_resource *res ) return (struct u_resource *)res; } -void u_resource_destroy_vtbl(struct pipe_screen *screen, - struct pipe_resource *resource) -{ - struct u_resource *ur = u_resource(resource); - ur->vtbl->resource_destroy(screen, resource); -} - void *u_transfer_map_vtbl(struct pipe_context *context, struct pipe_resource *resource, unsigned level, diff --git a/src/gallium/auxiliary/util/u_transfer.h b/src/gallium/auxiliary/util/u_transfer.h index 359c75b44f2..d73ad5f98c1 100644 --- a/src/gallium/auxiliary/util/u_transfer.h +++ b/src/gallium/auxiliary/util/u_transfer.h @@ -36,9 +36,6 @@ void u_default_transfer_flush_region( struct pipe_context *pipe, * to exist in a single driver. This is intended to be transitionary! */ struct u_resource_vtbl { - void (*resource_destroy)(struct pipe_screen *, - struct pipe_resource *pt); - void *(*transfer_map)(struct pipe_context *, struct pipe_resource *resource, unsigned level, @@ -57,9 +54,6 @@ struct u_resource { }; -void u_resource_destroy_vtbl(struct pipe_screen *screen, - struct pipe_resource *resource); - void *u_transfer_map_vtbl(struct pipe_context *context, struct pipe_resource *resource, unsigned level, diff --git a/src/gallium/drivers/i915/i915_resource_buffer.c b/src/gallium/drivers/i915/i915_resource_buffer.c index 1999b615d54..1840a96652d 100644 --- a/src/gallium/drivers/i915/i915_resource_buffer.c +++ b/src/gallium/drivers/i915/i915_resource_buffer.c @@ -112,7 +112,6 @@ i915_buffer_subdata(struct pipe_context *rm_ctx, struct u_resource_vtbl i915_buffer_vtbl = { - NULL, i915_buffer_transfer_map, /* transfer_map */ i915_buffer_transfer_unmap, /* transfer_unmap */ }; diff --git a/src/gallium/drivers/i915/i915_resource_texture.c b/src/gallium/drivers/i915/i915_resource_texture.c index c4f5ea6c1fd..9274941dea7 100644 --- a/src/gallium/drivers/i915/i915_resource_texture.c +++ b/src/gallium/drivers/i915/i915_resource_texture.c @@ -895,7 +895,6 @@ out: struct u_resource_vtbl i915_texture_vtbl = { - NULL, /* resource_destroy */ i915_texture_transfer_map, /* transfer_map */ i915_texture_transfer_unmap, /* transfer_unmap */ }; diff --git a/src/gallium/drivers/nouveau/nouveau_buffer.c b/src/gallium/drivers/nouveau/nouveau_buffer.c index df99d0f4252..7b320c1a1e5 100644 --- a/src/gallium/drivers/nouveau/nouveau_buffer.c +++ b/src/gallium/drivers/nouveau/nouveau_buffer.c @@ -635,7 +635,6 @@ nouveau_resource_map_offset(struct nouveau_context *nv, const struct u_resource_vtbl nouveau_buffer_vtbl = { - NULL, /* resource_destroy */ nouveau_buffer_transfer_map, /* transfer_map */ nouveau_buffer_transfer_unmap, /* transfer_unmap */ }; @@ -665,7 +664,6 @@ nouveau_user_ptr_transfer_unmap(struct pipe_context *pipe, const struct u_resource_vtbl nouveau_user_ptr_buffer_vtbl = { - NULL, /* resource_destroy */ nouveau_user_ptr_transfer_map, /* transfer_map */ nouveau_user_ptr_transfer_unmap, /* transfer_unmap */ }; diff --git a/src/gallium/drivers/nouveau/nv30/nv30_miptree.c b/src/gallium/drivers/nouveau/nv30/nv30_miptree.c index 587d4b3bb6b..6f2ce94edc0 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_miptree.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_miptree.c @@ -403,7 +403,6 @@ nv30_miptree_transfer_unmap(struct pipe_context *pipe, } const struct u_resource_vtbl nv30_miptree_vtbl = { - NULL, nv30_miptree_transfer_map, nv30_miptree_transfer_unmap, }; diff --git a/src/gallium/drivers/nouveau/nv50/nv50_miptree.c b/src/gallium/drivers/nouveau/nv50/nv50_miptree.c index fba67182055..94661412037 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_miptree.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_miptree.c @@ -204,7 +204,6 @@ nv50_miptree_get_handle(struct pipe_screen *pscreen, const struct u_resource_vtbl nv50_miptree_vtbl = { - NULL, /* resource_destroy */ nv50_miptree_transfer_map, /* transfer_map */ nv50_miptree_transfer_unmap, /* transfer_unmap */ }; diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c b/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c index 8dc912dd934..5f70c48a68a 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c @@ -438,7 +438,6 @@ nvc0_miptree_select_best_modifier(struct pipe_screen *pscreen, const struct u_resource_vtbl nvc0_miptree_vtbl = { - NULL, /* resource_destroy */ nvc0_miptree_transfer_map, /* transfer_map */ nvc0_miptree_transfer_unmap, /* transfer_unmap */ }; diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c index 7f6c15a7cb6..5a03d1767d9 100644 --- a/src/gallium/drivers/r300/r300_screen_buffer.c +++ b/src/gallium/drivers/r300/r300_screen_buffer.c @@ -163,7 +163,6 @@ static void r300_buffer_transfer_unmap( struct pipe_context *pipe, static const struct u_resource_vtbl r300_buffer_vtbl = { - NULL, /* resource_destroy */ r300_buffer_transfer_map, /* transfer_map */ r300_buffer_transfer_unmap, /* transfer_unmap */ }; diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 626856c3b5f..d58934663d5 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -1042,7 +1042,6 @@ bool r300_resource_get_handle(struct pipe_screen* screen, static const struct u_resource_vtbl r300_texture_vtbl = { - NULL, /* resource_destroy */ r300_texture_transfer_map, /* transfer_map */ r300_texture_transfer_unmap, /* transfer_unmap */ }; diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c index 99f33e6be10..80c0334956c 100644 --- a/src/gallium/drivers/r600/evergreen_compute.c +++ b/src/gallium/drivers/r600/evergreen_compute.c @@ -1317,7 +1317,6 @@ void r600_compute_global_buffer_destroy(struct pipe_screen *screen, static const struct u_resource_vtbl r600_global_buffer_vtbl = { - NULL, /* resource_destroy */ r600_compute_global_transfer_map, /* transfer_map */ r600_compute_global_transfer_unmap, /* transfer_unmap */ }; diff --git a/src/gallium/drivers/r600/r600_buffer_common.c b/src/gallium/drivers/r600/r600_buffer_common.c index 148dfeedd5b..1b35d737f44 100644 --- a/src/gallium/drivers/r600/r600_buffer_common.c +++ b/src/gallium/drivers/r600/r600_buffer_common.c @@ -563,7 +563,6 @@ void r600_buffer_subdata(struct pipe_context *ctx, static const struct u_resource_vtbl r600_buffer_vtbl = { - NULL, /* resource_destroy */ r600_buffer_transfer_map, /* transfer_map */ r600_buffer_transfer_unmap, /* transfer_unmap */ }; diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c index bd8ab3d96bb..0f4acf50845 100644 --- a/src/gallium/drivers/r600/r600_texture.c +++ b/src/gallium/drivers/r600/r600_texture.c @@ -1520,7 +1520,6 @@ static void r600_texture_transfer_unmap(struct pipe_context *ctx, static const struct u_resource_vtbl r600_texture_vtbl = { - NULL, /* resource_destroy */ r600_texture_transfer_map, /* transfer_map */ r600_texture_transfer_unmap, /* transfer_unmap */ }; diff --git a/src/gallium/drivers/radeonsi/si_buffer.c b/src/gallium/drivers/radeonsi/si_buffer.c index b351353a4e9..d2255d532c3 100644 --- a/src/gallium/drivers/radeonsi/si_buffer.c +++ b/src/gallium/drivers/radeonsi/si_buffer.c @@ -569,7 +569,6 @@ static void si_buffer_subdata(struct pipe_context *ctx, struct pipe_resource *bu } static const struct u_resource_vtbl si_buffer_vtbl = { - NULL, /* resource_destroy */ si_buffer_transfer_map, /* transfer_map */ si_buffer_transfer_unmap, /* transfer_unmap */ }; diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index 696cbbc11ff..4bdfffddef2 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -1432,7 +1432,6 @@ si_texture_create_with_modifiers(struct pipe_screen *screen, } static const struct u_resource_vtbl si_auxiliary_texture_vtbl = { - NULL, /* resource_destroy */ NULL, /* transfer_map */ NULL, /* transfer_unmap */ }; @@ -1919,7 +1918,6 @@ static void si_texture_transfer_unmap(struct pipe_context *ctx, struct pipe_tran } static const struct u_resource_vtbl si_texture_vtbl = { - NULL, /* resource_destroy */ si_texture_transfer_map, /* transfer_map */ si_texture_transfer_unmap, /* transfer_unmap */ }; diff --git a/src/gallium/drivers/svga/svga_resource_buffer.c b/src/gallium/drivers/svga/svga_resource_buffer.c index bac4d3637ab..f04edbb971a 100644 --- a/src/gallium/drivers/svga/svga_resource_buffer.c +++ b/src/gallium/drivers/svga/svga_resource_buffer.c @@ -456,7 +456,6 @@ svga_resource_destroy(struct pipe_screen *screen, struct u_resource_vtbl svga_buffer_vtbl = { - NULL, /* resource_destroy */ svga_buffer_transfer_map, /* transfer_map */ svga_buffer_transfer_unmap, /* transfer_unmap */ }; diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c index 4eb8439f246..0bedea84a17 100644 --- a/src/gallium/drivers/svga/svga_resource_texture.c +++ b/src/gallium/drivers/svga/svga_resource_texture.c @@ -843,7 +843,6 @@ format_has_depth(enum pipe_format format) struct u_resource_vtbl svga_texture_vtbl = { - NULL, /* resource_destroy */ svga_texture_transfer_map, /* transfer_map */ svga_texture_transfer_unmap, /* transfer_unmap */ }; diff --git a/src/gallium/drivers/vc4/vc4_resource.c b/src/gallium/drivers/vc4/vc4_resource.c index 61e5fd7e5a6..ca4be44fef5 100644 --- a/src/gallium/drivers/vc4/vc4_resource.c +++ b/src/gallium/drivers/vc4/vc4_resource.c @@ -1121,7 +1121,6 @@ vc4_resource_screen_init(struct pipe_screen *pscreen) pscreen->resource_create_with_modifiers = vc4_resource_create_with_modifiers; pscreen->resource_from_handle = vc4_resource_from_handle; - pscreen->resource_destroy = u_resource_destroy_vtbl; pscreen->resource_get_handle = vc4_resource_get_handle; pscreen->resource_destroy = vc4_resource_destroy; pscreen->transfer_helper = u_transfer_helper_create(&transfer_vtbl, diff --git a/src/gallium/drivers/virgl/virgl_buffer.c b/src/gallium/drivers/virgl/virgl_buffer.c index a18dfd39e5a..f039bbdb7ca 100644 --- a/src/gallium/drivers/virgl/virgl_buffer.c +++ b/src/gallium/drivers/virgl/virgl_buffer.c @@ -78,7 +78,6 @@ void virgl_buffer_transfer_flush_region(struct pipe_context *ctx, static const struct u_resource_vtbl virgl_buffer_vtbl = { - NULL, /* resource_destroy */ virgl_resource_transfer_map, /* transfer_map */ virgl_buffer_transfer_unmap, /* transfer_unmap */ }; diff --git a/src/gallium/drivers/virgl/virgl_texture.c b/src/gallium/drivers/virgl/virgl_texture.c index f907962488b..15b6274d263 100644 --- a/src/gallium/drivers/virgl/virgl_texture.c +++ b/src/gallium/drivers/virgl/virgl_texture.c @@ -304,7 +304,6 @@ static void virgl_texture_transfer_unmap(struct pipe_context *ctx, static const struct u_resource_vtbl virgl_texture_vtbl = { - NULL, /* resource_destroy */ virgl_texture_transfer_map, /* transfer_map */ virgl_texture_transfer_unmap, /* transfer_unmap */ };