nvkm_client_notify_del(client, i);
nouveau_object_ref(NULL, &client->device);
nouveau_handle_destroy(client->root);
- nouveau_namedb_destroy(&client->base);
+ nouveau_namedb_destroy(&client->namedb);
}
static struct nouveau_oclass
if (client->vm)
atomic_dec(&client->vm->engref[nv_engidx(engobj)]);
- if (engctx->base.size)
- nouveau_gpuobj_destroy(&engctx->base);
+ if (engctx->gpuobj.size)
+ nouveau_gpuobj_destroy(&engctx->gpuobj);
else
- nouveau_object_destroy(&engctx->base.base);
+ nouveau_object_destroy(&engctx->gpuobj.object);
}
int
struct nouveau_subdev *pardev;
int ret;
- ret = nouveau_gpuobj_init(&engctx->base);
+ ret = nouveau_gpuobj_init(&engctx->gpuobj);
if (ret)
return ret;
}
nv_debug(parent, "detached %s context\n", subdev->name);
- return nouveau_gpuobj_fini(&engctx->base, suspend);
+ return nouveau_gpuobj_fini(&engctx->gpuobj, suspend);
}
int
if (gpuobj->heap.block_size)
nouveau_mm_fini(&gpuobj->heap);
- nouveau_object_destroy(&gpuobj->base);
+ nouveau_object_destroy(&gpuobj->object);
}
int
{
struct nouveau_gpuobj *gpuobj = (void *)object;
nouveau_object_ref(NULL, &gpuobj->parent);
- nouveau_object_destroy(&gpuobj->base);
+ nouveau_object_destroy(&gpuobj->object);
}
static struct nouveau_oclass
kfree(sclass);
}
- nouveau_object_destroy(&parent->base);
+ nouveau_object_destroy(&parent->object);
}
int
nouveau_subdev_init(struct nouveau_subdev *subdev)
{
- int ret = nouveau_object_init(&subdev->base);
+ int ret = nouveau_object_init(&subdev->object);
if (ret)
return ret;
- nouveau_subdev_reset(&subdev->base);
+ nouveau_subdev_reset(&subdev->object);
return 0;
}
nv_mask(subdev, 0x000200, subdev->unit, subdev->unit);
}
- return nouveau_object_fini(&subdev->base, suspend);
+ return nouveau_object_fini(&subdev->object, suspend);
}
int
{
int subidx = nv_hclass(subdev) & 0xff;
nv_device(subdev)->subdev[subidx] = NULL;
- nouveau_object_destroy(&subdev->base);
+ nouveau_object_destroy(&subdev->object);
}
void
if (nv_subdev(device)->mmio)
iounmap(nv_subdev(device)->mmio);
- nouveau_engine_destroy(&device->base);
+ nouveau_engine_destroy(&device->engine);
}
resource_size_t
nouveau_gpuobj_ref(NULL, &chan->pushgpu);
nouveau_object_ref(NULL, (struct nouveau_object **)&chan->pushdma);
- nouveau_namedb_destroy(&chan->base);
+ nouveau_namedb_destroy(&chan->namedb);
}
void
nv_wr32(priv, NV03_PFIFO_RAMHT, (0x03 << 24) /* search 128 */ |
((priv->ramht->bits - 9) << 16) |
- (priv->ramht->base.addr >> 8));
+ (priv->ramht->gpuobj.addr >> 8));
nv_wr32(priv, NV03_PFIFO_RAMRO, priv->ramro->addr >> 8);
nv_wr32(priv, NV03_PFIFO_RAMFC, priv->ramfc->addr >> 8);
nv_wr32(priv, NV03_PFIFO_RAMHT, (0x03 << 24) /* search 128 */ |
((priv->ramht->bits - 9) << 16) |
- (priv->ramht->base.addr >> 8));
+ (priv->ramht->gpuobj.addr >> 8));
nv_wr32(priv, NV03_PFIFO_RAMRO, priv->ramro->addr >> 8);
nv_wr32(priv, NV03_PFIFO_RAMFC, priv->ramfc->addr >> 8 | 0x00010000);
nv_wr32(priv, NV03_PFIFO_RAMHT, (0x03 << 24) /* search 128 */ |
((priv->ramht->bits - 9) << 16) |
- (priv->ramht->base.addr >> 8));
+ (priv->ramht->gpuobj.addr >> 8));
nv_wr32(priv, NV03_PFIFO_RAMRO, priv->ramro->addr >> 8);
switch (nv_device(priv)->chipset) {
nv_wo32(base->ramfc, 0x7c, 0x30000001);
nv_wo32(base->ramfc, 0x80, ((chan->ramht->bits - 9) << 27) |
(4 << 24) /* SEARCH_FULL */ |
- (chan->ramht->base.node->offset >> 4));
+ (chan->ramht->gpuobj.node->offset >> 4));
bar->flush(bar);
return 0;
}
nv_wo32(base->ramfc, 0x7c, 0x30000001);
nv_wo32(base->ramfc, 0x80, ((chan->ramht->bits - 9) << 27) |
(4 << 24) /* SEARCH_FULL */ |
- (chan->ramht->base.node->offset >> 4));
+ (chan->ramht->gpuobj.node->offset >> 4));
bar->flush(bar);
return 0;
}
nv_wo32(base->ramfc, 0x7c, 0x30000001);
nv_wo32(base->ramfc, 0x80, ((chan->ramht->bits - 9) << 27) |
(4 << 24) /* SEARCH_FULL */ |
- (chan->ramht->base.node->offset >> 4));
+ (chan->ramht->gpuobj.node->offset >> 4));
nv_wo32(base->ramfc, 0x88, base->cache->addr >> 10);
nv_wo32(base->ramfc, 0x98, nv_gpuobj(base)->addr >> 12);
bar->flush(bar);
nv_wo32(base->ramfc, 0x7c, 0x30000001);
nv_wo32(base->ramfc, 0x80, ((chan->ramht->bits - 9) << 27) |
(4 << 24) /* SEARCH_FULL */ |
- (chan->ramht->base.node->offset >> 4));
+ (chan->ramht->gpuobj.node->offset >> 4));
nv_wo32(base->ramfc, 0x88, base->cache->addr >> 10);
nv_wo32(base->ramfc, 0x98, nv_gpuobj(base)->addr >> 12);
bar->flush(bar);
#include <core/namedb.h>
struct nouveau_client {
- struct nouveau_namedb base;
+ struct nouveau_namedb namedb;
struct nouveau_handle *root;
struct nouveau_object *device;
char name[32];
};
struct nouveau_device {
- struct nouveau_engine base;
+ struct nouveau_engine engine;
struct list_head head;
struct pci_dev *pdev;
#define NV_ENGCTX(name,var) NV_ENGCTX_(NVDEV_ENGINE_##name, (var))
struct nouveau_engctx {
- struct nouveau_gpuobj base;
+ struct nouveau_gpuobj gpuobj;
struct nouveau_vma vma;
struct list_head head;
unsigned long save;
#define NV_ENGINE(name,var) NV_ENGINE_(NVDEV_ENGINE_##name, (var))
struct nouveau_engine {
- struct nouveau_subdev base;
+ struct nouveau_subdev subdev;
struct nouveau_oclass *cclass;
struct nouveau_oclass *sclass;
sizeof(**r),(void **)r)
#define nouveau_engine_destroy(p) \
- nouveau_subdev_destroy(&(p)->base)
+ nouveau_subdev_destroy(&(p)->subdev)
#define nouveau_engine_init(p) \
- nouveau_subdev_init(&(p)->base)
+ nouveau_subdev_init(&(p)->subdev)
#define nouveau_engine_fini(p,s) \
- nouveau_subdev_fini(&(p)->base, (s))
+ nouveau_subdev_fini(&(p)->subdev, (s))
int nouveau_engine_create_(struct nouveau_object *, struct nouveau_object *,
struct nouveau_oclass *, bool, const char *,
#define NVOBJ_FLAG_HEAP 0x00000004
struct nouveau_gpuobj {
- struct nouveau_object base;
+ struct nouveau_object object;
struct nouveau_object *parent;
struct nouveau_mm_node *node;
struct nouveau_mm heap;
#define nouveau_gpuobj_create(p,e,c,v,g,s,a,f,d) \
nouveau_gpuobj_create_((p), (e), (c), (v), (g), (s), (a), (f), \
sizeof(**d), (void **)d)
-#define nouveau_gpuobj_init(p) nouveau_object_init(&(p)->base)
-#define nouveau_gpuobj_fini(p,s) nouveau_object_fini(&(p)->base, (s))
+#define nouveau_gpuobj_init(p) nouveau_object_init(&(p)->object)
+#define nouveau_gpuobj_fini(p,s) nouveau_object_fini(&(p)->object, (s))
int nouveau_gpuobj_create_(struct nouveau_object *, struct nouveau_object *,
struct nouveau_oclass *, u32 pclass,
struct nouveau_object *, u32 size, u32 align,
static inline void
nouveau_gpuobj_ref(struct nouveau_gpuobj *obj, struct nouveau_gpuobj **ref)
{
- nouveau_object_ref(&obj->base, (struct nouveau_object **)ref);
+ nouveau_object_ref(&obj->object, (struct nouveau_object **)ref);
}
void _nouveau_gpuobj_dtor(struct nouveau_object *);
struct nouveau_handle;
struct nouveau_namedb {
- struct nouveau_parent base;
+ struct nouveau_parent parent;
rwlock_t lock;
struct list_head list;
};
nouveau_namedb_create_((p), (e), (c), (v), (s), (m), \
sizeof(**d), (void **)d)
#define nouveau_namedb_init(p) \
- nouveau_parent_init(&(p)->base)
+ nouveau_parent_init(&(p)->parent)
#define nouveau_namedb_fini(p,s) \
- nouveau_parent_fini(&(p)->base, (s))
+ nouveau_parent_fini(&(p)->parent, (s))
#define nouveau_namedb_destroy(p) \
- nouveau_parent_destroy(&(p)->base)
+ nouveau_parent_destroy(&(p)->parent)
int nouveau_namedb_create_(struct nouveau_object *, struct nouveau_object *,
struct nouveau_oclass *, u32 pclass,
};
struct nouveau_parent {
- struct nouveau_object base;
+ struct nouveau_object object;
struct nouveau_sclass *sclass;
u64 engine;
nouveau_parent_create_((p), (e), (c), (v), (s), (m), \
sizeof(**d), (void **)d)
#define nouveau_parent_init(p) \
- nouveau_object_init(&(p)->base)
+ nouveau_object_init(&(p)->object)
#define nouveau_parent_fini(p,s) \
- nouveau_object_fini(&(p)->base, (s))
+ nouveau_object_fini(&(p)->object, (s))
int nouveau_parent_create_(struct nouveau_object *, struct nouveau_object *,
struct nouveau_oclass *, u32 pclass,
#include <core/gpuobj.h>
struct nouveau_ramht {
- struct nouveau_gpuobj base;
+ struct nouveau_gpuobj gpuobj;
int bits;
};
static inline void
nouveau_ramht_ref(struct nouveau_ramht *obj, struct nouveau_ramht **ref)
{
- nouveau_gpuobj_ref(&obj->base, (struct nouveau_gpuobj **)ref);
+ nouveau_gpuobj_ref(&obj->gpuobj, (struct nouveau_gpuobj **)ref);
}
#endif
#define NV_SUBDEV(name,var) NV_SUBDEV_(NVDEV_SUBDEV_##name, (var))
struct nouveau_subdev {
- struct nouveau_object base;
+ struct nouveau_object object;
struct mutex mutex;
const char *name;
void __iomem *mmio;
#include <core/event.h>
struct nouveau_fifo_chan {
- struct nouveau_namedb base;
+ struct nouveau_namedb namedb;
struct nouveau_dmaobj *pushdma;
struct nouveau_gpuobj *pushgpu;
void __iomem *user;
nouveau_fifo_channel_create_((p), (e), (c), (b), (a), (s), (n), \
(m), sizeof(**d), (void **)d)
#define nouveau_fifo_channel_init(p) \
- nouveau_namedb_init(&(p)->base)
+ nouveau_namedb_init(&(p)->namedb)
#define nouveau_fifo_channel_fini(p,s) \
- nouveau_namedb_fini(&(p)->base, (s))
+ nouveau_namedb_fini(&(p)->namedb, (s))
int nouveau_fifo_channel_create_(struct nouveau_object *,
struct nouveau_object *,
int _nouveau_fifo_channel_ntfy(struct nouveau_object *, u32, struct nvkm_event **);
struct nouveau_fifo_base {
- struct nouveau_gpuobj base;
+ struct nouveau_gpuobj gpuobj;
};
#define nouveau_fifo_context_create(p,e,c,g,s,a,f,d) \
nouveau_gpuobj_create((p), (e), (c), 0, (g), (s), (a), (f), (d))
#define nouveau_fifo_context_destroy(p) \
- nouveau_gpuobj_destroy(&(p)->base)
+ nouveau_gpuobj_destroy(&(p)->gpuobj)
#define nouveau_fifo_context_init(p) \
- nouveau_gpuobj_init(&(p)->base)
+ nouveau_gpuobj_init(&(p)->gpuobj)
#define nouveau_fifo_context_fini(p,s) \
- nouveau_gpuobj_fini(&(p)->base, (s))
+ nouveau_gpuobj_fini(&(p)->gpuobj, (s))
#define _nouveau_fifo_context_dtor _nouveau_gpuobj_dtor
#define _nouveau_fifo_context_init _nouveau_gpuobj_init
pte <<= 3;
if (mem->tag) {
- struct nouveau_ltc *ltc =
- nouveau_ltc(vma->vm->vmm->base.base.parent);
+ struct nouveau_ltc *ltc = nouveau_ltc(vma->vm->vmm);
u32 tag = mem->tag->offset + (delta >> 17);
phys |= (u64)tag << (32 + 12);
next |= (u64)1 << (32 + 12);