gallium/radeon: use TCC line size as alignment in other places
authorMarek Olšák <marek.olsak@amd.com>
Wed, 15 Feb 2017 17:49:11 +0000 (18:49 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 18 Feb 2017 00:22:08 +0000 (01:22 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeon/r600_buffer_common.c
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/drivers/radeonsi/si_compute.c
src/gallium/drivers/radeonsi/si_descriptors.c

index 9e5a8a6dff88dadc9c45713b475e2e1a9a1a86f0..e37e36f3b450a53eff250b8f483656409bf65728 100644 (file)
@@ -369,7 +369,8 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
 
                        u_upload_alloc(ctx->stream_uploader, 0,
                                        box->width + (box->x % R600_MAP_BUFFER_ALIGNMENT),
-                                      256, &offset, (struct pipe_resource**)&staging,
+                                      rctx->screen->info.tcc_cache_line_size,
+                                      &offset, (struct pipe_resource**)&staging,
                                        (void**)&data);
 
                        if (staging) {
index 8405c5e80f93722214974b5377b6e60ecf9fb598..d573b39d7c06c661471e1277ea961e1f55edc196 100644 (file)
@@ -193,7 +193,8 @@ void r600_draw_rectangle(struct blitter_context *blitter,
        /* Upload vertices. The hw rectangle has only 3 vertices,
         * I guess the 4th one is derived from the first 3.
         * The vertex specification should match u_blitter's vertex element state. */
-       u_upload_alloc(rctx->b.stream_uploader, 0, sizeof(float) * 24, 256,
+       u_upload_alloc(rctx->b.stream_uploader, 0, sizeof(float) * 24,
+                      rctx->screen->info.tcc_cache_line_size,
                        &offset, &buf, (void**)&vb);
        if (!buf)
                return;
index aae651c4f625b086386a8dbdf1c7e13c207e130d..381837c8a57b9a902f9885903033fd10d5b586ad 100644 (file)
@@ -565,7 +565,8 @@ static void si_upload_compute_input(struct si_context *sctx,
        /* The extra num_work_size_bytes are for work group / work item size information */
        kernel_args_size = program->input_size + num_work_size_bytes;
 
-       u_upload_alloc(sctx->b.b.stream_uploader, 0, kernel_args_size, 256,
+       u_upload_alloc(sctx->b.b.stream_uploader, 0, kernel_args_size,
+                      sctx->screen->b.info.tcc_cache_line_size,
                       &kernel_args_offset,
                       (struct pipe_resource**)&input_buffer, &kernel_args_ptr);
 
index 4f2dbbb37c4a067a754c1f8bf44e4f6a88efa78e..b4f1fbfb2131b06f4f6e884acc8b0c5b7ac2f617 100644 (file)
@@ -137,8 +137,9 @@ static bool si_ce_upload(struct si_context *sctx, unsigned ce_offset, unsigned s
                         unsigned *out_offset, struct r600_resource **out_buf) {
        uint64_t va;
 
-       u_suballocator_alloc(sctx->ce_suballocator, size, 64, out_offset,
-                            (struct pipe_resource**)out_buf);
+       u_suballocator_alloc(sctx->ce_suballocator, size,
+                            sctx->screen->b.info.tcc_cache_line_size,
+                            out_offset, (struct pipe_resource**)out_buf);
        if (!out_buf)
                        return false;