radeonsi: remove r600_emit_reloc
authorMarek Olšák <marek.olsak@amd.com>
Sat, 7 Oct 2017 21:08:33 +0000 (23:08 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 9 Oct 2017 14:27:02 +0000 (16:27 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeon/r600_cs.h
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/drivers/radeon/r600_query.c
src/gallium/drivers/radeonsi/si_state_streamout.c

index 28bdf15b8ad046b26c29955795552fb332a1e036..b4af5a6b633800ff68d22d3ff3e921ec393c158a 100644 (file)
@@ -113,21 +113,6 @@ radeon_add_to_buffer_list_check_mem(struct r600_common_context *rctx,
        return radeon_add_to_buffer_list(rctx, ring, rbo, usage, priority);
 }
 
-static inline void r600_emit_reloc(struct r600_common_context *rctx,
-                                  struct r600_ring *ring, struct r600_resource *rbo,
-                                  enum radeon_bo_usage usage,
-                                  enum radeon_bo_priority priority)
-{
-       struct radeon_winsys_cs *cs = ring->cs;
-       bool has_vm = ((struct r600_common_screen*)rctx->b.screen)->info.has_virtual_memory;
-       unsigned reloc = radeon_add_to_buffer_list(rctx, ring, rbo, usage, priority);
-
-       if (!has_vm) {
-               radeon_emit(cs, PKT3(PKT3_NOP, 0, 0));
-               radeon_emit(cs, reloc);
-       }
-}
-
 static inline void radeon_set_config_reg_seq(struct radeon_winsys_cs *cs, unsigned reg, unsigned num)
 {
        assert(reg < R600_CONTEXT_REG_OFFSET);
index a6008a17d9c47f6d56d2b3b93093f7feae1db4d6..262476fc1bb7cdeb2781d86be13124eb8da05c7b 100644 (file)
@@ -169,9 +169,10 @@ void si_gfx_write_event_eop(struct r600_common_context *ctx,
                radeon_emit(cs, 0); /* unused */
        }
 
-       if (buf)
-               r600_emit_reloc(ctx, &ctx->gfx, buf, RADEON_USAGE_WRITE,
-                               RADEON_PRIO_QUERY);
+       if (buf) {
+               radeon_add_to_buffer_list(ctx, &ctx->gfx, buf, RADEON_USAGE_WRITE,
+                                         RADEON_PRIO_QUERY);
+       }
 }
 
 unsigned si_gfx_write_fence_dwords(struct r600_common_screen *screen)
index 3abfe1ebdb8d903ae803c5a4d55264e10bc6ad0b..e4dbb1d8690bb4c275a0de3d88f8237679d83375 100644 (file)
@@ -791,8 +791,8 @@ static void r600_query_hw_do_emit_start(struct r600_common_context *ctx,
        default:
                assert(0);
        }
-       r600_emit_reloc(ctx, &ctx->gfx, query->buffer.buf, RADEON_USAGE_WRITE,
-                       RADEON_PRIO_QUERY);
+       radeon_add_to_buffer_list(ctx, &ctx->gfx, query->buffer.buf, RADEON_USAGE_WRITE,
+                                 RADEON_PRIO_QUERY);
 }
 
 static void r600_query_hw_emit_start(struct r600_common_context *ctx,
@@ -884,8 +884,8 @@ static void r600_query_hw_do_emit_stop(struct r600_common_context *ctx,
        default:
                assert(0);
        }
-       r600_emit_reloc(ctx, &ctx->gfx, query->buffer.buf, RADEON_USAGE_WRITE,
-                       RADEON_PRIO_QUERY);
+       radeon_add_to_buffer_list(ctx, &ctx->gfx, query->buffer.buf, RADEON_USAGE_WRITE,
+                                 RADEON_PRIO_QUERY);
 
        if (fence_va)
                si_gfx_write_event_eop(ctx, EVENT_TYPE_BOTTOM_OF_PIPE_TS, 0,
@@ -937,8 +937,8 @@ static void emit_set_predicate(struct r600_common_context *ctx,
                radeon_emit(cs, va);
                radeon_emit(cs, op | ((va >> 32) & 0xFF));
        }
-       r600_emit_reloc(ctx, &ctx->gfx, buf, RADEON_USAGE_READ,
-                       RADEON_PRIO_QUERY);
+       radeon_add_to_buffer_list(ctx, &ctx->gfx, buf, RADEON_USAGE_READ,
+                                 RADEON_PRIO_QUERY);
 }
 
 static void r600_emit_query_predication(struct r600_common_context *ctx,
index 35fbceabd685dabb4cc31a96573df67bc7e1026f..f4fcf70e342566a31b0b44508b08b6d107a41929 100644 (file)
@@ -295,8 +295,10 @@ static void si_emit_streamout_begin(struct r600_common_context *rctx, struct r60
                        radeon_emit(cs, va); /* src address lo */
                        radeon_emit(cs, va >> 32); /* src address hi */
 
-                       r600_emit_reloc(&sctx->b,  &sctx->b.gfx, t[i]->buf_filled_size,
-                                       RADEON_USAGE_READ, RADEON_PRIO_SO_FILLED_SIZE);
+                       radeon_add_to_buffer_list(&sctx->b,  &sctx->b.gfx,
+                                                 t[i]->buf_filled_size,
+                                                 RADEON_USAGE_READ,
+                                                 RADEON_PRIO_SO_FILLED_SIZE);
                } else {
                        /* Start from the beginning. */
                        radeon_emit(cs, PKT3(PKT3_STRMOUT_BUFFER_UPDATE, 4, 0));
@@ -335,8 +337,10 @@ void si_emit_streamout_end(struct si_context *sctx)
                radeon_emit(cs, 0); /* unused */
                radeon_emit(cs, 0); /* unused */
 
-               r600_emit_reloc(&sctx->b,  &sctx->b.gfx, t[i]->buf_filled_size,
-                               RADEON_USAGE_WRITE, RADEON_PRIO_SO_FILLED_SIZE);
+               radeon_add_to_buffer_list(&sctx->b,  &sctx->b.gfx,
+                                         t[i]->buf_filled_size,
+                                         RADEON_USAGE_WRITE,
+                                         RADEON_PRIO_SO_FILLED_SIZE);
 
                /* Zero the buffer size. The counters (primitives generated,
                 * primitives emitted) may be enabled even if there is not