diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-08-20 07:54:22 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 05:40:47 +0300 |
commit | 68f3f702b6a430a8d1e909455a60d26c0f2da530 (patch) | |
tree | b4ef653696cf93b0224297125bad367823022c8d /drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h | |
parent | 7624fc011e56902a83e409b14d6c1efa75aa4a58 (diff) | |
download | linux-68f3f702b6a430a8d1e909455a60d26c0f2da530.tar.xz |
drm/nouveau/core: remove the remainder of the previous style
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h')
-rw-r--r-- | drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h | 51 |
1 files changed, 4 insertions, 47 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h b/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h index 01f2f71e6112..3b5dc9c63069 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h @@ -1,23 +1,16 @@ #ifndef __NVKM_SUBDEV_H__ #define __NVKM_SUBDEV_H__ -#include <core/object.h> - -#define NV_SUBDEV_(sub,var) (((var) << 8) | (sub)) -#define NV_SUBDEV(name,var) NV_SUBDEV_(NVDEV_SUBDEV_##name, (var)) +#include <core/device.h> struct nvkm_subdev { - struct nvkm_object object; const struct nvkm_subdev_func *func; struct nvkm_device *device; - int index; + enum nvkm_devidx index; u32 pmc_enable; - struct mutex mutex; u32 debug; - bool oneinit; - void (*intr)(struct nvkm_subdev *); - u32 unit; + bool oneinit; }; struct nvkm_subdev_func { @@ -29,7 +22,7 @@ struct nvkm_subdev_func { void (*intr)(struct nvkm_subdev *); }; -extern const char *nvkm_subdev_name[64]; +extern const char *nvkm_subdev_name[NVKM_SUBDEV_NR]; void nvkm_subdev_ctor(const struct nvkm_subdev_func *, struct nvkm_device *, int index, u32 pmc_enable, struct nvkm_subdev *); void nvkm_subdev_del(struct nvkm_subdev **); @@ -38,40 +31,6 @@ int nvkm_subdev_init(struct nvkm_subdev *); int nvkm_subdev_fini(struct nvkm_subdev *, bool suspend); void nvkm_subdev_intr(struct nvkm_subdev *); -static inline struct nvkm_subdev * -nv_subdev(void *obj) -{ -#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA - BUG_ON(!nv_iclass(obj, NV_SUBDEV_CLASS)); -#endif - return obj; -} - -static inline int -nv_subidx(struct nvkm_subdev *subdev) -{ - return nv_hclass(subdev) & 0xff; -} - -struct nvkm_subdev *nvkm_subdev(void *obj, int idx); - -#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 nvkm_subdev_create_(struct nvkm_object *, struct nvkm_object *, - struct nvkm_oclass *, u32 pclass, - const char *sname, const char *fname, - int size, void **); -void nvkm_subdev_destroy(struct nvkm_subdev *); -int nvkm_subdev_init_old(struct nvkm_subdev *); -int nvkm_subdev_fini_old(struct nvkm_subdev *, bool suspend); -void nvkm_subdev_reset(struct nvkm_object *); - -void _nvkm_subdev_dtor(struct nvkm_object *); -int _nvkm_subdev_init(struct nvkm_object *); -int _nvkm_subdev_fini(struct nvkm_object *, bool suspend); - /* subdev logging */ #define nvkm_printk_(s,l,p,f,a...) do { \ struct nvkm_subdev *_subdev = (s); \ @@ -88,6 +47,4 @@ int _nvkm_subdev_fini(struct nvkm_object *, bool suspend); #define nvkm_debug(s,f,a...) nvkm_printk((s), DEBUG, info, f, ##a) #define nvkm_trace(s,f,a...) nvkm_printk((s), TRACE, info, f, ##a) #define nvkm_spam(s,f,a...) nvkm_printk((s), SPAM, dbg, f, ##a) - -#include <core/engine.h> #endif |