summaryrefslogtreecommitdiff
path: root/nvkm/include
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2014-12-03 12:56:41 +1000
committerBen Skeggs <bskeggs@redhat.com>2015-01-10 23:57:06 +1000
commit223b3b8d88982f7c7b102e66fd2fe7f3b4228eec (patch)
treeb06bd30ca2e93fede258374c34228f81d9aa8e40 /nvkm/include
parent8b18b785ebe9262162422930f9ddea9b5dd9d4b3 (diff)
downloadnouveau-223b3b8d88982f7c7b102e66fd2fe7f3b4228eec.tar.gz
core: rename subclass.base to subclass.superclass
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>
Diffstat (limited to 'nvkm/include')
-rw-r--r--nvkm/include/core/client.h2
-rw-r--r--nvkm/include/core/device.h2
-rw-r--r--nvkm/include/core/engctx.h2
-rw-r--r--nvkm/include/core/engine.h8
-rw-r--r--nvkm/include/core/gpuobj.h8
-rw-r--r--nvkm/include/core/memobj.h32
-rw-r--r--nvkm/include/core/namedb.h8
-rw-r--r--nvkm/include/core/parent.h6
-rw-r--r--nvkm/include/core/ramht.h4
-rw-r--r--nvkm/include/core/subdev.h2
-rw-r--r--nvkm/include/engine/fifo.h14
11 files changed, 28 insertions, 60 deletions
diff --git a/nvkm/include/core/client.h b/nvkm/include/core/client.h
index b0ce9f668..827c4e972 100644
--- a/nvkm/include/core/client.h
+++ b/nvkm/include/core/client.h
@@ -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];
diff --git a/nvkm/include/core/device.h b/nvkm/include/core/device.h
index 2ec2e50d3..33b35c487 100644
--- a/nvkm/include/core/device.h
+++ b/nvkm/include/core/device.h
@@ -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;
diff --git a/nvkm/include/core/engctx.h b/nvkm/include/core/engctx.h
index 2fd48b564..dbc6a3e6d 100644
--- a/nvkm/include/core/engctx.h
+++ b/nvkm/include/core/engctx.h
@@ -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;
diff --git a/nvkm/include/core/engine.h b/nvkm/include/core/engine.h
index 666d06de7..8945755ee 100644
--- a/nvkm/include/core/engine.h
+++ b/nvkm/include/core/engine.h
@@ -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 *,
diff --git a/nvkm/include/core/gpuobj.h b/nvkm/include/core/gpuobj.h
index b3b9ce4e9..c262c2505 100644
--- a/nvkm/include/core/gpuobj.h
+++ b/nvkm/include/core/gpuobj.h
@@ -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 *);
diff --git a/nvkm/include/core/memobj.h b/nvkm/include/core/memobj.h
deleted file mode 100644
index 7ca7d9320..000000000
--- a/nvkm/include/core/memobj.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef __NOUVEAU_MEMOBJ_H__
-#define __NOUVEAU_MEMOBJ_H__
-
-#include <core/object.h>
-#include <core/mm.h>
-
-struct nouveau_memobj {
- struct nouveau_object base;
- struct nouveau_mm heap;
- u32 *suspend;
- u64 addr;
-};
-
-static inline struct nouveau_memobj *
-nv_memobj(void *obj)
-{
-#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA
- if (unlikely(!nv_iclass(obj, NV_MEMOBJ_CLASS)))
- nv_assert("BAD CAST -> NvMemObj, %08x", nv_hclass(obj));
-#endif
- return obj;
-}
-
-#define nouveau_memobj_create(p,e,c,d) \
- nouveau_object_create_((p), (e), (c), NV_MEMOBJ_CLASS, \
- sizeof(**d), (void **)d)
-#define nouveau_memobj_destroy(p) nouveau_object_destroy(&(p)->base)
-
-int nouveau_memobj_init(struct nouveau_memobj *);
-int nouveau_memobj_fini(struct nouveau_memobj *, bool suspend);
-
-#endif
diff --git a/nvkm/include/core/namedb.h b/nvkm/include/core/namedb.h
index f5b5fd8e1..98e666b1e 100644
--- a/nvkm/include/core/namedb.h
+++ b/nvkm/include/core/namedb.h
@@ -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,
diff --git a/nvkm/include/core/parent.h b/nvkm/include/core/parent.h
index 12da418ec..4e2345a5c 100644
--- a/nvkm/include/core/parent.h
+++ b/nvkm/include/core/parent.h
@@ -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,
diff --git a/nvkm/include/core/ramht.h b/nvkm/include/core/ramht.h
index 47e4cacbc..e51014337 100644
--- a/nvkm/include/core/ramht.h
+++ b/nvkm/include/core/ramht.h
@@ -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
diff --git a/nvkm/include/core/subdev.h b/nvkm/include/core/subdev.h
index e9632e931..c24d64ba9 100644
--- a/nvkm/include/core/subdev.h
+++ b/nvkm/include/core/subdev.h
@@ -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;
diff --git a/nvkm/include/engine/fifo.h b/nvkm/include/engine/fifo.h
index c52b939f5..27f05de8f 100644
--- a/nvkm/include/engine/fifo.h
+++ b/nvkm/include/engine/fifo.h
@@ -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