drm/nouveau/core: rename subclass.base to subclass.superclass
authorBen Skeggs <bskeggs@redhat.com>
Wed, 3 Dec 2014 02:56:41 +0000 (12:56 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 22 Jan 2015 02:14:43 +0000 (12:14 +1000)
Makes things a bit more readable.  This is specially important now as
upcoming commits are going to be gradually removing the use of macros
for down-casts, in favour of compile-time checking.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
23 files changed:
drivers/gpu/drm/nouveau/core/core/client.c
drivers/gpu/drm/nouveau/core/core/engctx.c
drivers/gpu/drm/nouveau/core/core/gpuobj.c
drivers/gpu/drm/nouveau/core/core/parent.c
drivers/gpu/drm/nouveau/core/core/subdev.c
drivers/gpu/drm/nouveau/core/engine/device/base.c
drivers/gpu/drm/nouveau/core/engine/fifo/base.c
drivers/gpu/drm/nouveau/core/engine/fifo/nv04.c
drivers/gpu/drm/nouveau/core/engine/fifo/nv17.c
drivers/gpu/drm/nouveau/core/engine/fifo/nv40.c
drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c
drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c
drivers/gpu/drm/nouveau/core/include/core/client.h
drivers/gpu/drm/nouveau/core/include/core/device.h
drivers/gpu/drm/nouveau/core/include/core/engctx.h
drivers/gpu/drm/nouveau/core/include/core/engine.h
drivers/gpu/drm/nouveau/core/include/core/gpuobj.h
drivers/gpu/drm/nouveau/core/include/core/namedb.h
drivers/gpu/drm/nouveau/core/include/core/parent.h
drivers/gpu/drm/nouveau/core/include/core/ramht.h
drivers/gpu/drm/nouveau/core/include/core/subdev.h
drivers/gpu/drm/nouveau/core/include/engine/fifo.h
drivers/gpu/drm/nouveau/core/subdev/vm/nvc0.c

index e962433294c317efb1e27f678d705092708c7e65..acff10387846d51f4fe4983a90873bf307cc7ade 100644 (file)
@@ -190,7 +190,7 @@ nouveau_client_dtor(struct nouveau_object *object)
                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
index 84c71fad2b6c921c9b2b86aaad676094b878f964..6b9c728053d056d90b875e2df88500fadc0230de 100644 (file)
@@ -125,10 +125,10 @@ nouveau_engctx_destroy(struct nouveau_engctx *engctx)
        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
@@ -140,7 +140,7 @@ nouveau_engctx_init(struct nouveau_engctx *engctx)
        struct nouveau_subdev *pardev;
        int ret;
 
-       ret = nouveau_gpuobj_init(&engctx->base);
+       ret = nouveau_gpuobj_init(&engctx->gpuobj);
        if (ret)
                return ret;
 
@@ -186,7 +186,7 @@ nouveau_engctx_fini(struct nouveau_engctx *engctx, bool suspend)
        }
 
        nv_debug(parent, "detached %s context\n", subdev->name);
-       return nouveau_gpuobj_fini(&engctx->base, suspend);
+       return nouveau_gpuobj_fini(&engctx->gpuobj, suspend);
 }
 
 int
index daee877025029d62b2023a5fe018d72cf6491d9a..0a9ea1fa9b55253411495a040302018f0a9d35b4 100644 (file)
@@ -47,7 +47,7 @@ nouveau_gpuobj_destroy(struct nouveau_gpuobj *gpuobj)
        if (gpuobj->heap.block_size)
                nouveau_mm_fini(&gpuobj->heap);
 
-       nouveau_object_destroy(&gpuobj->base);
+       nouveau_object_destroy(&gpuobj->object);
 }
 
 int
@@ -290,7 +290,7 @@ nouveau_gpudup_dtor(struct nouveau_object *object)
 {
        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
index 30a2911878f893fce40885f2aeb6d8b6bf4d60a3..07a2006a1d7840187646df252ae119455adf70bc 100644 (file)
@@ -150,7 +150,7 @@ nouveau_parent_destroy(struct nouveau_parent *parent)
                kfree(sclass);
        }
 
-       nouveau_object_destroy(&parent->base);
+       nouveau_object_destroy(&parent->object);
 }
 
 
index 2ea5568b6cf59be811fa6777612eca8b8180736b..28157bf57da15875cd300687aa93f52d300b694e 100644 (file)
@@ -38,11 +38,11 @@ nouveau_subdev_reset(struct nouveau_object *subdev)
 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;
 }
 
@@ -60,7 +60,7 @@ nouveau_subdev_fini(struct nouveau_subdev *subdev, bool suspend)
                nv_mask(subdev, 0x000200, subdev->unit, subdev->unit);
        }
 
-       return nouveau_object_fini(&subdev->base, suspend);
+       return nouveau_object_fini(&subdev->object, suspend);
 }
 
 int
@@ -74,7 +74,7 @@ nouveau_subdev_destroy(struct nouveau_subdev *subdev)
 {
        int subidx = nv_hclass(subdev) & 0xff;
        nv_device(subdev)->subdev[subidx] = NULL;
-       nouveau_object_destroy(&subdev->base);
+       nouveau_object_destroy(&subdev->object);
 }
 
 void
index 137e0b0faeae0d1b76ad9e5359c2eef9b66e0642..714a93eb1fd3d6dd85ef6384d30e5260d32089d4 100644 (file)
@@ -616,7 +616,7 @@ nouveau_device_dtor(struct nouveau_object *object)
        if (nv_subdev(device)->mmio)
                iounmap(nv_subdev(device)->mmio);
 
-       nouveau_engine_destroy(&device->base);
+       nouveau_engine_destroy(&device->engine);
 }
 
 resource_size_t
index ac8375cf4eef556cba4b8b1f2b90ac541a2c51e1..836c6d32e82e3eede1a5dfb162684ba78a7e58da 100644 (file)
@@ -127,7 +127,7 @@ nouveau_fifo_channel_destroy(struct nouveau_fifo_chan *chan)
 
        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
index 1931057f996205d68ca93c94805211536c31aa4d..6f51ae0daecf7f64562bac70488cda41b630f2b8 100644 (file)
@@ -629,7 +629,7 @@ nv04_fifo_init(struct nouveau_object *object)
 
        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);
 
index 12d76c8adb23ac5f84447825d150a30d42651514..01fbb11af00df33bf9e5ffde7afad635bd929a6a 100644 (file)
@@ -193,7 +193,7 @@ nv17_fifo_init(struct nouveau_object *object)
 
        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);
 
index 9f49c3a24dc66a819dbcd6e0bb36825d09971f96..604cb528663201e159d4d9487166c13f0157aafe 100644 (file)
@@ -314,7 +314,7 @@ nv40_fifo_init(struct nouveau_object *object)
 
        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) {
index 5d1e86bc244c31151079d18860a807249a8707ca..403fafc0507256378ff08ed5c2d708aa0663c72f 100644 (file)
@@ -246,7 +246,7 @@ nv50_fifo_chan_ctor_dma(struct nouveau_object *parent,
        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;
 }
@@ -310,7 +310,7 @@ nv50_fifo_chan_ctor_ind(struct nouveau_object *parent,
        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;
 }
index 1f42996b354a3b356c2c9a89425ea7a13e677d5a..b18386b8a842e4eca71e1aae3d0d4fd8e23c2525 100644 (file)
@@ -219,7 +219,7 @@ nv84_fifo_chan_ctor_dma(struct nouveau_object *parent,
        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);
@@ -292,7 +292,7 @@ nv84_fifo_chan_ctor_ind(struct nouveau_object *parent,
        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);
index b0ce9f6680b5ea2f67c160a2cd64180a28324ce4..827c4e972ed3b59890bd702e17e3a2d722acde6e 100644 (file)
@@ -4,7 +4,7 @@
 #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];
index 2ec2e50d3676607208ac8c1e5c5e58fc7ca9596a..33b35c487cba6819723582acde7f1b0bb282fe24 100644 (file)
@@ -64,7 +64,7 @@ enum nv_subdev_type {
 };
 
 struct nouveau_device {
-       struct nouveau_engine base;
+       struct nouveau_engine engine;
        struct list_head head;
 
        struct pci_dev *pdev;
index 2fd48b564c7d446aebded689b1597b7a8de99c4b..dbc6a3e6dd44bf3f303390678c99e2125aa60d87 100644 (file)
@@ -10,7 +10,7 @@
 #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;
index 666d06de77ecea79649b240ef8af4cbd9af94364..8945755eeec04496ae000f49944cf35e9cb6c036 100644 (file)
@@ -8,7 +8,7 @@
 #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;
 
@@ -40,11 +40,11 @@ nv_engidx(struct nouveau_object *object)
                               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 *,
index b3b9ce4e9d3873a903e2448f7217da9b513771ad..c262c25051644a51ef6be7635bff41ddf95bacc0 100644 (file)
@@ -14,7 +14,7 @@ struct nouveau_vm;
 #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;
@@ -37,8 +37,8 @@ nv_gpuobj(void *obj)
 #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,
@@ -59,7 +59,7 @@ void nouveau_gpuobj_unmap(struct nouveau_vma *);
 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 *);
index f5b5fd8e1fc9083b9f72a5b7ddb985a3fc0f6d0e..98e666b1e37512e401008875c4c4df142e93ac3a 100644 (file)
@@ -6,7 +6,7 @@
 struct nouveau_handle;
 
 struct nouveau_namedb {
-       struct nouveau_parent base;
+       struct nouveau_parent parent;
        rwlock_t lock;
        struct list_head list;
 };
@@ -25,11 +25,11 @@ nv_namedb(void *obj)
        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,
index 12da418ec70a2c29ef968aea14f692eb87197ee9..4e2345a5cfdb690f45126a564da1de20d47184f4 100644 (file)
@@ -11,7 +11,7 @@ struct nouveau_sclass {
 };
 
 struct nouveau_parent {
-       struct nouveau_object base;
+       struct nouveau_object object;
 
        struct nouveau_sclass *sclass;
        u64 engine;
@@ -40,9 +40,9 @@ nv_parent(void *obj)
        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,
index 47e4cacbca3798e7a4a2c2ef4a0eefd10ff1205e..e51014337ebe99b5d476b6b24f8e8c157fcc91c9 100644 (file)
@@ -4,7 +4,7 @@
 #include <core/gpuobj.h>
 
 struct nouveau_ramht {
-       struct nouveau_gpuobj base;
+       struct nouveau_gpuobj gpuobj;
        int bits;
 };
 
@@ -17,7 +17,7 @@ int  nouveau_ramht_new(struct nouveau_object *, struct nouveau_object *,
 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
index e9632e9316169825525d050c6b1fd8189818b756..c24d64ba9a6bd1b5f144385e4bb54b1d1bb860cd 100644 (file)
@@ -7,7 +7,7 @@
 #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;
index c52b939f52f0ab1e303c8fa44c7d63fed5074390..27f05de8fd0a639cb861edd814402b82d37eefb2 100644 (file)
@@ -7,7 +7,7 @@
 #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;
@@ -27,9 +27,9 @@ nouveau_fifo_chan(void *obj)
        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 *,
@@ -48,17 +48,17 @@ void _nouveau_fifo_channel_wr32(struct nouveau_object *, u64, u32);
 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
index 2d0988755530d1d03ba4322232a565493d2edf03..c0a3389204fa5dcb0325faeab6d544797e9549fc 100644 (file)
@@ -116,8 +116,7 @@ nvc0_vm_map(struct nouveau_vma *vma, struct nouveau_gpuobj *pgt,
        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);
This page took 0.037577 seconds and 5 git commands to generate.