diff --git a/src/freedreno/drm/freedreno_ringbuffer.h b/src/freedreno/drm/freedreno_ringbuffer.h index 2a07f98e5ad..903e22d78a3 100644 --- a/src/freedreno/drm/freedreno_ringbuffer.h +++ b/src/freedreno/drm/freedreno_ringbuffer.h @@ -196,13 +196,12 @@ fd_ringbuffer_emit(struct fd_ringbuffer *ring, uint32_t data) struct fd_reloc { struct fd_bo *bo; uint64_t iova; + uint64_t orval; #define FD_RELOC_READ 0x0001 #define FD_RELOC_WRITE 0x0002 #define FD_RELOC_DUMP 0x0004 uint32_t offset; - uint32_t orlo; int32_t shift; - uint32_t orhi; /* used for a5xx+ */ }; /* We always mark BOs for write, instead of tracking it across reloc @@ -278,10 +277,9 @@ OUT_RING(struct fd_ringbuffer *ring, uint32_t data) /* * NOTE: OUT_RELOC() is 2 dwords (64b) on a5xx+ */ -#ifndef __cplusplus static inline void OUT_RELOC(struct fd_ringbuffer *ring, struct fd_bo *bo, uint32_t offset, - uint64_t or, int32_t shift) + uint64_t orval, int32_t shift) { if (LOG_DWORDS) { fprintf(stderr, "ring[%p]: OUT_RELOC %04x: %p+%u << %d", ring, @@ -296,19 +294,18 @@ OUT_RELOC(struct fd_ringbuffer *ring, struct fd_bo *bo, uint32_t offset, else iova <<= shift; - iova |= or ; + iova |= orval; - fd_ringbuffer_reloc(ring, &(struct fd_reloc){ - .bo = bo, - .iova = iova, - .offset = offset, - .orlo = or - , - .shift = shift, - .orhi = or >> 32, - }); + struct fd_reloc reloc = { + .bo = bo, + .iova = iova, + .orval = orval, + .offset = offset, + .shift = shift, + }; + + fd_ringbuffer_reloc(ring, &reloc); } -#endif static inline void OUT_RB(struct fd_ringbuffer *ring, struct fd_ringbuffer *target) diff --git a/src/freedreno/drm/msm/msm_ringbuffer.c b/src/freedreno/drm/msm/msm_ringbuffer.c index bcacf310417..84ad20b41f8 100644 --- a/src/freedreno/drm/msm/msm_ringbuffer.c +++ b/src/freedreno/drm/msm/msm_ringbuffer.c @@ -503,7 +503,7 @@ msm_ringbuffer_emit_reloc(struct fd_ringbuffer *ring, (struct drm_msm_gem_submit_reloc){ .reloc_idx = reloc_idx, .reloc_offset = reloc->offset, - .or = reloc->orlo, + .or = reloc->orval, .shift = reloc->shift, .submit_offset = offset_bytes(ring->cur, ring->start) + msm_ring->offset, @@ -516,7 +516,7 @@ msm_ringbuffer_emit_reloc(struct fd_ringbuffer *ring, (struct drm_msm_gem_submit_reloc){ .reloc_idx = reloc_idx, .reloc_offset = reloc->offset, - .or = reloc->orhi, + .or = reloc->orval >> 32, .shift = reloc->shift - 32, .submit_offset = offset_bytes(ring->cur, ring->start) + msm_ring->offset,