[Mesa-dev] [PATCH 09/55] radeonsi: remove r600_pipe_common::rebind_buffer

Marek Olšák maraeo at gmail.com
Mon Apr 2 04:08:02 UTC 2018


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/drivers/radeon/r600_buffer_common.c | 3 +--
 src/gallium/drivers/radeon/r600_pipe_common.h   | 6 ------
 src/gallium/drivers/radeonsi/si_descriptors.c   | 8 +++++---
 src/gallium/drivers/radeonsi/si_state.h         | 3 ++-
 4 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c
index a9ae007..d215c9d 100644
--- a/src/gallium/drivers/radeon/r600_buffer_common.c
+++ b/src/gallium/drivers/radeon/r600_buffer_common.c
@@ -288,7 +288,6 @@ void si_replace_buffer_storage(struct pipe_context *ctx,
 				 struct pipe_resource *dst,
 				 struct pipe_resource *src)
 {
-	struct r600_common_context *rctx = (struct r600_common_context *)ctx;
 	struct r600_resource *rdst = r600_resource(dst);
 	struct r600_resource *rsrc = r600_resource(src);
 	uint64_t old_gpu_address = rdst->gpu_address;
@@ -306,7 +305,7 @@ void si_replace_buffer_storage(struct pipe_context *ctx,
 	assert(rdst->bo_alignment == rsrc->bo_alignment);
 	assert(rdst->domains == rsrc->domains);
 
-	rctx->rebind_buffer(ctx, dst, old_gpu_address);
+	si_rebind_buffer(ctx, dst, old_gpu_address);
 }
 
 static void si_invalidate_resource(struct pipe_context *ctx,
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
index 1381a67..241a0b9 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.h
+++ b/src/gallium/drivers/radeon/r600_pipe_common.h
@@ -498,12 +498,6 @@ struct r600_common_context {
 	/* Reallocate the buffer and update all resource bindings where
 	 * the buffer is bound, including all resource descriptors. */
 	void (*invalidate_buffer)(struct pipe_context *ctx, struct pipe_resource *buf);
-
-	/* Update all resource bindings where the buffer is bound, including
-	 * all resource descriptors. This is invalidate_buffer without
-	 * the invalidation. */
-	void (*rebind_buffer)(struct pipe_context *ctx, struct pipe_resource *buf,
-			      uint64_t old_gpu_address);
 };
 
 /* r600_buffer_common.c */
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index 07d1420..6feeb0e 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -1538,8 +1538,11 @@ static void si_reset_buffer_resources(struct si_context *sctx,
 	}
 }
 
-static void si_rebind_buffer(struct pipe_context *ctx, struct pipe_resource *buf,
-			     uint64_t old_va)
+/* Update all resource bindings where the buffer is bound, including
+ * all resource descriptors. This is invalidate_buffer without
+ * the invalidation. */
+void si_rebind_buffer(struct pipe_context *ctx, struct pipe_resource *buf,
+		      uint64_t old_va)
 {
 	struct si_context *sctx = (struct si_context*)ctx;
 	struct r600_resource *rbuffer = r600_resource(buf);
@@ -2711,7 +2714,6 @@ void si_init_all_descriptors(struct si_context *sctx)
 	sctx->b.b.delete_image_handle = si_delete_image_handle;
 	sctx->b.b.make_image_handle_resident = si_make_image_handle_resident;
 	sctx->b.invalidate_buffer = si_invalidate_buffer;
-	sctx->b.rebind_buffer = si_rebind_buffer;
 
 	/* Shader user data. */
 	si_init_atom(sctx, &sctx->shader_pointers.atom, &sctx->atoms.s.shader_pointers,
diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h
index 95dc2d3..443ce1a 100644
--- a/src/gallium/drivers/radeonsi/si_state.h
+++ b/src/gallium/drivers/radeonsi/si_state.h
@@ -362,7 +362,8 @@ struct pb_slab *si_bindless_descriptor_slab_alloc(void *priv, unsigned heap,
 						  unsigned entry_size,
 						  unsigned group_index);
 void si_bindless_descriptor_slab_free(void *priv, struct pb_slab *pslab);
-
+void si_rebind_buffer(struct pipe_context *ctx, struct pipe_resource *buf,
+		      uint64_t old_va);
 /* si_state.c */
 struct si_shader_selector;
 
-- 
2.7.4



More information about the mesa-dev mailing list