freedreno: add shifted reloc

Needed for RB_COPY_DEST_BASE register on a3xx.

Signed-off-by: Rob Clark <robdclark@gmail.com>
main
Rob Clark 2013-04-12 11:28:13 -04:00
parent a36cdb858e
commit e5d8a9c1d6
2 changed files with 14 additions and 0 deletions

View File

@ -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)
{

View File

@ -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);