freedreno: introduce fd_batch
[mesa.git] / src / gallium / drivers / freedreno / a4xx / fd4_emit.c
index 7d602fc6c92c6116e011808dfb7b5e46444d2f8a..5bb712c755c14c50dd5ff43d677e52bcfa8be8da 100644 (file)
@@ -93,7 +93,7 @@ fd4_emit_const(struct fd_ringbuffer *ring, enum shader_t type,
 
 static void
 fd4_emit_const_bo(struct fd_ringbuffer *ring, enum shader_t type, boolean write,
-               uint32_t regid, uint32_t num, struct fd_bo **bos, uint32_t *offsets)
+               uint32_t regid, uint32_t num, struct pipe_resource **prscs, uint32_t *offsets)
 {
        uint32_t i;
 
@@ -109,11 +109,11 @@ fd4_emit_const_bo(struct fd_ringbuffer *ring, enum shader_t type, boolean write,
                        CP_LOAD_STATE_1_STATE_TYPE(ST_CONSTANTS));
 
        for (i = 0; i < num; i++) {
-               if (bos[i]) {
+               if (prscs[i]) {
                        if (write) {
-                               OUT_RELOCW(ring, bos[i], offsets[i], 0, 0);
+                               OUT_RELOCW(ring, fd_resource(prscs[i])->bo, offsets[i], 0, 0);
                        } else {
-                               OUT_RELOC(ring, bos[i], offsets[i], 0, 0);
+                               OUT_RELOC(ring, fd_resource(prscs[i])->bo, offsets[i], 0, 0);
                        }
                } else {
                        OUT_RING(ring, 0xbad00000 | (i << 16));
@@ -736,10 +736,9 @@ fd4_emit_state(struct fd_context *ctx, struct fd_ringbuffer *ring,
  * state, there could have been a context switch between ioctls):
  */
 void
-fd4_emit_restore(struct fd_context *ctx)
+fd4_emit_restore(struct fd_context *ctx, struct fd_ringbuffer *ring)
 {
        struct fd4_context *fd4_ctx = fd4_context(ctx);
-       struct fd_ringbuffer *ring = ctx->ring;
 
        OUT_PKT0(ring, REG_A4XX_RBBM_PERFCTR_CTL, 1);
        OUT_RING(ring, 0x00000001);
@@ -892,10 +891,9 @@ fd4_emit_restore(struct fd_context *ctx)
 }
 
 static void
-fd4_emit_ib(struct fd_ringbuffer *ring, struct fd_ringmarker *start,
-               struct fd_ringmarker *end)
+fd4_emit_ib(struct fd_ringbuffer *ring, struct fd_ringbuffer *target)
 {
-       __OUT_IB(ring, true, start, end);
+       __OUT_IB(ring, true, target);
 }
 
 void