Marcin Slusarz
2012-Aug-19 21:00 UTC
[Nouveau] [PATCH 08/10] drm/nouveau: use ioread32_native/iowrite32_native for fifo control registers
Signed-off-by: Marcin Slusarz <marcin.slusarz at gmail.com> --- 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(-) diff --git a/drivers/gpu/drm/nouveau/core/engine/fifo/base.c b/drivers/gpu/drm/nouveau/core/engine/fifo/base.c index 543fcaf..bbb43c6 100644 --- a/drivers/gpu/drm/nouveau/core/engine/fifo/base.c +++ b/drivers/gpu/drm/nouveau/core/engine/fifo/base.c @@ -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 -- 1.7.8.6
Ben Skeggs
2012-Aug-20 06:30 UTC
[Nouveau] [PATCH 08/10] drm/nouveau: use ioread32_native/iowrite32_native for fifo control registers
On Sun, Aug 19, 2012 at 11:00:03PM +0200, Marcin Slusarz wrote:> Signed-off-by: Marcin Slusarz <marcin.slusarz at gmail.com> > --- > 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!> --- > drivers/gpu/drm/nouveau/core/engine/fifo/base.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/core/engine/fifo/base.c b/drivers/gpu/drm/nouveau/core/engine/fifo/base.c > index 543fcaf..bbb43c6 100644 > --- a/drivers/gpu/drm/nouveau/core/engine/fifo/base.c > +++ b/drivers/gpu/drm/nouveau/core/engine/fifo/base.c > @@ -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 > -- > 1.7.8.6 > > _______________________________________________ > Nouveau mailing list > Nouveau at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/nouveau
Apparently Analagous Threads
- [PATCH 09/10] drm/nv50/evo: store iomem pointer in properly typed field
- [PATCH] drm/nv84-: write fence value on exit, and restore value on init.
- [PATCH 1/3] drm/nouveau: change channel regs mapping to ioremap
- [PATCH v3 2/3] device: detect if changing endianness failed
- [PATCH 4/4] drm/nouveau: introduce CPU cache flushing macro