summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/a5xx
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2017-12-18 15:06:37 -0500
committerRob Clark <[email protected]>2017-12-19 15:00:18 -0500
commitd7cb509fd3af578c7b1b8eac57910e38e258e348 (patch)
tree28dae17ebbb29c71b8efc15a847019b9c4530a0e /src/gallium/drivers/freedreno/a5xx
parent0536737983981b03fbe8bccd9f3a0f7ae81479b0 (diff)
freedreno/ir3: add ctx->mem_to_mem()
For dealing with indirect-draw + gl_VertexID, we'll introduce another case where we need to use CP_MEM_TO_MEM. Rather than adding more if(a5xx)/else make this a ctx vfunc. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a5xx')
-rw-r--r--src/gallium/drivers/freedreno/a5xx/fd5_emit.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_emit.c b/src/gallium/drivers/freedreno/a5xx/fd5_emit.c
index 08e9bb7bafb..b7ce084a827 100644
--- a/src/gallium/drivers/freedreno/a5xx/fd5_emit.c
+++ b/src/gallium/drivers/freedreno/a5xx/fd5_emit.c
@@ -1068,6 +1068,26 @@ fd5_emit_ib(struct fd_ringbuffer *ring, struct fd_ringbuffer *target)
__OUT_IB5(ring, target);
}
+static void
+fd5_mem_to_mem(struct fd_ringbuffer *ring, struct pipe_resource *dst,
+ unsigned dst_off, struct pipe_resource *src, unsigned src_off,
+ unsigned sizedwords)
+{
+ struct fd_bo *src_bo = fd_resource(src)->bo;
+ struct fd_bo *dst_bo = fd_resource(dst)->bo;
+ unsigned i;
+
+ for (i = 0; i < sizedwords; i++) {
+ OUT_PKT7(ring, CP_MEM_TO_MEM, 5);
+ OUT_RING(ring, 0x00000000);
+ OUT_RELOCW(ring, dst_bo, dst_off, 0, 0);
+ OUT_RELOC (ring, src_bo, src_off, 0, 0);
+
+ dst_off += 4;
+ src_off += 4;
+ }
+}
+
void
fd5_emit_init(struct pipe_context *pctx)
{
@@ -1075,4 +1095,5 @@ fd5_emit_init(struct pipe_context *pctx)
ctx->emit_const = fd5_emit_const;
ctx->emit_const_bo = fd5_emit_const_bo;
ctx->emit_ib = fd5_emit_ib;
+ ctx->mem_to_mem = fd5_mem_to_mem;
}