radeonsi: move si_upload_const_buffer to a better place
authorMarek Olšák <marek.olsak@amd.com>
Wed, 22 Jan 2014 02:08:50 +0000 (03:08 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 28 Jan 2014 00:39:59 +0000 (01:39 +0100)
This gets rid of another file.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
src/gallium/drivers/radeonsi/Makefile.sources
src/gallium/drivers/radeonsi/si_buffer.c [deleted file]
src/gallium/drivers/radeonsi/si_descriptors.c
src/gallium/drivers/radeonsi/si_resource.h
src/gallium/drivers/radeonsi/si_state.h

index 4e1f9712efc68a413ccc4166943a7e720b4d0ddb..11b3319ac72d7ca8570162e38c92206bc23397a8 100644 (file)
@@ -1,6 +1,5 @@
 C_SOURCES := \
        si_blit.c \
-       si_buffer.c \
        si_commands.c \
        si_compute.c \
        si_descriptors.c \
diff --git a/src/gallium/drivers/radeonsi/si_buffer.c b/src/gallium/drivers/radeonsi/si_buffer.c
deleted file mode 100644 (file)
index 7994405..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2010 Jerome Glisse <glisse@freedesktop.org>
- *
- * 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
- * on 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 AUTHOR(S) AND/OR THEIR SUPPLIERS 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:
- *      Jerome Glisse
- *      Corbin Simpson <MostAwesomeDude@gmail.com>
- */
-
-#include "pipe/p_screen.h"
-#include "util/u_format.h"
-#include "util/u_math.h"
-#include "util/u_inlines.h"
-#include "util/u_memory.h"
-#include "util/u_upload_mgr.h"
-
-#include "si.h"
-#include "si_pipe.h"
-
-void si_upload_const_buffer(struct si_context *sctx, struct r600_resource **rbuffer,
-                       const uint8_t *ptr, unsigned size,
-                       uint32_t *const_offset)
-{
-       if (SI_BIG_ENDIAN) {
-               uint32_t *tmpPtr;
-               unsigned i;
-
-               if (!(tmpPtr = malloc(size))) {
-                       R600_ERR("Failed to allocate BE swap buffer.\n");
-                       return;
-               }
-
-               for (i = 0; i < size / 4; ++i) {
-                       tmpPtr[i] = util_bswap32(((uint32_t *)ptr)[i]);
-               }
-
-               u_upload_data(sctx->b.uploader, 0, size, tmpPtr, const_offset,
-                               (struct pipe_resource**)rbuffer);
-
-               free(tmpPtr);
-       } else {
-               u_upload_data(sctx->b.uploader, 0, size, ptr, const_offset,
-                                       (struct pipe_resource**)rbuffer);
-       }
-}
index e64799d904a2de17af6c9818a55f1464d57a8355..f29d8bb3f1d2d23f183cf8b043d634bec0f71c06 100644 (file)
@@ -29,6 +29,7 @@
 #include "si_shader.h"
 
 #include "util/u_memory.h"
+#include "util/u_upload_mgr.h"
 
 #define SI_NUM_CONTEXTS 16
 
@@ -400,6 +401,32 @@ static void si_buffer_resources_begin_new_cs(struct si_context *sctx,
 
 /* CONSTANT BUFFERS */
 
+void si_upload_const_buffer(struct si_context *sctx, struct r600_resource **rbuffer,
+                           const uint8_t *ptr, unsigned size, uint32_t *const_offset)
+{
+       if (SI_BIG_ENDIAN) {
+               uint32_t *tmpPtr;
+               unsigned i;
+
+               if (!(tmpPtr = malloc(size))) {
+                       R600_ERR("Failed to allocate BE swap buffer.\n");
+                       return;
+               }
+
+               for (i = 0; i < size / 4; ++i) {
+                       tmpPtr[i] = util_bswap32(((uint32_t *)ptr)[i]);
+               }
+
+               u_upload_data(sctx->b.uploader, 0, size, tmpPtr, const_offset,
+                               (struct pipe_resource**)rbuffer);
+
+               free(tmpPtr);
+       } else {
+               u_upload_data(sctx->b.uploader, 0, size, ptr, const_offset,
+                                       (struct pipe_resource**)rbuffer);
+       }
+}
+
 static void si_set_constant_buffer(struct pipe_context *ctx, uint shader, uint slot,
                                   struct pipe_constant_buffer *input)
 {
index a76419c7b2b73cba37b440edacb4236f9c8d541b..37312864d06cf5e117f8b67c7f8ca1e0ae9d6eeb 100644 (file)
@@ -44,10 +44,4 @@ struct si_surface {
        struct pipe_surface             base;
 };
 
-struct si_context;
-
-void si_upload_const_buffer(struct si_context *sctx, struct r600_resource **rbuffer,
-                           const uint8_t *ptr, unsigned size,
-                           uint32_t *const_offset);
-
 #endif
index 3fe3cb80538a1082f08e1fe4d1b82c3487d543fe..a4073d825749b73e2d47468b7acf92c46345846a 100644 (file)
@@ -199,6 +199,8 @@ void si_all_descriptors_begin_new_cs(struct si_context *sctx);
 void si_copy_buffer(struct si_context *sctx,
                    struct pipe_resource *dst, struct pipe_resource *src,
                    uint64_t dst_offset, uint64_t src_offset, unsigned size);
+void si_upload_const_buffer(struct si_context *sctx, struct r600_resource **rbuffer,
+                           const uint8_t *ptr, unsigned size, uint32_t *const_offset);
 
 /* si_state.c */
 struct si_pipe_shader_selector;