freedreno: split out WFI helper
authorRob Clark <robclark@freedesktop.org>
Fri, 6 Sep 2013 14:23:14 +0000 (10:23 -0400)
committerRob Clark <robclark@freedesktop.org>
Sat, 14 Sep 2013 17:31:58 +0000 (13:31 -0400)
Mostly just to give an easy debug/instrumentation point.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/a2xx/fd2_draw.c
src/gallium/drivers/freedreno/a2xx/fd2_gmem.c
src/gallium/drivers/freedreno/a3xx/fd3_draw.c
src/gallium/drivers/freedreno/a3xx/fd3_emit.c
src/gallium/drivers/freedreno/freedreno_util.h

index 13945e4a4dda188c66794e25cd697ddab5692fe9..300ce2e51c1cf05c502c084acb5499735ffa7e38 100644 (file)
@@ -101,8 +101,7 @@ fd2_draw(struct fd_context *ctx, const struct pipe_draw_info *info)
        OUT_PKT0(ring, REG_A2XX_TC_CNTL_STATUS, 1);
        OUT_RING(ring, A2XX_TC_CNTL_STATUS_L2_INVALIDATE);
 
-       OUT_PKT3(ring, CP_WAIT_FOR_IDLE, 1);
-       OUT_RING(ring, 0x0000000);
+       OUT_WFI (ring);
 
        OUT_PKT3(ring, CP_SET_CONSTANT, 3);
        OUT_RING(ring, CP_REG(REG_A2XX_VGT_MAX_VTX_INDX));
index d024f2d3c598db26ec9d14121510cd79c3a0a7d1..1fcb76638f3735d4d62b9cfdd14877c56490d88a 100644 (file)
@@ -83,8 +83,7 @@ emit_gmem2mem_surf(struct fd_context *ctx, uint32_t base,
                        A2XX_RB_COPY_DEST_INFO_WRITE_BLUE |
                        A2XX_RB_COPY_DEST_INFO_WRITE_ALPHA);
 
-       OUT_PKT3(ring, CP_WAIT_FOR_IDLE, 1);
-       OUT_RING(ring, 0x0000000);
+       OUT_WFI (ring);
 
        OUT_PKT3(ring, CP_SET_CONSTANT, 3);
        OUT_RING(ring, CP_REG(REG_A2XX_VGT_MAX_VTX_INDX));
index eb4df609a8cabe62c596db9f9e29dfde3704de6c..720a813b8caeb4d9d7f342f39c4829a959424c72 100644 (file)
@@ -80,8 +80,7 @@ fd3_draw(struct fd_context *ctx, const struct pipe_draw_info *info)
        OUT_PKT0(ring, REG_A3XX_PC_VERTEX_REUSE_BLOCK_CNTL, 1);
        OUT_RING(ring, 0x0000000b);                  /* PC_VERTEX_REUSE_BLOCK_CNTL */
 
-       OUT_PKT3(ring, CP_WAIT_FOR_IDLE, 1);
-       OUT_RING(ring, 0x0000000);
+       OUT_WFI (ring);
 
        OUT_PKT0(ring, REG_A3XX_VFD_INDEX_MIN, 4);
        OUT_RING(ring, info->min_index);        /* VFD_INDEX_MIN */
@@ -220,8 +219,7 @@ fd3_clear(struct fd_context *ctx, unsigned buffers,
        fd_draw(ctx, DI_PT_RECTLIST, DI_SRC_SEL_AUTO_INDEX, 2,
                        INDEX_SIZE_IGN, 0, 0, NULL);
 
-       OUT_PKT3(ring, CP_WAIT_FOR_IDLE, 1);
-       OUT_RING(ring, 0x00000000);
+       OUT_WFI (ring);
 }
 
 void
index 66dc4a8d0bfd38b70f4a7b234e6f93bf52ff240d..6b8ea02f6933df919d760083dad2b848b2c5939e 100644 (file)
@@ -244,8 +244,7 @@ emit_cache_flush(struct fd_ringbuffer *ring)
        OUT_RING(ring, 0x00000000);
        OUT_RING(ring, 0x00000000);
 
-       OUT_PKT3(ring, CP_WAIT_FOR_IDLE, 1);
-       OUT_RING(ring, 0x00000000);
+       OUT_WFI (ring);
 }
 
 /* emit texture state for mem->gmem restore operation.. eventually it would
index 76f557d4835e1edf21f2d596878c4549d31ab2cc..047c62f1565848c8b9d45ea2cf0c3cd2d41ecaa5 100644 (file)
@@ -164,6 +164,13 @@ OUT_PKT3(struct fd_ringbuffer *ring, uint8_t opcode, uint16_t cnt)
        OUT_RING(ring, CP_TYPE3_PKT | ((cnt-1) << 16) | ((opcode & 0xFF) << 8));
 }
 
+static inline void
+OUT_WFI(struct fd_ringbuffer *ring)
+{
+       OUT_PKT3(ring, CP_WAIT_FOR_IDLE, 1);
+       OUT_RING(ring, 0x00000000);
+}
+
 static inline void
 OUT_IB(struct fd_ringbuffer *ring, struct fd_ringmarker *start,
                struct fd_ringmarker *end)