radeonsi: rename r600_transfer -> si_transfer
authorMarek Olšák <marek.olsak@amd.com>
Fri, 22 Jun 2018 04:02:47 +0000 (00:02 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 25 Jun 2018 22:33:58 +0000 (18:33 -0400)
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/gallium/drivers/radeonsi/si_buffer.c
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_texture.c

index 5c4ca5aefd25223fb5e2ca5b7b3c501b905499bc..a03a94453a4ea1c018adaaa710418afc50afe8cd 100644 (file)
@@ -341,7 +341,7 @@ static void *si_buffer_get_transfer(struct pipe_context *ctx,
                                    unsigned offset)
 {
        struct si_context *sctx = (struct si_context*)ctx;
-       struct r600_transfer *transfer;
+       struct si_transfer *transfer;
 
        if (usage & TC_TRANSFER_MAP_THREADED_UNSYNC)
                transfer = slab_alloc(&sctx->pool_transfers_unsync);
@@ -517,17 +517,17 @@ static void si_buffer_do_flush_region(struct pipe_context *ctx,
                                      struct pipe_transfer *transfer,
                                      const struct pipe_box *box)
 {
-       struct r600_transfer *rtransfer = (struct r600_transfer*)transfer;
+       struct si_transfer *stransfer = (struct si_transfer*)transfer;
        struct r600_resource *rbuffer = r600_resource(transfer->resource);
 
-       if (rtransfer->staging) {
+       if (stransfer->staging) {
                struct pipe_resource *dst, *src;
                unsigned soffset;
                struct pipe_box dma_box;
 
                dst = transfer->resource;
-               src = &rtransfer->staging->b.b;
-               soffset = rtransfer->offset + box->x % SI_MAP_BUFFER_ALIGNMENT;
+               src = &stransfer->staging->b.b;
+               soffset = stransfer->offset + box->x % SI_MAP_BUFFER_ALIGNMENT;
 
                u_box_1d(soffset, box->width, &dma_box);
 
@@ -558,14 +558,14 @@ static void si_buffer_transfer_unmap(struct pipe_context *ctx,
                                     struct pipe_transfer *transfer)
 {
        struct si_context *sctx = (struct si_context*)ctx;
-       struct r600_transfer *rtransfer = (struct r600_transfer*)transfer;
+       struct si_transfer *stransfer = (struct si_transfer*)transfer;
 
        if (transfer->usage & PIPE_TRANSFER_WRITE &&
            !(transfer->usage & PIPE_TRANSFER_FLUSH_EXPLICIT))
                si_buffer_do_flush_region(ctx, transfer, &transfer->box);
 
-       r600_resource_reference(&rtransfer->staging, NULL);
-       assert(rtransfer->b.staging == NULL); /* for threaded context only */
+       r600_resource_reference(&stransfer->staging, NULL);
+       assert(stransfer->b.staging == NULL); /* for threaded context only */
        pipe_resource_reference(&transfer->resource, NULL);
 
        /* Don't use pool_transfers_unsync. We are always in the driver
index b64c41f4fe65b988f5161d2ba2d6745aa5fd2776..ded8cb5eb0893abc9d4a5fa77201932dbb847051 100644 (file)
@@ -866,7 +866,7 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws,
                ac_print_gpu_info(&sscreen->info);
 
        slab_create_parent(&sscreen->pool_transfers,
-                          sizeof(struct r600_transfer), 64);
+                          sizeof(struct si_transfer), 64);
 
        sscreen->force_aniso = MIN2(16, debug_get_num_option("R600_TEX_ANISO", -1));
        if (sscreen->force_aniso >= 0) {
index 4f18883c6a8e4e0e5d2d40be5e6688d49c72bdea..bd857f8a349464efa91abdab5c41329f9ade0744 100644 (file)
@@ -224,7 +224,7 @@ struct r600_resource {
        unsigned                        external_usage; /* PIPE_HANDLE_USAGE_* */
 };
 
-struct r600_transfer {
+struct si_transfer {
        struct threaded_transfer        b;
        struct r600_resource            *staging;
        unsigned                        offset;
index ac50103a74b021736ca727d0af8345c205cc067c..22114fdb744ee7728d5206cfdcda4f492b0bb07b 100644 (file)
@@ -138,11 +138,11 @@ static void si_copy_region_with_blit(struct pipe_context *pipe,
 }
 
 /* Copy from a full GPU texture to a transfer's staging one. */
-static void si_copy_to_staging_texture(struct pipe_context *ctx, struct r600_transfer *rtransfer)
+static void si_copy_to_staging_texture(struct pipe_context *ctx, struct si_transfer *stransfer)
 {
        struct si_context *sctx = (struct si_context*)ctx;
-       struct pipe_transfer *transfer = (struct pipe_transfer*)rtransfer;
-       struct pipe_resource *dst = &rtransfer->staging->b.b;
+       struct pipe_transfer *transfer = (struct pipe_transfer*)stransfer;
+       struct pipe_resource *dst = &stransfer->staging->b.b;
        struct pipe_resource *src = transfer->resource;
 
        if (src->nr_samples > 1) {
@@ -156,12 +156,12 @@ static void si_copy_to_staging_texture(struct pipe_context *ctx, struct r600_tra
 }
 
 /* Copy from a transfer's staging texture to a full GPU one. */
-static void si_copy_from_staging_texture(struct pipe_context *ctx, struct r600_transfer *rtransfer)
+static void si_copy_from_staging_texture(struct pipe_context *ctx, struct si_transfer *stransfer)
 {
        struct si_context *sctx = (struct si_context*)ctx;
-       struct pipe_transfer *transfer = (struct pipe_transfer*)rtransfer;
+       struct pipe_transfer *transfer = (struct pipe_transfer*)stransfer;
        struct pipe_resource *dst = transfer->resource;
-       struct pipe_resource *src = &rtransfer->staging->b.b;
+       struct pipe_resource *src = &stransfer->staging->b.b;
        struct pipe_box sbox;
 
        u_box_3d(0, 0, 0, transfer->box.width, transfer->box.height, transfer->box.depth, &sbox);
@@ -1650,7 +1650,7 @@ static void *si_texture_transfer_map(struct pipe_context *ctx,
 {
        struct si_context *sctx = (struct si_context*)ctx;
        struct si_texture *tex = (struct si_texture*)texture;
-       struct r600_transfer *trans;
+       struct si_transfer *trans;
        struct r600_resource *buf;
        unsigned offset = 0;
        char *map;
@@ -1707,7 +1707,7 @@ static void *si_texture_transfer_map(struct pipe_context *ctx,
                }
        }
 
-       trans = CALLOC_STRUCT(r600_transfer);
+       trans = CALLOC_STRUCT(si_transfer);
        if (!trans)
                return NULL;
        pipe_resource_reference(&trans->b.b.resource, texture);
@@ -1829,24 +1829,24 @@ static void si_texture_transfer_unmap(struct pipe_context *ctx,
                                      struct pipe_transfer* transfer)
 {
        struct si_context *sctx = (struct si_context*)ctx;
-       struct r600_transfer *rtransfer = (struct r600_transfer*)transfer;
+       struct si_transfer *stransfer = (struct si_transfer*)transfer;
        struct pipe_resource *texture = transfer->resource;
        struct si_texture *tex = (struct si_texture*)texture;
 
-       if ((transfer->usage & PIPE_TRANSFER_WRITE) && rtransfer->staging) {
+       if ((transfer->usage & PIPE_TRANSFER_WRITE) && stransfer->staging) {
                if (tex->is_depth && tex->buffer.b.b.nr_samples <= 1) {
                        ctx->resource_copy_region(ctx, texture, transfer->level,
                                                  transfer->box.x, transfer->box.y, transfer->box.z,
-                                                 &rtransfer->staging->b.b, transfer->level,
+                                                 &stransfer->staging->b.b, transfer->level,
                                                  &transfer->box);
                } else {
-                       si_copy_from_staging_texture(ctx, rtransfer);
+                       si_copy_from_staging_texture(ctx, stransfer);
                }
        }
 
-       if (rtransfer->staging) {
-               sctx->num_alloc_tex_transfer_bytes += rtransfer->staging->buf->size;
-               r600_resource_reference(&rtransfer->staging, NULL);
+       if (stransfer->staging) {
+               sctx->num_alloc_tex_transfer_bytes += stransfer->staging->buf->size;
+               r600_resource_reference(&stransfer->staging, NULL);
        }
 
        /* Heuristic for {upload, draw, upload, draw, ..}: