From e5d8a9c1d6375feb74feb52f419a025f1abf94d1 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Fri, 12 Apr 2013 11:28:13 -0400 Subject: freedreno: add shifted reloc Needed for RB_COPY_DEST_BASE register on a3xx. Signed-off-by: Rob Clark --- freedreno/freedreno_ringbuffer.c | 12 ++++++++++++ freedreno/freedreno_ringbuffer.h | 2 ++ 2 files changed, 14 insertions(+) (limited to 'freedreno') diff --git a/freedreno/freedreno_ringbuffer.c b/freedreno/freedreno_ringbuffer.c index 822412a9..f1879964 100644 --- a/freedreno/freedreno_ringbuffer.c +++ b/freedreno/freedreno_ringbuffer.c @@ -203,6 +203,18 @@ void fd_ringbuffer_emit_reloc(struct fd_ringbuffer *ring, fd_pipe_add_submit(ring->pipe, bo); } +void fd_ringbuffer_emit_reloc_shift(struct fd_ringbuffer *ring, + struct fd_bo *bo, uint32_t offset, uint32_t or, int32_t shift) +{ + uint32_t addr = fd_bo_gpuaddr(bo, offset); + if (shift < 0) + addr >>= -shift; + else + addr <<= shift; + (*ring->cur++) = addr | or; + fd_pipe_add_submit(ring->pipe, bo); +} + void fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring, struct fd_ringmarker *target) { diff --git a/freedreno/freedreno_ringbuffer.h b/freedreno/freedreno_ringbuffer.h index 4fb668f7..051bbca9 100644 --- a/freedreno/freedreno_ringbuffer.h +++ b/freedreno/freedreno_ringbuffer.h @@ -74,6 +74,8 @@ static inline void fd_ringbuffer_emit(struct fd_ringbuffer *ring, void fd_ringbuffer_emit_reloc(struct fd_ringbuffer *ring, struct fd_bo *bo, uint32_t offset, uint32_t or); +void fd_ringbuffer_emit_reloc_shift(struct fd_ringbuffer *ring, + struct fd_bo *bo, uint32_t offset, uint32_t or, int32_t shift); void fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring, struct fd_ringmarker *target); -- cgit v1.2.3