diff options
author | Rob Clark <[email protected]> | 2017-12-18 15:06:37 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2017-12-19 15:00:18 -0500 |
commit | d7cb509fd3af578c7b1b8eac57910e38e258e348 (patch) | |
tree | 28dae17ebbb29c71b8efc15a847019b9c4530a0e /src/gallium/drivers/freedreno/a4xx | |
parent | 0536737983981b03fbe8bccd9f3a0f7ae81479b0 (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/a4xx')
-rw-r--r-- | src/gallium/drivers/freedreno/a4xx/fd4_emit.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_emit.c b/src/gallium/drivers/freedreno/a4xx/fd4_emit.c index dca3692b047..5fec2b6b08a 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_emit.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_emit.c @@ -912,6 +912,26 @@ fd4_emit_ib(struct fd_ringbuffer *ring, struct fd_ringbuffer *target) __OUT_IB(ring, true, target); } +static void +fd4_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_PKT3(ring, CP_MEM_TO_MEM, 3); + 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 fd4_emit_init(struct pipe_context *pctx) { @@ -919,4 +939,5 @@ fd4_emit_init(struct pipe_context *pctx) ctx->emit_const = fd4_emit_const; ctx->emit_const_bo = fd4_emit_const_bo; ctx->emit_ib = fd4_emit_ib; + ctx->mem_to_mem = fd4_mem_to_mem; } |