diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-01-14 14:11:21 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-01-22 12:17:49 +1000 |
commit | 5025407b9862349d17b1dff25737aaef6520a439 (patch) | |
tree | 6d11493365d06c00d79daf5818b42dfa2d421c1e /drivers/gpu/drm/nouveau/include | |
parent | 989aa5b76ad2af7653353cf01bdebec2ba9436aa (diff) |
drm/nouveau/core: namespace + nvidia gpu names (no binary change)
The namespace of NVKM is being changed to nvkm_ instead of nouveau_,
which will be used for the DRM part of the driver. This is being
done in order to make it very clear as to what part of the driver a
given symbol belongs to, and as a minor step towards splitting the
DRM driver out to be able to stand on its own (for virt).
Because there's already a large amount of churn here anyway, this is
as good a time as any to also switch to NVIDIA's device and chipset
naming to ease collaboration with them.
A comparison of objdump disassemblies proves no code changes.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/include')
24 files changed, 605 insertions, 464 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/client.h b/drivers/gpu/drm/nouveau/include/nvkm/core/client.h index 827c4e972ed3..a35b38244502 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/client.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/client.h @@ -1,15 +1,14 @@ -#ifndef __NOUVEAU_CLIENT_H__ -#define __NOUVEAU_CLIENT_H__ - +#ifndef __NVKM_CLIENT_H__ +#define __NVKM_CLIENT_H__ #include <core/namedb.h> -struct nouveau_client { - struct nouveau_namedb namedb; - struct nouveau_handle *root; - struct nouveau_object *device; +struct nvkm_client { + struct nvkm_namedb namedb; + struct nvkm_handle *root; + struct nvkm_object *device; char name[32]; u32 debug; - struct nouveau_vm *vm; + struct nvkm_vm *vm; bool super; void *data; @@ -17,7 +16,7 @@ struct nouveau_client { struct nvkm_client_notify *notify[16]; }; -static inline struct nouveau_client * +static inline struct nvkm_client * nv_client(void *obj) { #if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA @@ -27,31 +26,30 @@ nv_client(void *obj) return obj; } -static inline struct nouveau_client * -nouveau_client(void *obj) +static inline struct nvkm_client * +nvkm_client(void *obj) { - struct nouveau_object *client = nv_object(obj); + struct nvkm_object *client = nv_object(obj); while (client && !(nv_iclass(client, NV_CLIENT_CLASS))) client = client->parent; return (void *)client; } -#define nouveau_client_create(n,c,oc,od,d) \ - nouveau_client_create_((n), (c), (oc), (od), sizeof(**d), (void **)d) +#define nvkm_client_create(n,c,oc,od,d) \ + nvkm_client_create_((n), (c), (oc), (od), sizeof(**d), (void **)d) -int nouveau_client_create_(const char *name, u64 device, const char *cfg, +int nvkm_client_create_(const char *name, u64 device, const char *cfg, const char *dbg, int, void **); -#define nouveau_client_destroy(p) \ - nouveau_namedb_destroy(&(p)->base) +#define nvkm_client_destroy(p) \ + nvkm_namedb_destroy(&(p)->base) -int nouveau_client_init(struct nouveau_client *); -int nouveau_client_fini(struct nouveau_client *, bool suspend); -const char *nouveau_client_name(void *obj); +int nvkm_client_init(struct nvkm_client *); +int nvkm_client_fini(struct nvkm_client *, bool suspend); +const char *nvkm_client_name(void *obj); -int nvkm_client_notify_new(struct nouveau_object *, struct nvkm_event *, +int nvkm_client_notify_new(struct nvkm_object *, struct nvkm_event *, void *data, u32 size); -int nvkm_client_notify_del(struct nouveau_client *, int index); -int nvkm_client_notify_get(struct nouveau_client *, int index); -int nvkm_client_notify_put(struct nouveau_client *, int index); - +int nvkm_client_notify_del(struct nvkm_client *, int index); +int nvkm_client_notify_get(struct nvkm_client *, int index); +int nvkm_client_notify_put(struct nvkm_client *, int index); #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/debug.h b/drivers/gpu/drm/nouveau/include/nvkm/core/debug.h index 8092e2e90323..d07cb860b56c 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/debug.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/debug.h @@ -1,6 +1,5 @@ -#ifndef __NOUVEAU_DEBUG_H__ -#define __NOUVEAU_DEBUG_H__ - +#ifndef __NVKM_DEBUG_H__ +#define __NVKM_DEBUG_H__ extern int nv_info_debug_level; #define NV_DBG_FATAL 0 @@ -16,5 +15,4 @@ extern int nv_info_debug_level; #define NV_DBG_INFO_SILENT NV_DBG_DEBUG #define nv_debug_level(a) nv_info_debug_level = NV_DBG_INFO_##a - #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h index 23d71c58c3f1..9c2f13694a57 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h @@ -1,13 +1,10 @@ -#ifndef __NOUVEAU_DEVICE_H__ -#define __NOUVEAU_DEVICE_H__ - -#include <core/object.h> -#include <core/subdev.h> +#ifndef __NVKM_DEVICE_H__ +#define __NVKM_DEVICE_H__ #include <core/engine.h> #include <core/event.h> -struct nouveau_device { - struct nouveau_engine engine; +struct nvkm_device { + struct nvkm_engine engine; struct list_head head; struct pci_dev *pdev; @@ -38,53 +35,53 @@ struct nouveau_device { u8 chiprev; u32 crystal; - struct nouveau_oclass *oclass[NVDEV_SUBDEV_NR]; - struct nouveau_object *subdev[NVDEV_SUBDEV_NR]; + struct nvkm_oclass *oclass[NVDEV_SUBDEV_NR]; + struct nvkm_object *subdev[NVDEV_SUBDEV_NR]; struct { struct notifier_block nb; } acpi; }; -int nouveau_device_list(u64 *name, int size); +struct nvkm_device *nvkm_device_find(u64 name); +int nvkm_device_list(u64 *name, int size); -struct nouveau_device *nv_device(void *obj); +struct nvkm_device *nv_device(void *obj); static inline bool -nv_device_match(struct nouveau_object *object, u16 dev, u16 ven, u16 sub) +nv_device_match(struct nvkm_object *object, u16 dev, u16 ven, u16 sub) { - struct nouveau_device *device = nv_device(object); + struct nvkm_device *device = nv_device(object); return device->pdev->device == dev && device->pdev->subsystem_vendor == ven && device->pdev->subsystem_device == sub; } static inline bool -nv_device_is_pci(struct nouveau_device *device) +nv_device_is_pci(struct nvkm_device *device) { return device->pdev != NULL; } static inline bool -nv_device_is_cpu_coherent(struct nouveau_device *device) +nv_device_is_cpu_coherent(struct nvkm_device *device) { return (!IS_ENABLED(CONFIG_ARM) && nv_device_is_pci(device)); } static inline struct device * -nv_device_base(struct nouveau_device *device) +nv_device_base(struct nvkm_device *device) { return nv_device_is_pci(device) ? &device->pdev->dev : &device->platformdev->dev; } resource_size_t -nv_device_resource_start(struct nouveau_device *device, unsigned int bar); +nv_device_resource_start(struct nvkm_device *device, unsigned int bar); resource_size_t -nv_device_resource_len(struct nouveau_device *device, unsigned int bar); +nv_device_resource_len(struct nvkm_device *device, unsigned int bar); int -nv_device_get_irq(struct nouveau_device *device, bool stall); - +nv_device_get_irq(struct nvkm_device *device, bool stall); #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/engctx.h b/drivers/gpu/drm/nouveau/include/nvkm/core/engctx.h index 9d696e4747e7..1bf2e8eb4268 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/engctx.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/engctx.h @@ -1,7 +1,5 @@ -#ifndef __NOUVEAU_ENGCTX_H__ -#define __NOUVEAU_ENGCTX_H__ - -#include <core/object.h> +#ifndef __NVKM_ENGCTX_H__ +#define __NVKM_ENGCTX_H__ #include <core/gpuobj.h> #include <subdev/mmu.h> @@ -9,15 +7,15 @@ #define NV_ENGCTX_(eng,var) (NV_ENGCTX_CLASS | ((var) << 8) | (eng)) #define NV_ENGCTX(name,var) NV_ENGCTX_(NVDEV_ENGINE_##name, (var)) -struct nouveau_engctx { - struct nouveau_gpuobj gpuobj; - struct nouveau_vma vma; +struct nvkm_engctx { + struct nvkm_gpuobj gpuobj; + struct nvkm_vma vma; struct list_head head; unsigned long save; u64 addr; }; -static inline struct nouveau_engctx * +static inline struct nvkm_engctx * nv_engctx(void *obj) { #if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA @@ -27,28 +25,27 @@ nv_engctx(void *obj) return obj; } -#define nouveau_engctx_create(p,e,c,g,s,a,f,d) \ - nouveau_engctx_create_((p), (e), (c), (g), (s), (a), (f), \ +#define nvkm_engctx_create(p,e,c,g,s,a,f,d) \ + nvkm_engctx_create_((p), (e), (c), (g), (s), (a), (f), \ sizeof(**d), (void **)d) -int nouveau_engctx_create_(struct nouveau_object *, struct nouveau_object *, - struct nouveau_oclass *, struct nouveau_object *, +int nvkm_engctx_create_(struct nvkm_object *, struct nvkm_object *, + struct nvkm_oclass *, struct nvkm_object *, u32 size, u32 align, u32 flags, int length, void **data); -void nouveau_engctx_destroy(struct nouveau_engctx *); -int nouveau_engctx_init(struct nouveau_engctx *); -int nouveau_engctx_fini(struct nouveau_engctx *, bool suspend); - -int _nouveau_engctx_ctor(struct nouveau_object *, struct nouveau_object *, - struct nouveau_oclass *, void *, u32, - struct nouveau_object **); -void _nouveau_engctx_dtor(struct nouveau_object *); -int _nouveau_engctx_init(struct nouveau_object *); -int _nouveau_engctx_fini(struct nouveau_object *, bool suspend); -#define _nouveau_engctx_rd32 _nouveau_gpuobj_rd32 -#define _nouveau_engctx_wr32 _nouveau_gpuobj_wr32 - -struct nouveau_object *nouveau_engctx_get(struct nouveau_engine *, u64 addr); -void nouveau_engctx_put(struct nouveau_object *); - +void nvkm_engctx_destroy(struct nvkm_engctx *); +int nvkm_engctx_init(struct nvkm_engctx *); +int nvkm_engctx_fini(struct nvkm_engctx *, bool suspend); + +int _nvkm_engctx_ctor(struct nvkm_object *, struct nvkm_object *, + struct nvkm_oclass *, void *, u32, + struct nvkm_object **); +void _nvkm_engctx_dtor(struct nvkm_object *); +int _nvkm_engctx_init(struct nvkm_object *); +int _nvkm_engctx_fini(struct nvkm_object *, bool suspend); +#define _nvkm_engctx_rd32 _nvkm_gpuobj_rd32 +#define _nvkm_engctx_wr32 _nvkm_gpuobj_wr32 + +struct nvkm_object *nvkm_engctx_get(struct nvkm_engine *, u64 addr); +void nvkm_engctx_put(struct nvkm_object *); #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/engine.h b/drivers/gpu/drm/nouveau/include/nvkm/core/engine.h index d7ebd35ef1ad..faf0fd2f0638 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/engine.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/engine.h @@ -1,25 +1,23 @@ -#ifndef __NOUVEAU_ENGINE_H__ -#define __NOUVEAU_ENGINE_H__ - -#include <core/object.h> +#ifndef __NVKM_ENGINE_H__ +#define __NVKM_ENGINE_H__ #include <core/subdev.h> #define NV_ENGINE_(eng,var) (NV_ENGINE_CLASS | ((var) << 8) | (eng)) #define NV_ENGINE(name,var) NV_ENGINE_(NVDEV_ENGINE_##name, (var)) -struct nouveau_engine { - struct nouveau_subdev subdev; - struct nouveau_oclass *cclass; - struct nouveau_oclass *sclass; +struct nvkm_engine { + struct nvkm_subdev subdev; + struct nvkm_oclass *cclass; + struct nvkm_oclass *sclass; struct list_head contexts; spinlock_t lock; - void (*tile_prog)(struct nouveau_engine *, int region); - int (*tlb_flush)(struct nouveau_engine *); + void (*tile_prog)(struct nvkm_engine *, int region); + int (*tlb_flush)(struct nvkm_engine *); }; -static inline struct nouveau_engine * +static inline struct nvkm_engine * nv_engine(void *obj) { #if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA @@ -30,30 +28,29 @@ nv_engine(void *obj) } static inline int -nv_engidx(struct nouveau_engine *engine) +nv_engidx(struct nvkm_engine *engine) { return nv_subidx(&engine->subdev); } -struct nouveau_engine *nouveau_engine(void *obj, int idx); +struct nvkm_engine *nvkm_engine(void *obj, int idx); -#define nouveau_engine_create(p,e,c,d,i,f,r) \ - nouveau_engine_create_((p), (e), (c), (d), (i), (f), \ +#define nvkm_engine_create(p,e,c,d,i,f,r) \ + nvkm_engine_create_((p), (e), (c), (d), (i), (f), \ sizeof(**r),(void **)r) -#define nouveau_engine_destroy(p) \ - nouveau_subdev_destroy(&(p)->subdev) -#define nouveau_engine_init(p) \ - nouveau_subdev_init(&(p)->subdev) -#define nouveau_engine_fini(p,s) \ - nouveau_subdev_fini(&(p)->subdev, (s)) +#define nvkm_engine_destroy(p) \ + nvkm_subdev_destroy(&(p)->subdev) +#define nvkm_engine_init(p) \ + nvkm_subdev_init(&(p)->subdev) +#define nvkm_engine_fini(p,s) \ + nvkm_subdev_fini(&(p)->subdev, (s)) -int nouveau_engine_create_(struct nouveau_object *, struct nouveau_object *, - struct nouveau_oclass *, bool, const char *, +int nvkm_engine_create_(struct nvkm_object *, struct nvkm_object *, + struct nvkm_oclass *, bool, const char *, const char *, int, void **); -#define _nouveau_engine_dtor _nouveau_subdev_dtor -#define _nouveau_engine_init _nouveau_subdev_init -#define _nouveau_engine_fini _nouveau_subdev_fini - +#define _nvkm_engine_dtor _nvkm_subdev_dtor +#define _nvkm_engine_init _nvkm_subdev_init +#define _nvkm_engine_fini _nvkm_subdev_fini #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/enum.h b/drivers/gpu/drm/nouveau/include/nvkm/core/enum.h index 4fc62bb8c1f0..e76f76f115e9 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/enum.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/enum.h @@ -1,24 +1,21 @@ -#ifndef __NOUVEAU_ENUM_H__ -#define __NOUVEAU_ENUM_H__ +#ifndef __NVKM_ENUM_H__ +#define __NVKM_ENUM_H__ +#include <core/os.h> -struct nouveau_enum { +struct nvkm_enum { u32 value; const char *name; const void *data; u32 data2; }; -const struct nouveau_enum * -nouveau_enum_find(const struct nouveau_enum *, u32 value); +const struct nvkm_enum *nvkm_enum_find(const struct nvkm_enum *, u32 value); +const struct nvkm_enum *nvkm_enum_print(const struct nvkm_enum *, u32 value); -const struct nouveau_enum * -nouveau_enum_print(const struct nouveau_enum *en, u32 value); - -struct nouveau_bitfield { +struct nvkm_bitfield { u32 mask; const char *name; }; -void nouveau_bitfield_print(const struct nouveau_bitfield *, u32 value); - +void nvkm_bitfield_print(const struct nvkm_bitfield *, u32 value); #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/event.h b/drivers/gpu/drm/nouveau/include/nvkm/core/event.h index 92876528972f..b98fe2de546a 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/event.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/event.h @@ -1,15 +1,8 @@ #ifndef __NVKM_EVENT_H__ #define __NVKM_EVENT_H__ - -#include <core/notify.h> - -struct nvkm_event_func { - int (*ctor)(struct nouveau_object *, void *data, u32 size, - struct nvkm_notify *); - void (*send)(void *data, u32 size, struct nvkm_notify *); - void (*init)(struct nvkm_event *, int type, int index); - void (*fini)(struct nvkm_event *, int type, int index); -}; +#include <core/os.h> +struct nvkm_notify; +struct nvkm_object; struct nvkm_event { const struct nvkm_event_func *func; @@ -23,13 +16,19 @@ struct nvkm_event { int *refs; }; -int nvkm_event_init(const struct nvkm_event_func *func, - int types_nr, int index_nr, - struct nvkm_event *); +struct nvkm_event_func { + int (*ctor)(struct nvkm_object *, void *data, u32 size, + struct nvkm_notify *); + void (*send)(void *data, u32 size, struct nvkm_notify *); + void (*init)(struct nvkm_event *, int type, int index); + void (*fini)(struct nvkm_event *, int type, int index); +}; + +int nvkm_event_init(const struct nvkm_event_func *func, int types_nr, + int index_nr, struct nvkm_event *); void nvkm_event_fini(struct nvkm_event *); void nvkm_event_get(struct nvkm_event *, u32 types, int index); void nvkm_event_put(struct nvkm_event *, u32 types, int index); void nvkm_event_send(struct nvkm_event *, u32 types, int index, void *data, u32 size); - #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/gpuobj.h b/drivers/gpu/drm/nouveau/include/nvkm/core/gpuobj.h index c262c2505164..e0187e7abb6e 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/gpuobj.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/gpuobj.h @@ -1,30 +1,26 @@ -#ifndef __NOUVEAU_GPUOBJ_H__ -#define __NOUVEAU_GPUOBJ_H__ - +#ifndef __NVKM_GPUOBJ_H__ +#define __NVKM_GPUOBJ_H__ #include <core/object.h> -#include <core/device.h> -#include <core/parent.h> #include <core/mm.h> - -struct nouveau_vma; -struct nouveau_vm; +struct nvkm_vma; +struct nvkm_vm; #define NVOBJ_FLAG_ZERO_ALLOC 0x00000001 #define NVOBJ_FLAG_ZERO_FREE 0x00000002 #define NVOBJ_FLAG_HEAP 0x00000004 -struct nouveau_gpuobj { - struct nouveau_object object; - struct nouveau_object *parent; - struct nouveau_mm_node *node; - struct nouveau_mm heap; +struct nvkm_gpuobj { + struct nvkm_object object; + struct nvkm_object *parent; + struct nvkm_mm_node *node; + struct nvkm_mm heap; u32 flags; u64 addr; u32 size; }; -static inline struct nouveau_gpuobj * +static inline struct nvkm_gpuobj * nv_gpuobj(void *obj) { #if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA @@ -34,38 +30,35 @@ nv_gpuobj(void *obj) return 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), \ +#define nvkm_gpuobj_create(p,e,c,v,g,s,a,f,d) \ + nvkm_gpuobj_create_((p), (e), (c), (v), (g), (s), (a), (f), \ sizeof(**d), (void **)d) -#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, +#define nvkm_gpuobj_init(p) nvkm_object_init(&(p)->object) +#define nvkm_gpuobj_fini(p,s) nvkm_object_fini(&(p)->object, (s)) +int nvkm_gpuobj_create_(struct nvkm_object *, struct nvkm_object *, + struct nvkm_oclass *, u32 pclass, + struct nvkm_object *, u32 size, u32 align, u32 flags, int length, void **); -void nouveau_gpuobj_destroy(struct nouveau_gpuobj *); +void nvkm_gpuobj_destroy(struct nvkm_gpuobj *); -int nouveau_gpuobj_new(struct nouveau_object *, struct nouveau_object *, - u32 size, u32 align, u32 flags, - struct nouveau_gpuobj **); -int nouveau_gpuobj_dup(struct nouveau_object *, struct nouveau_gpuobj *, - struct nouveau_gpuobj **); - -int nouveau_gpuobj_map(struct nouveau_gpuobj *, u32 acc, struct nouveau_vma *); -int nouveau_gpuobj_map_vm(struct nouveau_gpuobj *, struct nouveau_vm *, - u32 access, struct nouveau_vma *); -void nouveau_gpuobj_unmap(struct nouveau_vma *); +int nvkm_gpuobj_new(struct nvkm_object *, struct nvkm_object *, u32 size, + u32 align, u32 flags, struct nvkm_gpuobj **); +int nvkm_gpuobj_dup(struct nvkm_object *, struct nvkm_gpuobj *, + struct nvkm_gpuobj **); +int nvkm_gpuobj_map(struct nvkm_gpuobj *, u32 acc, struct nvkm_vma *); +int nvkm_gpuobj_map_vm(struct nvkm_gpuobj *, struct nvkm_vm *, u32 access, + struct nvkm_vma *); +void nvkm_gpuobj_unmap(struct nvkm_vma *); static inline void -nouveau_gpuobj_ref(struct nouveau_gpuobj *obj, struct nouveau_gpuobj **ref) +nvkm_gpuobj_ref(struct nvkm_gpuobj *obj, struct nvkm_gpuobj **ref) { - nouveau_object_ref(&obj->object, (struct nouveau_object **)ref); + nvkm_object_ref(&obj->object, (struct nvkm_object **)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 *, u64); -void _nouveau_gpuobj_wr32(struct nouveau_object *, u64, u32); - +void _nvkm_gpuobj_dtor(struct nvkm_object *); +int _nvkm_gpuobj_init(struct nvkm_object *); +int _nvkm_gpuobj_fini(struct nvkm_object *, bool); +u32 _nvkm_gpuobj_rd32(struct nvkm_object *, u64); +void _nvkm_gpuobj_wr32(struct nvkm_object *, u64, u32); #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/handle.h b/drivers/gpu/drm/nouveau/include/nvkm/core/handle.h index d22a59138a9b..67f384d0916c 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/handle.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/handle.h @@ -1,8 +1,10 @@ -#ifndef __NOUVEAU_HANDLE_H__ -#define __NOUVEAU_HANDLE_H__ +#ifndef __NVKM_HANDLE_H__ +#define __NVKM_HANDLE_H__ +#include <core/os.h> +struct nvkm_object; -struct nouveau_handle { - struct nouveau_namedb *namedb; +struct nvkm_handle { + struct nvkm_namedb *namedb; struct list_head node; struct list_head head; @@ -13,22 +15,20 @@ struct nouveau_handle { u8 route; u64 token; - struct nouveau_handle *parent; - struct nouveau_object *object; + struct nvkm_handle *parent; + struct nvkm_object *object; }; -int nouveau_handle_create(struct nouveau_object *, u32 parent, u32 handle, - struct nouveau_object *, struct nouveau_handle **); -void nouveau_handle_destroy(struct nouveau_handle *); -int nouveau_handle_init(struct nouveau_handle *); -int nouveau_handle_fini(struct nouveau_handle *, bool suspend); +int nvkm_handle_create(struct nvkm_object *, u32 parent, u32 handle, + struct nvkm_object *, struct nvkm_handle **); +void nvkm_handle_destroy(struct nvkm_handle *); +int nvkm_handle_init(struct nvkm_handle *); +int nvkm_handle_fini(struct nvkm_handle *, bool suspend); -struct nouveau_object * -nouveau_handle_ref(struct nouveau_object *, u32 name); - -struct nouveau_handle *nouveau_handle_get_class(struct nouveau_object *, u16); -struct nouveau_handle *nouveau_handle_get_vinst(struct nouveau_object *, u64); -struct nouveau_handle *nouveau_handle_get_cinst(struct nouveau_object *, u32); -void nouveau_handle_put(struct nouveau_handle *); +struct nvkm_object *nvkm_handle_ref(struct nvkm_object *, u32 name); +struct nvkm_handle *nvkm_handle_get_class(struct nvkm_object *, u16); +struct nvkm_handle *nvkm_handle_get_vinst(struct nvkm_object *, u64); +struct nvkm_handle *nvkm_handle_get_cinst(struct nvkm_object *, u32); +void nvkm_handle_put(struct nvkm_handle *); #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/ioctl.h b/drivers/gpu/drm/nouveau/include/nvkm/core/ioctl.h index ac7935c2474e..88971eb37afa 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/ioctl.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/ioctl.h @@ -1,6 +1,7 @@ #ifndef __NVKM_IOCTL_H__ #define __NVKM_IOCTL_H__ +#include <core/os.h> +struct nvkm_client; -int nvkm_ioctl(struct nouveau_client *, bool, void *, u32, void **); - +int nvkm_ioctl(struct nvkm_client *, bool, void *, u32, void **); #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/mm.h b/drivers/gpu/drm/nouveau/include/nvkm/core/mm.h index bfe6931544fe..096eb1a623ee 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/mm.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/mm.h @@ -1,7 +1,8 @@ -#ifndef __NOUVEAU_MM_H__ -#define __NOUVEAU_MM_H__ +#ifndef __NVKM_MM_H__ +#define __NVKM_MM_H__ +#include <core/os.h> -struct nouveau_mm_node { +struct nvkm_mm_node { struct list_head nl_entry; struct list_head fl_entry; struct list_head rl_entry; @@ -15,7 +16,7 @@ struct nouveau_mm_node { u32 length; }; -struct nouveau_mm { +struct nvkm_mm { struct list_head nodes; struct list_head free; @@ -24,17 +25,16 @@ struct nouveau_mm { }; static inline bool -nouveau_mm_initialised(struct nouveau_mm *mm) +nvkm_mm_initialised(struct nvkm_mm *mm) { return mm->block_size != 0; } -int nouveau_mm_init(struct nouveau_mm *, u32 offset, u32 length, u32 block); -int nouveau_mm_fini(struct nouveau_mm *); -int nouveau_mm_head(struct nouveau_mm *, u8 heap, u8 type, u32 size_max, - u32 size_min, u32 align, struct nouveau_mm_node **); -int nouveau_mm_tail(struct nouveau_mm *, u8 heap, u8 type, u32 size_max, - u32 size_min, u32 align, struct nouveau_mm_node **); -void nouveau_mm_free(struct nouveau_mm *, struct nouveau_mm_node **); - +int nvkm_mm_init(struct nvkm_mm *, u32 offset, u32 length, u32 block); +int nvkm_mm_fini(struct nvkm_mm *); +int nvkm_mm_head(struct nvkm_mm *, u8 heap, u8 type, u32 size_max, + u32 size_min, u32 align, struct nvkm_mm_node **); +int nvkm_mm_tail(struct nvkm_mm *, u8 heap, u8 type, u32 size_max, + u32 size_min, u32 align, struct nvkm_mm_node **); +void nvkm_mm_free(struct nvkm_mm *, struct nvkm_mm_node **); #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/namedb.h b/drivers/gpu/drm/nouveau/include/nvkm/core/namedb.h index 98e666b1e375..4cfe16fcde9b 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/namedb.h +++ b/drivers/gpu/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 diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/notify.h b/drivers/gpu/drm/nouveau/include/nvkm/core/notify.h index a7c3c5f578cc..753d08c1767b 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/notify.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/notify.h @@ -1,5 +1,7 @@ #ifndef __NVKM_NOTIFY_H__ #define __NVKM_NOTIFY_H__ +#include <core/os.h> +struct nvkm_object; struct nvkm_notify { struct nvkm_event *event; @@ -25,7 +27,7 @@ struct nvkm_notify { const void *data; }; -int nvkm_notify_init(struct nouveau_object *, struct nvkm_event *, +int nvkm_notify_init(struct nvkm_object *, struct nvkm_event *, int (*func)(struct nvkm_notify *), bool work, void *data, u32 size, u32 reply, struct nvkm_notify *); @@ -33,5 +35,4 @@ void nvkm_notify_fini(struct nvkm_notify *); void nvkm_notify_get(struct nvkm_notify *); void nvkm_notify_put(struct nvkm_notify *); void nvkm_notify_send(struct nvkm_notify *, void *data, u32 size); - #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/object.h b/drivers/gpu/drm/nouveau/include/nvkm/core/object.h index 64c0038f1971..6e3cd3908400 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/object.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/object.h @@ -1,6 +1,5 @@ -#ifndef __NOUVEAU_OBJECT_H__ -#define __NOUVEAU_OBJECT_H__ - +#ifndef __NVKM_OBJECT_H__ +#define __NVKM_OBJECT_H__ #include <core/os.h> #include <core/printk.h> @@ -14,52 +13,52 @@ #define NV_ENGCTX_CLASS 0x01000000 #define NV_OBJECT_CLASS 0x0000ffff -struct nouveau_object { - struct nouveau_oclass *oclass; - struct nouveau_object *parent; - struct nouveau_engine *engine; +struct nvkm_object { + struct nvkm_oclass *oclass; + struct nvkm_object *parent; + struct nvkm_engine *engine; atomic_t refcount; atomic_t usecount; #if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA -#define NOUVEAU_OBJECT_MAGIC 0x75ef0bad +#define NVKM_OBJECT_MAGIC 0x75ef0bad struct list_head list; u32 _magic; #endif }; -static inline struct nouveau_object * +static inline struct nvkm_object * nv_object(void *obj) { #if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA if (likely(obj)) { - struct nouveau_object *object = obj; - if (unlikely(object->_magic != NOUVEAU_OBJECT_MAGIC)) + struct nvkm_object *object = obj; + if (unlikely(object->_magic != NVKM_OBJECT_MAGIC)) nv_assert("BAD CAST -> NvObject, invalid magic"); } #endif return obj; } -#define nouveau_object_create(p,e,c,s,d) \ - nouveau_object_create_((p), (e), (c), (s), sizeof(**d), (void **)d) -int nouveau_object_create_(struct nouveau_object *, struct nouveau_object *, - struct nouveau_oclass *, u32, int size, void **); -void nouveau_object_destroy(struct nouveau_object *); -int nouveau_object_init(struct nouveau_object *); -int nouveau_object_fini(struct nouveau_object *, bool suspend); +#define nvkm_object_create(p,e,c,s,d) \ + nvkm_object_create_((p), (e), (c), (s), sizeof(**d), (void **)d) +int nvkm_object_create_(struct nvkm_object *, struct nvkm_object *, + struct nvkm_oclass *, u32, int size, void **); +void nvkm_object_destroy(struct nvkm_object *); +int nvkm_object_init(struct nvkm_object *); +int nvkm_object_fini(struct nvkm_object *, bool suspend); -int _nouveau_object_ctor(struct nouveau_object *, struct nouveau_object *, - struct nouveau_oclass *, void *, u32, - struct nouveau_object **); +int _nvkm_object_ctor(struct nvkm_object *, struct nvkm_object *, + struct nvkm_oclass *, void *, u32, + struct nvkm_object **); -extern struct nouveau_ofuncs nouveau_object_ofuncs; +extern struct nvkm_ofuncs nvkm_object_ofuncs; /* Don't allocate dynamically, because lockdep needs lock_class_keys to be in * ".data". */ -struct nouveau_oclass { +struct nvkm_oclass { u32 handle; - struct nouveau_ofuncs * const ofuncs; - struct nouveau_omthds * const omthds; + struct nvkm_ofuncs * const ofuncs; + struct nvkm_omthds * const omthds; struct lock_class_key lock_class_key; }; @@ -68,58 +67,57 @@ struct nouveau_oclass { #define nv_iclass(o,i) (nv_hclass(o) & (i)) #define nv_mclass(o) nv_iclass(o, NV_OBJECT_CLASS) -static inline struct nouveau_object * -nv_pclass(struct nouveau_object *parent, u32 oclass) +static inline struct nvkm_object * +nv_pclass(struct nvkm_object *parent, u32 oclass) { while (parent && !nv_iclass(parent, oclass)) parent = parent->parent; return parent; } -struct nouveau_omthds { +struct nvkm_omthds { u32 start; u32 limit; - int (*call)(struct nouveau_object *, u32, void *, u32); + int (*call)(struct nvkm_object *, u32, void *, u32); }; struct nvkm_event; -struct nouveau_ofuncs { - int (*ctor)(struct nouveau_object *, struct nouveau_object *, - struct nouveau_oclass *, void *data, u32 size, - struct nouveau_object **); - void (*dtor)(struct nouveau_object *); - int (*init)(struct nouveau_object *); - int (*fini)(struct nouveau_object *, bool suspend); - int (*mthd)(struct nouveau_object *, u32, void *, u32); - int (*ntfy)(struct nouveau_object *, u32, struct nvkm_event **); - int (* map)(struct nouveau_object *, u64 *, u32 *); - 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); +struct nvkm_ofuncs { + int (*ctor)(struct nvkm_object *, struct nvkm_object *, + struct nvkm_oclass *, void *data, u32 size, + struct nvkm_object **); + void (*dtor)(struct nvkm_object *); + int (*init)(struct nvkm_object *); + int (*fini)(struct nvkm_object *, bool suspend); + int (*mthd)(struct nvkm_object *, u32, void *, u32); + int (*ntfy)(struct nvkm_object *, u32, struct nvkm_event **); + int (* map)(struct nvkm_object *, u64 *, u32 *); + u8 (*rd08)(struct nvkm_object *, u64 offset); + u16 (*rd16)(struct nvkm_object *, u64 offset); + u32 (*rd32)(struct nvkm_object *, u64 offset); + void (*wr08)(struct nvkm_object *, u64 offset, u8 data); + void (*wr16)(struct nvkm_object *, u64 offset, u16 data); + void (*wr32)(struct nvkm_object *, u64 offset, u32 data); }; -static inline struct nouveau_ofuncs * +static inline struct nvkm_ofuncs * nv_ofuncs(void *obj) { return nv_oclass(obj)->ofuncs; } -int nouveau_object_ctor(struct nouveau_object *, struct nouveau_object *, - struct nouveau_oclass *, void *, u32, - struct nouveau_object **); -void nouveau_object_ref(struct nouveau_object *, struct nouveau_object **); -int nouveau_object_inc(struct nouveau_object *); -int nouveau_object_dec(struct nouveau_object *, bool suspend); - -void nouveau_object_debug(void); +int nvkm_object_ctor(struct nvkm_object *, struct nvkm_object *, + struct nvkm_oclass *, void *, u32, + struct nvkm_object **); +void nvkm_object_ref(struct nvkm_object *, struct nvkm_object **); +int nvkm_object_inc(struct nvkm_object *); +int nvkm_object_dec(struct nvkm_object *, bool suspend); +void nvkm_object_debug(void); static inline int nv_exec(void *obj, u32 mthd, void *data, u32 size) { - struct nouveau_omthds *method = nv_oclass(obj)->omthds; + struct nvkm_omthds *method = nv_oclass(obj)->omthds; while (method && method->call) { if (mthd >= method->start && mthd <= method->limit) @@ -202,5 +200,4 @@ nv_memcmp(void *obj, u32 addr, const char *str, u32 len) } return 0; } - #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/option.h b/drivers/gpu/drm/nouveau/include/nvkm/core/option.h index ed055847887e..532bfa8e3f72 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/option.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/option.h @@ -1,12 +1,10 @@ -#ifndef __NOUVEAU_OPTION_H__ -#define __NOUVEAU_OPTION_H__ - +#ifndef __NVKM_OPTION_H__ +#define __NVKM_OPTION_H__ #include <core/os.h> -const char *nouveau_stropt(const char *optstr, const char *opt, int *len); -bool nouveau_boolopt(const char *optstr, const char *opt, bool value); - -int nouveau_dbgopt(const char *optstr, const char *sub); +const char *nvkm_stropt(const char *optstr, const char *opt, int *len); +bool nvkm_boolopt(const char *optstr, const char *opt, bool value); +int nvkm_dbgopt(const char *optstr, const char *sub); /* compares unterminated string 'str' with zero-terminated string 'cmp' */ static inline int @@ -16,5 +14,4 @@ strncasecmpz(const char *str, const char *cmp, size_t len) return len; return strncasecmp(str, cmp, len); } - #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/os.h b/drivers/gpu/drm/nouveau/include/nvkm/core/os.h index cd57e238ddd3..0b5a1e4dff48 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/os.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/os.h @@ -1,4 +1,195 @@ #ifndef __NVKM_OS_H__ #define __NVKM_OS_H__ #include <nvif/os.h> + +#define nouveau_client nvkm_client +#define nouveau_client_name nvkm_client_name +#define nouveau_client_create nvkm_client_create +#define nouveau_client_init nvkm_client_init +#define nouveau_client_fini nvkm_client_fini +#define nouveau_engctx nvkm_engctx +#define nouveau_engctx_create nvkm_engctx_create +#define nouveau_engctx_create_ nvkm_engctx_create_ +#define nouveau_engctx_destroy nvkm_engctx_destroy +#define nouveau_engctx_init nvkm_engctx_init +#define nouveau_engctx_fini nvkm_engctx_fini +#define _nouveau_engctx_ctor _nvkm_engctx_ctor +#define _nouveau_engctx_dtor _nvkm_engctx_dtor +#define _nouveau_engctx_init _nvkm_engctx_init +#define _nouveau_engctx_fini _nvkm_engctx_fini +#define _nouveau_engctx_rd32 _nvkm_engctx_rd32 +#define _nouveau_engctx_wr32 _nvkm_engctx_wr32 +#define nouveau_engctx_get nvkm_engctx_get +#define nouveau_engctx_put nvkm_engctx_put +#define nouveau_engine nvkm_engine +#define nouveau_engine_create nvkm_engine_create +#define nouveau_engine_create_ nvkm_engine_create_ +#define nouveau_engine_destroy nvkm_engine_destroy +#define nouveau_engine_init nvkm_engine_init +#define nouveau_engine_fini nvkm_engine_fini +#define _nouveau_engine_ctor _nvkm_engine_ctor +#define _nouveau_engine_dtor _nvkm_engine_dtor +#define _nouveau_engine_init _nvkm_engine_init +#define _nouveau_engine_fini _nvkm_engine_fini +#define nouveau_enum nvkm_enum +#define nouveau_gpuobj nvkm_gpuobj +#define nouveau_gpuobj_create nvkm_gpuobj_create +#define nouveau_gpuobj_destroy nvkm_gpuobj_destroy +#define _nouveau_gpuobj_ctor _nvkm_gpuobj_ctor +#define _nouveau_gpuobj_dtor _nvkm_gpuobj_dtor +#define _nouveau_gpuobj_init _nvkm_gpuobj_init +#define _nouveau_gpuobj_fini _nvkm_gpuobj_fini +#define _nouveau_gpuobj_rd32 _nvkm_gpuobj_rd32 +#define _nouveau_gpuobj_wr32 _nvkm_gpuobj_wr32 +#define nouveau_gpuobj_new nvkm_gpuobj_new +#define nouveau_gpuobj_dup nvkm_gpuobj_dup +#define nouveau_gpuobj_ref nvkm_gpuobj_ref +#define nouveau_gpuobj_map nvkm_gpuobj_map +#define nouveau_gpuobj_map_vm nvkm_gpuobj_map_vm +#define nouveau_gpuobj_unmap nvkm_gpuobj_unmap +#define nouveau_handle nvkm_handle +#define nouveau_handle_ref nvkm_handle_ref +#define nouveau_handle_put nvkm_handle_put +#define nouveau_handle_get_class nvkm_handle_get_class +#define nouveau_handle_get_vinst nvkm_handle_get_vinst +#define nouveau_handle_get_cinst nvkm_handle_get_cinst +#define nouveau_mm nvkm_mm +#define nouveau_mm_node nvkm_mm_node +#define nouveau_mm_init nvkm_mm_init +#define nouveau_mm_fini nvkm_mm_fini +#define nouveau_mm_head nvkm_mm_head +#define nouveau_mm_tail nvkm_mm_tail +#define nouveau_mm_free nvkm_mm_free +#define nouveau_mm_initialised nvkm_mm_initialised +#define nouveau_namedb nvkm_namedb +#define nouveau_namedb_create nvkm_namedb_create +#define nouveau_namedb_create_ nvkm_namedb_create_ +#define nouveau_namedb_destroy nvkm_namedb_destroy +#define nouveau_namedb_init nvkm_namedb_init +#define nouveau_namedb_fini nvkm_namedb_fini +#define _nouveau_namedb_ctor _nvkm_namedb_ctor +#define _nouveau_namedb_dtor _nvkm_namedb_dtor +#define _nouveau_namedb_init _nvkm_namedb_init +#define _nouveau_namedb_fini _nvkm_namedb_fini +#define nouveau_namedb_ref nvkm_namedb_ref +#define nouveau_namedb_put nvkm_namedb_put +#define nouveau_namedb_get nvkm_namedb_get +#define nouveau_namedb_get_class nvkm_namedb_get_class +#define nouveau_namedb_get_vinst nvkm_namedb_get_vinst +#define nouveau_namedb_get_cinst nvkm_namedb_get_cinst +#define nouveau_object_debug nvkm_object_debug +#define nouveau_object nvkm_object +#define nouveau_object_create nvkm_object_create +#define nouveau_object_create_ nvkm_object_create_ +#define nouveau_object_destroy nvkm_object_destroy +#define nouveau_object_init nvkm_object_init +#define nouveau_object_fini nvkm_object_fini +#define _nouveau_object_ctor _nvkm_object_ctor +#define nouveau_object_ctor nvkm_object_ctor +#define nouveau_object_ref nvkm_object_ref +#define nouveau_object_ofuncs nvkm_object_ofuncs +#define nouveau_object_inc nvkm_object_inc +#define nouveau_object_dec nvkm_object_dec +#define nouveau_ofuncs nvkm_ofuncs +#define nouveau_oclass nvkm_oclass +#define nouveau_omthds nvkm_omthds +#define nouveau_parent nvkm_parent +#define nouveau_parent_create nvkm_parent_create +#define nouveau_parent_create_ nvkm_parent_create_ +#define nouveau_parent_destroy nvkm_parent_destroy +#define nouveau_parent_init nvkm_parent_init +#define nouveau_parent_fini nvkm_parent_fini +#define _nouveau_parent_ctor _nvkm_parent_ctor +#define _nouveau_parent_dtor _nvkm_parent_dtor +#define _nouveau_parent_init _nvkm_parent_init +#define _nouveau_parent_fini _nvkm_parent_fini +#define nouveau_printk nvkm_printk +#define nouveau_ramht nvkm_ramht +#define nouveau_ramht_new nvkm_ramht_new +#define nouveau_ramht_ref nvkm_ramht_ref +#define nouveau_ramht_insert nvkm_ramht_insert +#define nouveau_ramht_remove nvkm_ramht_remove +#define nouveau_subdev nvkm_subdev +#define nouveau_subdev_create nvkm_subdev_create +#define nouveau_subdev_create_ nvkm_subdev_create_ +#define nouveau_subdev_destroy nvkm_subdev_destroy +#define nouveau_subdev_init nvkm_subdev_init +#define nouveau_subdev_fini nvkm_subdev_fini +#define _nouveau_subdev_ctor _nvkm_subdev_ctor +#define _nouveau_subdev_dtor _nvkm_subdev_dtor +#define _nouveau_subdev_init _nvkm_subdev_init +#define _nouveau_subdev_fini _nvkm_subdev_fini +#define nouveau_subdev_reset nvkm_subdev_reset +#define nouveau_bitfield nvkm_bitfield +#define nouveau_bitfield_print nvkm_bitfield_print +#define nouveau_enum nvkm_enum +#define nouveau_enum_find nvkm_enum_find +#define nouveau_enum_print nvkm_enum_print +#define nouveau_stropt nvkm_stropt +#define nouveau_boolopt nvkm_boolopt +#define nouveau_dbgopt nvkm_dbgopt +#define nouveau_device nvkm_device +#define nouveau_device_find nvkm_device_find +#define nouveau_device_list nvkm_device_list +#define nouveau_vma nvkm_vma +#define nouveau_vm nvkm_vm +#define nouveau_vm_get nvkm_vm_get +#define nouveau_vm_put nvkm_vm_put +#define nouveau_vm_map nvkm_vm_map +#define nouveau_vm_unmap nvkm_vm_unmap +#define nouveau_instmem nvkm_instmem +#define nouveau_instobj nvkm_instobj +#define nouveau_mem nvkm_mem +#define nouveau_bar nvkm_bar +#define nouveau_falcon nvkm_falcon +#define nouveau_falcon_create nvkm_falcon_create +#define nouveau_falcon_create_ nvkm_falcon_create_ +#define nouveau_falcon_destroy nvkm_falcon_destroy +#define nouveau_falcon_init nvkm_falcon_init +#define nouveau_falcon_fini nvkm_falcon_fini +#define _nouveau_falcon_ctor _nvkm_falcon_ctor +#define _nouveau_falcon_dtor _nvkm_falcon_dtor +#define _nouveau_falcon_init _nvkm_falcon_init +#define _nouveau_falcon_fini _nvkm_falcon_fini +#define _nouveau_falcon_rd32 _nvkm_falcon_rd32 +#define _nouveau_falcon_wr32 _nvkm_falcon_wr32 +#define nouveau_falcon_context nvkm_falcon_context +#define nouveau_falcon_context_create nvkm_falcon_context_create +#define nouveau_falcon_context_create_ nvkm_falcon_context_create_ +#define nouveau_falcon_context_destroy nvkm_falcon_context_destroy +#define nouveau_falcon_context_init nvkm_falcon_context_init +#define nouveau_falcon_context_fini nvkm_falcon_context_fini +#define _nouveau_falcon_context_ctor _nvkm_falcon_context_ctor +#define _nouveau_falcon_context_dtor _nvkm_falcon_context_dtor +#define _nouveau_falcon_context_init _nvkm_falcon_context_init +#define _nouveau_falcon_context_fini _nvkm_falcon_context_fini +#define _nouveau_falcon_context_rd32 _nvkm_falcon_context_rd32 +#define _nouveau_falcon_context_wr32 _nvkm_falcon_context_wr32 +#define nouveau_falcon_intr nvkm_falcon_intr +#define nouveau_xtensa nvkm_xtensa +#define nouveau_xtensa_create nvkm_xtensa_create +#define nouveau_xtensa_create_ nvkm_xtensa_create_ +#define nouveau_xtensa_destroy nvkm_xtensa_destroy +#define nouveau_xtensa_init nvkm_xtensa_init +#define nouveau_xtensa_fini nvkm_xtensa_fini +#define _nouveau_xtensa_ctor _nvkm_xtensa_ctor +#define _nouveau_xtensa_dtor _nvkm_xtensa_dtor +#define _nouveau_xtensa_init _nvkm_xtensa_init +#define _nouveau_xtensa_fini _nvkm_xtensa_fini +#define _nouveau_xtensa_rd32 _nvkm_xtensa_rd32 +#define _nouveau_xtensa_wr32 _nvkm_xtensa_wr32 +#define nouveau_xtensa_context nvkm_xtensa_context +#define nouveau_xtensa_context_create nvkm_xtensa_context_create +#define nouveau_xtensa_context_create_ nvkm_xtensa_context_create_ +#define nouveau_xtensa_context_destroy nvkm_xtensa_context_destroy +#define nouveau_xtensa_context_init nvkm_xtensa_context_init +#define nouveau_xtensa_context_fini nvkm_xtensa_context_fini +#define _nouveau_xtensa_engctx_ctor _nvkm_xtensa_engctx_ctor +#define _nouveau_xtensa_context_dtor _nvkm_xtensa_context_dtor +#define _nouveau_xtensa_context_init _nvkm_xtensa_context_init +#define _nouveau_xtensa_context_fini _nvkm_xtensa_context_fini +#define _nouveau_xtensa_context_rd32 _nvkm_xtensa_context_rd32 +#define _nouveau_xtensa_context_wr32 _nvkm_xtensa_context_wr32 +#define nouveau_xtensa_intr nvkm_xtensa_intr + #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/parent.h b/drivers/gpu/drm/nouveau/include/nvkm/core/parent.h index 4e2345a5cfdb..837e4fe966a5 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/parent.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/parent.h @@ -1,32 +1,29 @@ -#ifndef __NOUVEAU_PARENT_H__ -#define __NOUVEAU_PARENT_H__ - -#include <core/device.h> +#ifndef __NVKM_PARENT_H__ +#define __NVKM_PARENT_H__ #include <core/object.h> -struct nouveau_sclass { - struct nouveau_sclass *sclass; - struct nouveau_engine *engine; - struct nouveau_oclass *oclass; +struct nvkm_sclass { + struct nvkm_sclass *sclass; + struct nvkm_engine *engine; + struct nvkm_oclass *oclass; }; -struct nouveau_parent { - struct nouveau_object object; +struct nvkm_parent { + struct nvkm_object object; - struct nouveau_sclass *sclass; + struct nvkm_sclass *sclass; u64 engine; - int (*context_attach)(struct nouveau_object *, - struct nouveau_object *); - int (*context_detach)(struct nouveau_object *, bool suspend, - struct nouveau_object *); + int (*context_attach)(struct nvkm_object *, struct nvkm_object *); + int (*context_detach)(struct nvkm_object *, bool suspend, + struct nvkm_object *); - int (*object_attach)(struct nouveau_object *parent, - struct nouveau_object *object, u32 name); - void (*object_detach)(struct nouveau_object *parent, int cookie); + int (*object_attach)(struct nvkm_object *parent, + struct nvkm_object *object, u32 name); + void (*object_detach)(struct nvkm_object *parent, int cookie); }; -static inline struct nouveau_parent * +static inline struct nvkm_parent * nv_parent(void *obj) { #if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA @@ -36,27 +33,26 @@ nv_parent(void *obj) return obj; } -#define nouveau_parent_create(p,e,c,v,s,m,d) \ - nouveau_parent_create_((p), (e), (c), (v), (s), (m), \ +#define nvkm_parent_create(p,e,c,v,s,m,d) \ + nvkm_parent_create_((p), (e), (c), (v), (s), (m), \ sizeof(**d), (void **)d) -#define nouveau_parent_init(p) \ - nouveau_object_init(&(p)->object) -#define nouveau_parent_fini(p,s) \ - nouveau_object_fini(&(p)->object, (s)) - -int nouveau_parent_create_(struct nouveau_object *, struct nouveau_object *, - struct nouveau_oclass *, u32 pclass, - struct nouveau_oclass *, u64 engcls, +#define nvkm_parent_init(p) \ + nvkm_object_init(&(p)->object) +#define nvkm_parent_fini(p,s) \ + nvkm_object_fini(&(p)->object, (s)) + +int nvkm_parent_create_(struct nvkm_object *, struct nvkm_object *, + struct nvkm_oclass *, u32 pclass, + struct nvkm_oclass *, u64 engcls, int size, void **); -void nouveau_parent_destroy(struct nouveau_parent *); - -void _nouveau_parent_dtor(struct nouveau_object *); -#define _nouveau_parent_init nouveau_object_init -#define _nouveau_parent_fini nouveau_object_fini +void nvkm_parent_destroy(struct nvkm_parent *); -int nouveau_parent_sclass(struct nouveau_object *, u16 handle, - struct nouveau_object **pengine, - struct nouveau_oclass **poclass); -int nouveau_parent_lclass(struct nouveau_object *, u32 *, int); +void _nvkm_parent_dtor(struct nvkm_object *); +#define _nvkm_parent_init nvkm_object_init +#define _nvkm_parent_fini nvkm_object_fini +int nvkm_parent_sclass(struct nvkm_object *, u16 handle, + struct nvkm_object **pengine, + struct nvkm_oclass **poclass); +int nvkm_parent_lclass(struct nvkm_object *, u32 *, int); #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/printk.h b/drivers/gpu/drm/nouveau/include/nvkm/core/printk.h index 451b6ed20b7e..83648177059f 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/printk.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/printk.h @@ -1,13 +1,11 @@ -#ifndef __NOUVEAU_PRINTK_H__ -#define __NOUVEAU_PRINTK_H__ - +#ifndef __NVKM_PRINTK_H__ +#define __NVKM_PRINTK_H__ #include <core/os.h> #include <core/debug.h> - -struct nouveau_object; +struct nvkm_object; void __printf(3, 4) -nv_printk_(struct nouveau_object *, int, const char *, ...); +nv_printk_(struct nvkm_object *, int, const char *, ...); #define nv_printk(o,l,f,a...) do { \ if (NV_DBG_##l <= CONFIG_NOUVEAU_DEBUG) \ @@ -21,12 +19,11 @@ nv_printk_(struct nouveau_object *, int, const char *, ...); #define nv_debug(o,f,a...) nv_printk((o), DEBUG, f, ##a) #define nv_trace(o,f,a...) nv_printk((o), TRACE, f, ##a) #define nv_spam(o,f,a...) nv_printk((o), SPAM, f, ##a) -#define nv_ioctl(o,f,a...) nv_trace(nouveau_client(o), "ioctl: "f, ##a) +#define nv_ioctl(o,f,a...) nv_trace(nvkm_client(o), "ioctl: "f, ##a) #define nv_assert(f,a...) do { \ if (NV_DBG_FATAL <= CONFIG_NOUVEAU_DEBUG) \ nv_printk_(NULL, NV_DBG_FATAL, f "\n", ##a); \ BUG_ON(1); \ } while(0) - #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/ramht.h b/drivers/gpu/drm/nouveau/include/nvkm/core/ramht.h index e51014337ebe..cc132eaa10cc 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/ramht.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/ramht.h @@ -1,23 +1,20 @@ -#ifndef __NOUVEAU_RAMHT_H__ -#define __NOUVEAU_RAMHT_H__ - +#ifndef __NVKM_RAMHT_H__ +#define __NVKM_RAMHT_H__ #include <core/gpuobj.h> -struct nouveau_ramht { - struct nouveau_gpuobj gpuobj; +struct nvkm_ramht { + struct nvkm_gpuobj gpuobj; int bits; }; -int nouveau_ramht_insert(struct nouveau_ramht *, int chid, - u32 handle, u32 context); -void nouveau_ramht_remove(struct nouveau_ramht *, int cookie); -int nouveau_ramht_new(struct nouveau_object *, struct nouveau_object *, - u32 size, u32 align, struct nouveau_ramht **); +int nvkm_ramht_insert(struct nvkm_ramht *, int chid, u32 handle, u32 context); +void nvkm_ramht_remove(struct nvkm_ramht *, int cookie); +int nvkm_ramht_new(struct nvkm_object *, struct nvkm_object *, u32 size, + u32 align, struct nvkm_ramht **); static inline void -nouveau_ramht_ref(struct nouveau_ramht *obj, struct nouveau_ramht **ref) +nvkm_ramht_ref(struct nvkm_ramht *obj, struct nvkm_ramht **ref) { - nouveau_gpuobj_ref(&obj->gpuobj, (struct nouveau_gpuobj **)ref); + nvkm_gpuobj_ref(&obj->gpuobj, (struct nvkm_gpuobj **)ref); } - #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h b/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h index 152c842e1f66..6fdc39116aac 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h @@ -1,24 +1,23 @@ -#ifndef __NOUVEAU_SUBDEV_H__ -#define __NOUVEAU_SUBDEV_H__ - +#ifndef __NVKM_SUBDEV_H__ +#define __NVKM_SUBDEV_H__ #include <core/object.h> #include <core/devidx.h> #define NV_SUBDEV_(sub,var) (NV_SUBDEV_CLASS | ((var) << 8) | (sub)) #define NV_SUBDEV(name,var) NV_SUBDEV_(NVDEV_SUBDEV_##name, (var)) -struct nouveau_subdev { - struct nouveau_object object; +struct nvkm_subdev { + struct nvkm_object object; struct mutex mutex; const char *name; void __iomem *mmio; u32 debug; u32 unit; - void (*intr)(struct nouveau_subdev *); + void (*intr)(struct nvkm_subdev *); }; -static inline struct nouveau_subdev * +static inline struct nvkm_subdev * nv_subdev(void *obj) { #if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA @@ -29,29 +28,29 @@ nv_subdev(void *obj) } static inline int -nv_subidx(struct nouveau_subdev *subdev) +nv_subidx(struct nvkm_subdev *subdev) { return nv_hclass(subdev) & 0xff; } -struct nouveau_subdev *nouveau_subdev(void *obj, int idx); +struct nvkm_subdev *nvkm_subdev(void *obj, int idx); -#define nouveau_subdev_create(p,e,o,v,s,f,d) \ - nouveau_subdev_create_((p), (e), (o), (v), (s), (f), \ +#define nvkm_subdev_create(p,e,o,v,s,f,d) \ + nvkm_subdev_create_((p), (e), (o), (v), (s), (f), \ sizeof(**d),(void **)d) -int nouveau_subdev_create_(struct nouveau_object *, struct nouveau_object *, - struct nouveau_oclass *, u32 pclass, +int nvkm_subdev_create_(struct nvkm_object *, struct nvkm_object *, + struct nvkm_oclass *, u32 pclass, const char *sname, const char *fname, int size, void **); -void nouveau_subdev_destroy(struct nouveau_subdev *); -int nouveau_subdev_init(struct nouveau_subdev *); -int nouveau_subdev_fini(struct nouveau_subdev *, bool suspend); -void nouveau_subdev_reset(struct nouveau_object *); +void nvkm_subdev_destroy(struct nvkm_subdev *); +int nvkm_subdev_init(struct nvkm_subdev *); +int nvkm_subdev_fini(struct nvkm_subdev *, bool suspend); +void nvkm_subdev_reset(struct nvkm_object *); -void _nouveau_subdev_dtor(struct nouveau_object *); -int _nouveau_subdev_init(struct nouveau_object *); -int _nouveau_subdev_fini(struct nouveau_object *, bool suspend); +void _nvkm_subdev_dtor(struct nvkm_object *); +int _nvkm_subdev_init(struct nvkm_object *); +int _nvkm_subdev_fini(struct nvkm_object *, bool suspend); #define s_printk(s,l,f,a...) do { \ if ((s)->debug >= OS_DBG_##l) { \ @@ -62,7 +61,7 @@ int _nouveau_subdev_fini(struct nouveau_object *, bool suspend); static inline u8 nv_rd08(void *obj, u32 addr) { - struct nouveau_subdev *subdev = nv_subdev(obj); + struct nvkm_subdev *subdev = nv_subdev(obj); u8 data = ioread8(subdev->mmio + addr); nv_spam(subdev, "nv_rd08 0x%06x 0x%02x\n", addr, data); return data; @@ -71,7 +70,7 @@ nv_rd08(void *obj, u32 addr) static inline u16 nv_rd16(void *obj, u32 addr) { - struct nouveau_subdev *subdev = nv_subdev(obj); + struct nvkm_subdev *subdev = nv_subdev(obj); u16 data = ioread16_native(subdev->mmio + addr); nv_spam(subdev, "nv_rd16 0x%06x 0x%04x\n", addr, data); return data; @@ -80,7 +79,7 @@ nv_rd16(void *obj, u32 addr) static inline u32 nv_rd32(void *obj, u32 addr) { - struct nouveau_subdev *subdev = nv_subdev(obj); + struct nvkm_subdev *subdev = nv_subdev(obj); u32 data = ioread32_native(subdev->mmio + addr); nv_spam(subdev, "nv_rd32 0x%06x 0x%08x\n", addr, data); return data; @@ -89,7 +88,7 @@ nv_rd32(void *obj, u32 addr) static inline void nv_wr08(void *obj, u32 addr, u8 data) { - struct nouveau_subdev *subdev = nv_subdev(obj); + struct nvkm_subdev *subdev = nv_subdev(obj); nv_spam(subdev, "nv_wr08 0x%06x 0x%02x\n", addr, data); iowrite8(data, subdev->mmio + addr); } @@ -97,7 +96,7 @@ nv_wr08(void *obj, u32 addr, u8 data) static inline void nv_wr16(void *obj, u32 addr, u16 data) { - struct nouveau_subdev *subdev = nv_subdev(obj); + struct nvkm_subdev *subdev = nv_subdev(obj); nv_spam(subdev, "nv_wr16 0x%06x 0x%04x\n", addr, data); iowrite16_native(data, subdev->mmio + addr); } @@ -105,7 +104,7 @@ nv_wr16(void *obj, u32 addr, u16 data) static inline void nv_wr32(void *obj, u32 addr, u32 data) { - struct nouveau_subdev *subdev = nv_subdev(obj); + struct nvkm_subdev *subdev = nv_subdev(obj); nv_spam(subdev, "nv_wr32 0x%06x 0x%08x\n", addr, data); iowrite32_native(data, subdev->mmio + addr); } @@ -117,5 +116,4 @@ nv_mask(void *obj, u32 addr, u32 mask, u32 data) nv_wr32(obj, addr, (temp & ~mask) | data); return temp; } - #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/device.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/device.h index 672d3c8f4145..5d4805e67e76 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/engine/device.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/device.h @@ -27,7 +27,4 @@ int nv50_identify(struct nouveau_device *); int nvc0_identify(struct nouveau_device *); int nve0_identify(struct nouveau_device *); int gm100_identify(struct nouveau_device *); - -struct nouveau_device *nouveau_device_find(u64 name); - #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/falcon.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/falcon.h index 181aa7da524d..bd38cf9130fc 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/engine/falcon.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/falcon.h @@ -1,42 +1,41 @@ -#ifndef __NOUVEAU_FALCON_H__ -#define __NOUVEAU_FALCON_H__ - -#include <core/engine.h> +#ifndef __NVKM_FALCON_H__ +#define __NVKM_FALCON_H__ #include <core/engctx.h> -#include <core/gpuobj.h> -struct nouveau_falcon_chan { - struct nouveau_engctx base; +struct nvkm_falcon_chan { + struct nvkm_engctx base; }; -#define nouveau_falcon_context_create(p,e,c,g,s,a,f,d) \ - nouveau_engctx_create((p), (e), (c), (g), (s), (a), (f), (d)) -#define nouveau_falcon_context_destroy(d) \ - nouveau_engctx_destroy(&(d)->base) -#define nouveau_falcon_context_init(d) \ - nouveau_engctx_init(&(d)->base) -#define nouveau_falcon_context_fini(d,s) \ - nouveau_engctx_fini(&(d)->base, (s)) - -#define _nouveau_falcon_context_ctor _nouveau_engctx_ctor -#define _nouveau_falcon_context_dtor _nouveau_engctx_dtor -#define _nouveau_falcon_context_init _nouveau_engctx_init -#define _nouveau_falcon_context_fini _nouveau_engctx_fini -#define _nouveau_falcon_context_rd32 _nouveau_engctx_rd32 -#define _nouveau_falcon_context_wr32 _nouveau_engctx_wr32 - -struct nouveau_falcon_data { +#define nvkm_falcon_context_create(p,e,c,g,s,a,f,d) \ + nvkm_engctx_create((p), (e), (c), (g), (s), (a), (f), (d)) +#define nvkm_falcon_context_destroy(d) \ + nvkm_engctx_destroy(&(d)->base) +#define nvkm_falcon_context_init(d) \ + nvkm_engctx_init(&(d)->base) +#define nvkm_falcon_context_fini(d,s) \ + nvkm_engctx_fini(&(d)->base, (s)) + +#define _nvkm_falcon_context_ctor _nvkm_engctx_ctor +#define _nvkm_falcon_context_dtor _nvkm_engctx_dtor +#define _nvkm_falcon_context_init _nvkm_engctx_init +#define _nvkm_falcon_context_fini _nvkm_engctx_fini +#define _nvkm_falcon_context_rd32 _nvkm_engctx_rd32 +#define _nvkm_falcon_context_wr32 _nvkm_engctx_wr32 + +struct nvkm_falcon_data { bool external; }; -struct nouveau_falcon { - struct nouveau_engine base; +#include <core/engine.h> + +struct nvkm_falcon { + struct nvkm_engine base; u32 addr; u8 version; u8 secret; - struct nouveau_gpuobj *core; + struct nvkm_gpuobj *core; bool external; struct { @@ -54,30 +53,29 @@ struct nouveau_falcon { #define nv_falcon(priv) (&(priv)->base) -#define nouveau_falcon_create(p,e,c,b,d,i,f,r) \ - nouveau_falcon_create_((p), (e), (c), (b), (d), (i), (f), \ +#define nvkm_falcon_create(p,e,c,b,d,i,f,r) \ + nvkm_falcon_create_((p), (e), (c), (b), (d), (i), (f), \ sizeof(**r),(void **)r) -#define nouveau_falcon_destroy(p) \ - nouveau_engine_destroy(&(p)->base) -#define nouveau_falcon_init(p) ({ \ - struct nouveau_falcon *falcon = (p); \ - _nouveau_falcon_init(nv_object(falcon)); \ +#define nvkm_falcon_destroy(p) \ + nvkm_engine_destroy(&(p)->base) +#define nvkm_falcon_init(p) ({ \ + struct nvkm_falcon *falcon = (p); \ + _nvkm_falcon_init(nv_object(falcon)); \ }) -#define nouveau_falcon_fini(p,s) ({ \ - struct nouveau_falcon *falcon = (p); \ - _nouveau_falcon_fini(nv_object(falcon), (s)); \ +#define nvkm_falcon_fini(p,s) ({ \ + struct nvkm_falcon *falcon = (p); \ + _nvkm_falcon_fini(nv_object(falcon), (s)); \ }) -int nouveau_falcon_create_(struct nouveau_object *, struct nouveau_object *, - struct nouveau_oclass *, u32, bool, const char *, +int nvkm_falcon_create_(struct nvkm_object *, struct nvkm_object *, + struct nvkm_oclass *, u32, bool, const char *, const char *, int, void **); -void nouveau_falcon_intr(struct nouveau_subdev *subdev); - -#define _nouveau_falcon_dtor _nouveau_engine_dtor -int _nouveau_falcon_init(struct nouveau_object *); -int _nouveau_falcon_fini(struct nouveau_object *, bool); -u32 _nouveau_falcon_rd32(struct nouveau_object *, u64); -void _nouveau_falcon_wr32(struct nouveau_object *, u64, u32); +void nvkm_falcon_intr(struct nvkm_subdev *subdev); +#define _nvkm_falcon_dtor _nvkm_engine_dtor +int _nvkm_falcon_init(struct nvkm_object *); +int _nvkm_falcon_fini(struct nvkm_object *, bool); +u32 _nvkm_falcon_rd32(struct nvkm_object *, u64); +void _nvkm_falcon_wr32(struct nvkm_object *, u64, u32); #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/xtensa.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/xtensa.h index 306100f31f02..7a216cca2865 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/engine/xtensa.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/xtensa.h @@ -1,38 +1,35 @@ -#ifndef __NOUVEAU_XTENSA_H__ -#define __NOUVEAU_XTENSA_H__ - +#ifndef __NVKM_XTENSA_H__ +#define __NVKM_XTENSA_H__ #include <core/engine.h> -#include <core/engctx.h> -#include <core/gpuobj.h> +struct nvkm_gpuobj; -struct nouveau_xtensa { - struct nouveau_engine base; +struct nvkm_xtensa { + struct nvkm_engine base; u32 addr; - struct nouveau_gpuobj *gpu_fw; + struct nvkm_gpuobj *gpu_fw; u32 fifo_val; u32 unkd28; }; -#define nouveau_xtensa_create(p,e,c,b,d,i,f,r) \ - nouveau_xtensa_create_((p), (e), (c), (b), (d), (i), (f), \ +#define nvkm_xtensa_create(p,e,c,b,d,i,f,r) \ + nvkm_xtensa_create_((p), (e), (c), (b), (d), (i), (f), \ sizeof(**r),(void **)r) -int _nouveau_xtensa_engctx_ctor(struct nouveau_object *, - struct nouveau_object *, - struct nouveau_oclass *, void *, u32, - struct nouveau_object **); +int _nvkm_xtensa_engctx_ctor(struct nvkm_object *, + struct nvkm_object *, + struct nvkm_oclass *, void *, u32, + struct nvkm_object **); -void _nouveau_xtensa_intr(struct nouveau_subdev *); -int nouveau_xtensa_create_(struct nouveau_object *, - struct nouveau_object *, - struct nouveau_oclass *, u32, bool, +void _nvkm_xtensa_intr(struct nvkm_subdev *); +int nvkm_xtensa_create_(struct nvkm_object *, + struct nvkm_object *, + struct nvkm_oclass *, u32, bool, const char *, const char *, int, void **); -#define _nouveau_xtensa_dtor _nouveau_engine_dtor -int _nouveau_xtensa_init(struct nouveau_object *); -int _nouveau_xtensa_fini(struct nouveau_object *, bool); -u32 _nouveau_xtensa_rd32(struct nouveau_object *, u64); -void _nouveau_xtensa_wr32(struct nouveau_object *, u64, u32); - +#define _nvkm_xtensa_dtor _nvkm_engine_dtor +int _nvkm_xtensa_init(struct nvkm_object *); +int _nvkm_xtensa_fini(struct nvkm_object *, bool); +u32 _nvkm_xtensa_rd32(struct nvkm_object *, u64); +void _nvkm_xtensa_wr32(struct nvkm_object *, u64, u32); #endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/clk.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/clk.h index 4524d4eea2f1..d42a08837d4f 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/clk.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/clk.h @@ -2,6 +2,7 @@ #define __NOUVEAU_CLK_H__ #include <core/device.h> +#include <core/notify.h> #include <core/subdev.h> struct nouveau_pll_vals; |