freedreno: OUT_RELOC vs OUT_RELOCW fixes
authorRob Clark <robclark@freedesktop.org>
Wed, 9 Mar 2016 09:07:51 +0000 (04:07 -0500)
committerRob Clark <robclark@freedesktop.org>
Sun, 13 Mar 2016 16:23:41 +0000 (12:23 -0400)
Make sure we use OUT_RELOCW() in cases where the buffer is written to.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/a3xx/fd3_gmem.c
src/gallium/drivers/freedreno/a4xx/fd4_gmem.c
src/gallium/drivers/freedreno/a4xx/fd4_query.c

index c490f80..815a310 100644 (file)
@@ -1014,8 +1014,8 @@ fd3_emit_tile_renderprep(struct fd_context *ctx, struct fd_tile *tile)
 
 
                OUT_PKT3(ring, CP_SET_BIN_DATA, 2);
-               OUT_RELOC(ring, pipe->bo, 0, 0, 0);    /* BIN_DATA_ADDR <- VSC_PIPE[p].DATA_ADDRESS */
-               OUT_RELOC(ring, fd3_ctx->vsc_size_mem, /* BIN_SIZE_ADDR <- VSC_SIZE_ADDRESS + (p * 4) */
+               OUT_RELOCW(ring, pipe->bo, 0, 0, 0);    /* BIN_DATA_ADDR <- VSC_PIPE[p].DATA_ADDRESS */
+               OUT_RELOCW(ring, fd3_ctx->vsc_size_mem, /* BIN_SIZE_ADDR <- VSC_SIZE_ADDRESS + (p * 4) */
                                (tile->p * 4), 0, 0);
        } else {
                OUT_PKT0(ring, REG_A3XX_PC_VSTREAM_CONTROL, 1);
index ed2307d..0629c30 100644 (file)
@@ -773,8 +773,8 @@ fd4_emit_tile_renderprep(struct fd_context *ctx, struct fd_tile *tile)
                                A4XX_PC_VSTREAM_CONTROL_N(tile->n));
 
                OUT_PKT3(ring, CP_SET_BIN_DATA, 2);
-               OUT_RELOC(ring, pipe->bo, 0, 0, 0);    /* BIN_DATA_ADDR <- VSC_PIPE[p].DATA_ADDRESS */
-               OUT_RELOC(ring, fd4_ctx->vsc_size_mem, /* BIN_SIZE_ADDR <- VSC_SIZE_ADDRESS + (p * 4) */
+               OUT_RELOCW(ring, pipe->bo, 0, 0, 0);    /* BIN_DATA_ADDR <- VSC_PIPE[p].DATA_ADDRESS */
+               OUT_RELOCW(ring, fd4_ctx->vsc_size_mem, /* BIN_SIZE_ADDR <- VSC_SIZE_ADDRESS + (p * 4) */
                                (tile->p * 4), 0, 0);
        } else {
                OUT_PKT0(ring, REG_A4XX_PC_VSTREAM_CONTROL, 1);
index 14a8094..77e203f 100644 (file)
@@ -173,7 +173,7 @@ time_elapsed_get_sample(struct fd_context *ctx, struct fd_ringbuffer *ring)
        OUT_RING(ring, CP_REG_TO_MEM_0_REG(REG_A4XX_RBBM_PERFCTR_CP_0_LO) |
                        CP_REG_TO_MEM_0_64B |
                        CP_REG_TO_MEM_0_CNT(2-1)); /* write 2 regs to mem */
-       OUT_RELOC(ring, scratch_bo, sample_off, 0, 0);
+       OUT_RELOCW(ring, scratch_bo, sample_off, 0, 0);
 
        /* ok... here we really *would* like to use the CP_SET_CONSTANT
         * mode which can add a constant to value in reg2 and write to
@@ -187,7 +187,7 @@ time_elapsed_get_sample(struct fd_context *ctx, struct fd_ringbuffer *ring)
 
        /* per-sample offset to scratch bo: */
        OUT_PKT3(ring, CP_MEM_WRITE, 2);
-       OUT_RELOC(ring, scratch_bo, addr_off, 0, 0);
+       OUT_RELOCW(ring, scratch_bo, addr_off, 0, 0);
        OUT_RING(ring, samp->offset);
 
        /* now add to that the per-tile base: */
@@ -195,7 +195,7 @@ time_elapsed_get_sample(struct fd_context *ctx, struct fd_ringbuffer *ring)
        OUT_RING(ring, CP_REG_TO_MEM_0_REG(HW_QUERY_BASE_REG) |
                        CP_REG_TO_MEM_0_ACCUMULATE |
                        CP_REG_TO_MEM_0_CNT(1-1));       /* readback 1 regs */
-       OUT_RELOC(ring, scratch_bo, addr_off, 0, 0);
+       OUT_RELOCW(ring, scratch_bo, addr_off, 0, 0);
 
        /* now copy that back to CP_ME_NRT_ADDR: */
        OUT_PKT3(ring, CP_MEM_TO_REG, 2);