From 305bcdf9921a0684e5dfca19dc42e849f3f2246c Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Thu, 29 Aug 2019 11:35:17 -0700 Subject: [PATCH] freedreno/drm: fix 64b iova shifts Should shift before splitting 64b iova into dwords Signed-off-by: Rob Clark Reviewed-by: Eric Anholt --- src/freedreno/drm/msm_ringbuffer_sp.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/freedreno/drm/msm_ringbuffer_sp.c b/src/freedreno/drm/msm_ringbuffer_sp.c index af71277..ec375a1 100644 --- a/src/freedreno/drm/msm_ringbuffer_sp.c +++ b/src/freedreno/drm/msm_ringbuffer_sp.c @@ -421,25 +421,19 @@ msm_ringbuffer_sp_emit_reloc(struct fd_ringbuffer *ring, } uint64_t iova = fd_bo_get_iova(reloc->bo) + reloc->offset; - uint32_t dword = iova; int shift = reloc->shift; if (shift < 0) - dword >>= -shift; + iova >>= -shift; else - dword <<= shift; + iova <<= shift; + + uint32_t dword = iova; (*ring->cur++) = dword | reloc->or; if (pipe->gpu_id >= 500) { dword = iova >> 32; - shift -= 32; - - if (shift < 0) - dword >>= -shift; - else - dword <<= shift; - (*ring->cur++) = dword | reloc->orhi; } } -- 2.7.4