Skip to contentSkip to conversation

drm/nouveau: use ioread32_native/iowrite32_native for fifo control registers

PATCH In review Marcin Slusarz 2 participants 2 messages Aug 19, 2012 – Aug 20, 2012 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 8/10 drm/nouveau: use ioread32_native/iowrite32_native for fifo control registers

---
Do I miss something important why was it written this way?

---
 drivers/gpu/drm/nouveau/core/engine/fifo/base.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/core/engine/fifo/base.c +2 -2
index 543fcaf..bbb43c6 100644
@@ -122,14 +122,14 @@ u32
 _nouveau_fifo_channel_rd32(struct nouveau_object *object, u32 addr)
 {
 	struct nouveau_fifo_chan *chan = (void *)object;
-	return ((volatile u32 *)chan->user)[addr / 4];
+	return ioread32_native(chan->user + addr);
 }
 
 void
 _nouveau_fifo_channel_wr32(struct nouveau_object *object, u32 addr, u32 data)
 {
 	struct nouveau_fifo_chan *chan = (void *)object;
-	((volatile u32 *)chan->user)[addr / 4] = data;
+	iowrite32_native(data, chan->user + addr);
 }
 
 static int
Signature · 1 line
1.7.8.6
#2 lore raw
In reply to a message not in the archive
Quoted 3 lines · Marcin Slusarz

---
Do I miss something important why was it written this way?

Nope, you didn't. It's a left-over from a *really* early revision of the userspace version of the kernel module.

Thanks!

Quoted 32 lines
---
 drivers/gpu/drm/nouveau/core/engine/fifo/base.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/core/engine/fifo/base.c +2 -2
index 543fcaf..bbb43c6 100644
@@ -122,14 +122,14 @@ u32
 _nouveau_fifo_channel_rd32(struct nouveau_object *object, u32 addr)
 {
 	struct nouveau_fifo_chan *chan = (void *)object;
-	return ((volatile u32 *)chan->user)[addr / 4];
+	return ioread32_native(chan->user + addr);
 }
 
 void
 _nouveau_fifo_channel_wr32(struct nouveau_object *object, u32 addr, u32 data)
 {
 	struct nouveau_fifo_chan *chan = (void *)object;
-	((volatile u32 *)chan->user)[addr / 4] = data;
+	iowrite32_native(data, chan->user + addr);
 }
 
 static int
Signature · 6 lines
1.7.8.6

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau