[RFC PATCH 02/13] drm/nouveau/core/memory: add some useful accessor macros

jglisse at redhat.com jglisse at redhat.com
Sat Mar 10 03:21:30 UTC 2018


From: Jérôme Glisse <jglisse at redhat.com>

Adds support for 64-bits read.

Signed-off-by: Jérôme Glisse <jglisse at redhat.com>
---
 drivers/gpu/drm/nouveau/include/nvkm/core/memory.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/memory.h b/drivers/gpu/drm/nouveau/include/nvkm/core/memory.h
index 05f505de0075..d1a886c4d2d9 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/memory.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/memory.h
@@ -82,6 +82,14 @@ void nvkm_memory_tags_put(struct nvkm_memory *, struct nvkm_device *,
 	nvkm_wo32((o), __a + 4, upper_32_bits(__d));                           \
 } while(0)
 
+#define nvkm_ro64(o,a) ({                                                      \
+	u64 _data;                                                             \
+	_data = nvkm_ro32((o), (a) + 4);                                       \
+	_data = _data << 32;                                                   \
+	_data |= nvkm_ro32((o), (a) + 0);                                      \
+	_data;                                                                 \
+})
+
 #define nvkm_fill(t,s,o,a,d,c) do {                                            \
 	u64 _a = (a), _c = (c), _d = (d), _o = _a >> s, _s = _c << s;          \
 	u##t __iomem *_m = nvkm_kmap(o);                                       \
-- 
2.14.3



More information about the dri-devel mailing list