radeonsi: remove si_resource_create_custom
authorMarek Olšák <marek.olsak@amd.com>
Mon, 24 Oct 2016 21:29:50 +0000 (23:29 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 26 Oct 2016 11:02:58 +0000 (13:02 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_compute.c
src/gallium/drivers/radeonsi/si_cp_dma.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_state_shaders.c

index e78510619c1901a94f6e6b1ad57a44cb55ba8f92..f1887bb8a55f0259839a915c3eb7443ccc267326 100644 (file)
@@ -276,9 +276,9 @@ static bool si_setup_compute_scratch_buffer(struct si_context *sctx,
        if (scratch_bo_size < scratch_needed) {
                r600_resource_reference(&sctx->compute_scratch_buffer, NULL);
 
-               sctx->compute_scratch_buffer =
-                               si_resource_create_custom(&sctx->screen->b.b,
-                                PIPE_USAGE_DEFAULT, scratch_needed);
+               sctx->compute_scratch_buffer = (struct r600_resource*)
+                       pipe_buffer_create(&sctx->screen->b.b, 0,
+                                          PIPE_USAGE_DEFAULT, scratch_needed);
 
                if (!sctx->compute_scratch_buffer)
                        return false;
index 0e8d1e89cc3267fc5fb278f7fec08e963048e518..6667ae302b403ac07b7ae40505e6d4200875ee6b 100644 (file)
@@ -236,10 +236,9 @@ static void si_cp_dma_realign_engine(struct si_context *sctx, unsigned size)
        if (!sctx->scratch_buffer ||
            sctx->scratch_buffer->b.b.width0 < scratch_size) {
                r600_resource_reference(&sctx->scratch_buffer, NULL);
-               sctx->scratch_buffer =
-                       si_resource_create_custom(&sctx->screen->b.b,
-                                                 PIPE_USAGE_DEFAULT,
-                                                 scratch_size);
+               sctx->scratch_buffer = (struct r600_resource*)
+                       pipe_buffer_create(&sctx->screen->b.b, 0,
+                                          PIPE_USAGE_DEFAULT, scratch_size);
                if (!sctx->scratch_buffer)
                        return;
                sctx->emit_scratch_reloc = true;
index 6b74e496db6491c4583404bf1744309a7e0d9960..0240a3c191decf74f3cc9565a1c9ce2082e956d1 100644 (file)
@@ -401,14 +401,6 @@ struct pipe_video_buffer *si_video_buffer_create(struct pipe_context *pipe,
  * common helpers
  */
 
-static inline struct r600_resource *
-si_resource_create_custom(struct pipe_screen *screen,
-                         unsigned usage, unsigned size)
-{
-       assert(size);
-       return r600_resource(pipe_buffer_create(screen, 0, usage, size));
-}
-
 static inline void
 si_invalidate_draw_sh_constants(struct si_context *sctx)
 {
index 8edd5934234f9786dd3d637dfd9a752fdf6a5f6a..2b8c168a1f0b6e916e3c889e5e006ce5f8f6dbf7 100644 (file)
@@ -5977,9 +5977,9 @@ int si_shader_binary_upload(struct si_screen *sscreen, struct si_shader *shader)
        assert(!epilog || !epilog->rodata_size);
 
        r600_resource_reference(&shader->bo, NULL);
-       shader->bo = si_resource_create_custom(&sscreen->b.b,
-                                              PIPE_USAGE_IMMUTABLE,
-                                              bo_size);
+       shader->bo = (struct r600_resource*)
+                    pipe_buffer_create(&sscreen->b.b, 0,
+                                       PIPE_USAGE_IMMUTABLE, bo_size);
        if (!shader->bo)
                return -ENOMEM;
 
index 3037a04b03c797124aec7de182aedf0472f0f3e3..e4ceb3b8150dc657aea149d43d4251ca4d4fdf1e 100644 (file)
@@ -1905,8 +1905,8 @@ static bool si_update_spi_tmpring_size(struct si_context *sctx)
                        /* Create a bigger scratch buffer */
                        r600_resource_reference(&sctx->scratch_buffer, NULL);
 
-                       sctx->scratch_buffer =
-                                       si_resource_create_custom(&sctx->screen->b.b,
+                       sctx->scratch_buffer = (struct r600_resource*)
+                                       pipe_buffer_create(&sctx->screen->b.b, 0,
                                        PIPE_USAGE_DEFAULT, scratch_needed_size);
                        if (!sctx->scratch_buffer)
                                return false;