Skip to content

Commit

Permalink
drm/nouveau: pass address to object accessor functions as u64
Browse files Browse the repository at this point in the history
Will be required by future work.  Make the API change now to catch any
(but hopefully none) unexpected fallout.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Nov 28, 2012
1 parent 66bb7e1 commit 0a32241
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 45 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/nouveau/core/core/gpuobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ _nouveau_gpuobj_fini(struct nouveau_object *object, bool suspend)
}

u32
_nouveau_gpuobj_rd32(struct nouveau_object *object, u32 addr)
_nouveau_gpuobj_rd32(struct nouveau_object *object, u64 addr)
{
struct nouveau_gpuobj *gpuobj = nv_gpuobj(object);
struct nouveau_ofuncs *pfuncs = nv_ofuncs(gpuobj->parent);
Expand All @@ -193,7 +193,7 @@ _nouveau_gpuobj_rd32(struct nouveau_object *object, u32 addr)
}

void
_nouveau_gpuobj_wr32(struct nouveau_object *object, u32 addr, u32 data)
_nouveau_gpuobj_wr32(struct nouveau_object *object, u64 addr, u32 data)
{
struct nouveau_gpuobj *gpuobj = nv_gpuobj(object);
struct nouveau_ofuncs *pfuncs = nv_ofuncs(gpuobj->parent);
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/nouveau/core/engine/fifo/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ _nouveau_fifo_channel_dtor(struct nouveau_object *object)
}

u32
_nouveau_fifo_channel_rd32(struct nouveau_object *object, u32 addr)
_nouveau_fifo_channel_rd32(struct nouveau_object *object, u64 addr)
{
struct nouveau_fifo_chan *chan = (void *)object;
return ioread32_native(chan->user + addr);
}

void
_nouveau_fifo_channel_wr32(struct nouveau_object *object, u32 addr, u32 data)
_nouveau_fifo_channel_wr32(struct nouveau_object *object, u64 addr, u32 data)
{
struct nouveau_fifo_chan *chan = (void *)object;
iowrite32_native(data, chan->user + addr);
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/nouveau/core/include/core/gpuobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ nouveau_gpuobj_ref(struct nouveau_gpuobj *obj, struct nouveau_gpuobj **ref)
void _nouveau_gpuobj_dtor(struct nouveau_object *);
int _nouveau_gpuobj_init(struct nouveau_object *);
int _nouveau_gpuobj_fini(struct nouveau_object *, bool);
u32 _nouveau_gpuobj_rd32(struct nouveau_object *, u32);
void _nouveau_gpuobj_wr32(struct nouveau_object *, u32, u32);
u32 _nouveau_gpuobj_rd32(struct nouveau_object *, u64);
void _nouveau_gpuobj_wr32(struct nouveau_object *, u64, u32);

#endif
26 changes: 13 additions & 13 deletions drivers/gpu/drm/nouveau/core/include/core/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ struct nouveau_ofuncs {
void (*dtor)(struct nouveau_object *);
int (*init)(struct nouveau_object *);
int (*fini)(struct nouveau_object *, bool suspend);
u8 (*rd08)(struct nouveau_object *, u32 offset);
u16 (*rd16)(struct nouveau_object *, u32 offset);
u32 (*rd32)(struct nouveau_object *, u32 offset);
void (*wr08)(struct nouveau_object *, u32 offset, u8 data);
void (*wr16)(struct nouveau_object *, u32 offset, u16 data);
void (*wr32)(struct nouveau_object *, u32 offset, u32 data);
u8 (*rd08)(struct nouveau_object *, u64 offset);
u16 (*rd16)(struct nouveau_object *, u64 offset);
u32 (*rd32)(struct nouveau_object *, u64 offset);
void (*wr08)(struct nouveau_object *, u64 offset, u8 data);
void (*wr16)(struct nouveau_object *, u64 offset, u16 data);
void (*wr32)(struct nouveau_object *, u64 offset, u32 data);
};

static inline struct nouveau_ofuncs *
Expand Down Expand Up @@ -123,52 +123,52 @@ nv_call(void *obj, u32 mthd, u32 data)
}

static inline u8
nv_ro08(void *obj, u32 addr)
nv_ro08(void *obj, u64 addr)
{
u8 data = nv_ofuncs(obj)->rd08(obj, addr);
nv_spam(obj, "nv_ro08 0x%08x 0x%02x\n", addr, data);
return data;
}

static inline u16
nv_ro16(void *obj, u32 addr)
nv_ro16(void *obj, u64 addr)
{
u16 data = nv_ofuncs(obj)->rd16(obj, addr);
nv_spam(obj, "nv_ro16 0x%08x 0x%04x\n", addr, data);
return data;
}

static inline u32
nv_ro32(void *obj, u32 addr)
nv_ro32(void *obj, u64 addr)
{
u32 data = nv_ofuncs(obj)->rd32(obj, addr);
nv_spam(obj, "nv_ro32 0x%08x 0x%08x\n", addr, data);
return data;
}

static inline void
nv_wo08(void *obj, u32 addr, u8 data)
nv_wo08(void *obj, u64 addr, u8 data)
{
nv_spam(obj, "nv_wo08 0x%08x 0x%02x\n", addr, data);
nv_ofuncs(obj)->wr08(obj, addr, data);
}

static inline void
nv_wo16(void *obj, u32 addr, u16 data)
nv_wo16(void *obj, u64 addr, u16 data)
{
nv_spam(obj, "nv_wo16 0x%08x 0x%04x\n", addr, data);
nv_ofuncs(obj)->wr16(obj, addr, data);
}

static inline void
nv_wo32(void *obj, u32 addr, u32 data)
nv_wo32(void *obj, u64 addr, u32 data)
{
nv_spam(obj, "nv_wo32 0x%08x 0x%08x\n", addr, data);
nv_ofuncs(obj)->wr32(obj, addr, data);
}

static inline u32
nv_mo32(void *obj, u32 addr, u32 mask, u32 data)
nv_mo32(void *obj, u64 addr, u32 mask, u32 data)
{
u32 temp = nv_ro32(obj, addr);
nv_wo32(obj, addr, (temp & ~mask) | data);
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/nouveau/core/include/engine/fifo.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ void nouveau_fifo_channel_destroy(struct nouveau_fifo_chan *);
#define _nouveau_fifo_channel_fini _nouveau_namedb_fini

void _nouveau_fifo_channel_dtor(struct nouveau_object *);
u32 _nouveau_fifo_channel_rd32(struct nouveau_object *, u32);
void _nouveau_fifo_channel_wr32(struct nouveau_object *, u32, u32);
u32 _nouveau_fifo_channel_rd32(struct nouveau_object *, u64);
void _nouveau_fifo_channel_wr32(struct nouveau_object *, u64, u32);

struct nouveau_fifo_base {
struct nouveau_gpuobj base;
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/nouveau/core/subdev/bar/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ nouveau_barobj_dtor(struct nouveau_object *object)
}

static u32
nouveau_barobj_rd32(struct nouveau_object *object, u32 addr)
nouveau_barobj_rd32(struct nouveau_object *object, u64 addr)
{
struct nouveau_barobj *barobj = (void *)object;
return ioread32_native(barobj->iomem + addr);
}

static void
nouveau_barobj_wr32(struct nouveau_object *object, u32 addr, u32 data)
nouveau_barobj_wr32(struct nouveau_object *object, u64 addr, u32 data)
{
struct nouveau_barobj *barobj = (void *)object;
iowrite32_native(data, barobj->iomem + addr);
Expand Down
12 changes: 6 additions & 6 deletions drivers/gpu/drm/nouveau/core/subdev/bios/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,42 +366,42 @@ nouveau_bios_shadow(struct nouveau_bios *bios)
}

static u8
nouveau_bios_rd08(struct nouveau_object *object, u32 addr)
nouveau_bios_rd08(struct nouveau_object *object, u64 addr)
{
struct nouveau_bios *bios = (void *)object;
return bios->data[addr];
}

static u16
nouveau_bios_rd16(struct nouveau_object *object, u32 addr)
nouveau_bios_rd16(struct nouveau_object *object, u64 addr)
{
struct nouveau_bios *bios = (void *)object;
return get_unaligned_le16(&bios->data[addr]);
}

static u32
nouveau_bios_rd32(struct nouveau_object *object, u32 addr)
nouveau_bios_rd32(struct nouveau_object *object, u64 addr)
{
struct nouveau_bios *bios = (void *)object;
return get_unaligned_le32(&bios->data[addr]);
}

static void
nouveau_bios_wr08(struct nouveau_object *object, u32 addr, u8 data)
nouveau_bios_wr08(struct nouveau_object *object, u64 addr, u8 data)
{
struct nouveau_bios *bios = (void *)object;
bios->data[addr] = data;
}

static void
nouveau_bios_wr16(struct nouveau_object *object, u32 addr, u16 data)
nouveau_bios_wr16(struct nouveau_object *object, u64 addr, u16 data)
{
struct nouveau_bios *bios = (void *)object;
put_unaligned_le16(data, &bios->data[addr]);
}

static void
nouveau_bios_wr32(struct nouveau_object *object, u32 addr, u32 data)
nouveau_bios_wr32(struct nouveau_object *object, u64 addr, u32 data)
{
struct nouveau_bios *bios = (void *)object;
put_unaligned_le32(data, &bios->data[addr]);
Expand Down
12 changes: 6 additions & 6 deletions drivers/gpu/drm/nouveau/core/subdev/device/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,37 +356,37 @@ nouveau_devobj_fini(struct nouveau_object *object, bool suspend)
}

static u8
nouveau_devobj_rd08(struct nouveau_object *object, u32 addr)
nouveau_devobj_rd08(struct nouveau_object *object, u64 addr)
{
return nv_rd08(object->engine, addr);
}

static u16
nouveau_devobj_rd16(struct nouveau_object *object, u32 addr)
nouveau_devobj_rd16(struct nouveau_object *object, u64 addr)
{
return nv_rd16(object->engine, addr);
}

static u32
nouveau_devobj_rd32(struct nouveau_object *object, u32 addr)
nouveau_devobj_rd32(struct nouveau_object *object, u64 addr)
{
return nv_rd32(object->engine, addr);
}

static void
nouveau_devobj_wr08(struct nouveau_object *object, u32 addr, u8 data)
nouveau_devobj_wr08(struct nouveau_object *object, u64 addr, u8 data)
{
nv_wr08(object->engine, addr, data);
}

static void
nouveau_devobj_wr16(struct nouveau_object *object, u32 addr, u16 data)
nouveau_devobj_wr16(struct nouveau_object *object, u64 addr, u16 data)
{
nv_wr16(object->engine, addr, data);
}

static void
nouveau_devobj_wr32(struct nouveau_object *object, u32 addr, u32 data)
nouveau_devobj_wr32(struct nouveau_object *object, u64 addr, u32 data)
{
nv_wr32(object->engine, addr, data);
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/gpu/drm/nouveau/core/subdev/instmem/nv04.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ nv04_instobj_dtor(struct nouveau_object *object)
}

static u32
nv04_instobj_rd32(struct nouveau_object *object, u32 addr)
nv04_instobj_rd32(struct nouveau_object *object, u64 addr)
{
struct nv04_instobj_priv *node = (void *)object;
return nv_ro32(object->engine, node->mem->offset + addr);
}

static void
nv04_instobj_wr32(struct nouveau_object *object, u32 addr, u32 data)
nv04_instobj_wr32(struct nouveau_object *object, u64 addr, u32 data)
{
struct nv04_instobj_priv *node = (void *)object;
nv_wo32(object->engine, node->mem->offset + addr, data);
Expand Down Expand Up @@ -173,13 +173,13 @@ nv04_instmem_dtor(struct nouveau_object *object)
}

static u32
nv04_instmem_rd32(struct nouveau_object *object, u32 addr)
nv04_instmem_rd32(struct nouveau_object *object, u64 addr)
{
return nv_rd32(object, 0x700000 + addr);
}

static void
nv04_instmem_wr32(struct nouveau_object *object, u32 addr, u32 data)
nv04_instmem_wr32(struct nouveau_object *object, u64 addr, u32 data)
{
return nv_wr32(object, 0x700000 + addr, data);
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ nv40_instmem_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
}

static u32
nv40_instmem_rd32(struct nouveau_object *object, u32 addr)
nv40_instmem_rd32(struct nouveau_object *object, u64 addr)
{
struct nv04_instmem_priv *priv = (void *)object;
return ioread32_native(priv->iomem + addr);
}

static void
nv40_instmem_wr32(struct nouveau_object *object, u32 addr, u32 data)
nv40_instmem_wr32(struct nouveau_object *object, u64 addr, u32 data)
{
struct nv04_instmem_priv *priv = (void *)object;
iowrite32_native(data, priv->iomem + addr);
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/nouveau/core/subdev/instmem/nv50.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ nv50_instobj_dtor(struct nouveau_object *object)
}

static u32
nv50_instobj_rd32(struct nouveau_object *object, u32 offset)
nv50_instobj_rd32(struct nouveau_object *object, u64 offset)
{
struct nv50_instmem_priv *priv = (void *)object->engine;
struct nv50_instobj_priv *node = (void *)object;
Expand All @@ -96,7 +96,7 @@ nv50_instobj_rd32(struct nouveau_object *object, u32 offset)
}

static void
nv50_instobj_wr32(struct nouveau_object *object, u32 offset, u32 data)
nv50_instobj_wr32(struct nouveau_object *object, u64 offset, u32 data)
{
struct nv50_instmem_priv *priv = (void *)object->engine;
struct nv50_instobj_priv *node = (void *)object;
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/nouveau/nv50_evo.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
#include <subdev/fb.h>

static u32
nv50_evo_rd32(struct nouveau_object *object, u32 addr)
nv50_evo_rd32(struct nouveau_object *object, u64 addr)
{
void __iomem *iomem = object->oclass->ofuncs->rd08;
return ioread32_native(iomem + addr);
}

static void
nv50_evo_wr32(struct nouveau_object *object, u32 addr, u32 data)
nv50_evo_wr32(struct nouveau_object *object, u64 addr, u32 data)
{
void __iomem *iomem = object->oclass->ofuncs->rd08;
iowrite32_native(data, iomem + addr);
Expand Down

0 comments on commit 0a32241

Please sign in to comment.