diff options
Diffstat (limited to 'drm/nouveau/include/nvkm/core/namedb.h')
-rw-r--r-- | drm/nouveau/include/nvkm/core/namedb.h | 71 |
1 files changed, 34 insertions, 37 deletions
diff --git a/drm/nouveau/include/nvkm/core/namedb.h b/drm/nouveau/include/nvkm/core/namedb.h index 98e666b1e..4cfe16fcd 100644 --- a/drm/nouveau/include/nvkm/core/namedb.h +++ b/drm/nouveau/include/nvkm/core/namedb.h @@ -1,17 +1,15 @@ -#ifndef __NOUVEAU_NAMEDB_H__ -#define __NOUVEAU_NAMEDB_H__ - +#ifndef __NVKM_NAMEDB_H__ +#define __NVKM_NAMEDB_H__ #include <core/parent.h> +struct nvkm_handle; -struct nouveau_handle; - -struct nouveau_namedb { - struct nouveau_parent parent; +struct nvkm_namedb { + struct nvkm_parent parent; rwlock_t lock; struct list_head list; }; -static inline struct nouveau_namedb * +static inline struct nvkm_namedb * nv_namedb(void *obj) { #if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA @@ -21,36 +19,35 @@ nv_namedb(void *obj) return obj; } -#define nouveau_namedb_create(p,e,c,v,s,m,d) \ - nouveau_namedb_create_((p), (e), (c), (v), (s), (m), \ +#define nvkm_namedb_create(p,e,c,v,s,m,d) \ + nvkm_namedb_create_((p), (e), (c), (v), (s), (m), \ sizeof(**d), (void **)d) -#define nouveau_namedb_init(p) \ - nouveau_parent_init(&(p)->parent) -#define nouveau_namedb_fini(p,s) \ - nouveau_parent_fini(&(p)->parent, (s)) -#define nouveau_namedb_destroy(p) \ - nouveau_parent_destroy(&(p)->parent) - -int nouveau_namedb_create_(struct nouveau_object *, struct nouveau_object *, - struct nouveau_oclass *, u32 pclass, - struct nouveau_oclass *, u64 engcls, +#define nvkm_namedb_init(p) \ + nvkm_parent_init(&(p)->parent) +#define nvkm_namedb_fini(p,s) \ + nvkm_parent_fini(&(p)->parent, (s)) +#define nvkm_namedb_destroy(p) \ + nvkm_parent_destroy(&(p)->parent) + +int nvkm_namedb_create_(struct nvkm_object *, struct nvkm_object *, + struct nvkm_oclass *, u32 pclass, + struct nvkm_oclass *, u64 engcls, int size, void **); -int _nouveau_namedb_ctor(struct nouveau_object *, struct nouveau_object *, - struct nouveau_oclass *, void *, u32, - struct nouveau_object **); -#define _nouveau_namedb_dtor _nouveau_parent_dtor -#define _nouveau_namedb_init _nouveau_parent_init -#define _nouveau_namedb_fini _nouveau_parent_fini - -int nouveau_namedb_insert(struct nouveau_namedb *, u32 name, - struct nouveau_object *, struct nouveau_handle *); -void nouveau_namedb_remove(struct nouveau_handle *); - -struct nouveau_handle *nouveau_namedb_get(struct nouveau_namedb *, u32); -struct nouveau_handle *nouveau_namedb_get_class(struct nouveau_namedb *, u16); -struct nouveau_handle *nouveau_namedb_get_vinst(struct nouveau_namedb *, u64); -struct nouveau_handle *nouveau_namedb_get_cinst(struct nouveau_namedb *, u32); -void nouveau_namedb_put(struct nouveau_handle *); - +int _nvkm_namedb_ctor(struct nvkm_object *, struct nvkm_object *, + struct nvkm_oclass *, void *, u32, + struct nvkm_object **); +#define _nvkm_namedb_dtor _nvkm_parent_dtor +#define _nvkm_namedb_init _nvkm_parent_init +#define _nvkm_namedb_fini _nvkm_parent_fini + +int nvkm_namedb_insert(struct nvkm_namedb *, u32 name, struct nvkm_object *, + struct nvkm_handle *); +void nvkm_namedb_remove(struct nvkm_handle *); + +struct nvkm_handle *nvkm_namedb_get(struct nvkm_namedb *, u32); +struct nvkm_handle *nvkm_namedb_get_class(struct nvkm_namedb *, u16); +struct nvkm_handle *nvkm_namedb_get_vinst(struct nvkm_namedb *, u64); +struct nvkm_handle *nvkm_namedb_get_cinst(struct nvkm_namedb *, u32); +void nvkm_namedb_put(struct nvkm_handle *); #endif |