diff mbox

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

Message ID 20180310032141.6096-3-jglisse@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jerome Glisse March 10, 2018, 3:21 a.m. UTC
From: Jérôme Glisse <jglisse@redhat.com>

Adds support for 64-bits read.

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

Patch

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