Mesa (master): freedreno/drm: fix 64b iova shifts
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Sep 3 21:14:01 UTC 2019
Module: Mesa
Branch: master
Commit: 305bcdf9921a0684e5dfca19dc42e849f3f2246c
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=305bcdf9921a0684e5dfca19dc42e849f3f2246c
Author: Rob Clark <robdclark at chromium.org>
Date: Thu Aug 29 11:35:17 2019 -0700
freedreno/drm: fix 64b iova shifts
Should shift before splitting 64b iova into dwords
Signed-off-by: Rob Clark <robdclark at chromium.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
---
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 af71277072c..ec375a19938 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;
}
}
More information about the mesa-commit
mailing list