diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-08-20 07:54:20 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 05:40:44 +0300 |
commit | b7a2bc1886d00f5f1358079e1e6f4979006a4ed6 (patch) | |
tree | 304cc1694df1e028413b4caf7cb8901bc7428008 /drivers/gpu/drm/nouveau/include/nvkm/subdev/instmem.h | |
parent | 8de65bd0901e2ee7a485a158bfe9e4631cc00644 (diff) | |
download | linux-b7a2bc1886d00f5f1358079e1e6f4979006a4ed6.tar.xz |
drm/nouveau/imem: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/include/nvkm/subdev/instmem.h')
-rw-r--r-- | drivers/gpu/drm/nouveau/include/nvkm/subdev/instmem.h | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/instmem.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/instmem.h index a4b943ee7a9a..28bc202f9753 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/instmem.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/instmem.h @@ -4,14 +4,11 @@ struct nvkm_memory; struct nvkm_instmem { + const struct nvkm_instmem_func *func; struct nvkm_subdev subdev; - struct list_head list; + struct list_head list; u32 reserved; - int (*alloc)(struct nvkm_instmem *, u32 size, u32 align, bool zero, - struct nvkm_memory **); - - const struct nvkm_instmem_func *func; struct nvkm_memory *vbios; struct nvkm_ramht *ramht; @@ -19,26 +16,14 @@ struct nvkm_instmem { struct nvkm_memory *ramfc; }; -struct nvkm_instmem_func { - u32 (*rd32)(struct nvkm_instmem *, u32 addr); - void (*wr32)(struct nvkm_instmem *, u32 addr, u32 data); -}; - -static inline struct nvkm_instmem * -nvkm_instmem(void *obj) -{ - /* nv04/nv40 impls need to create objects in their constructor, - * which is before the subdev pointer is valid - */ - if (nv_iclass(obj, NV_SUBDEV_CLASS) && - nv_subidx(obj) == NVDEV_SUBDEV_INSTMEM) - return obj; +u32 nvkm_instmem_rd32(struct nvkm_instmem *, u32 addr); +void nvkm_instmem_wr32(struct nvkm_instmem *, u32 addr, u32 data); +int nvkm_instobj_new(struct nvkm_instmem *, u32 size, u32 align, bool zero, + struct nvkm_memory **); - return (void *)nvkm_subdev(obj, NVDEV_SUBDEV_INSTMEM); -} -extern struct nvkm_oclass *nv04_instmem_oclass; -extern struct nvkm_oclass *nv40_instmem_oclass; -extern struct nvkm_oclass *nv50_instmem_oclass; -extern struct nvkm_oclass *gk20a_instmem_oclass; +int nv04_instmem_new(struct nvkm_device *, int, struct nvkm_instmem **); +int nv40_instmem_new(struct nvkm_device *, int, struct nvkm_instmem **); +int nv50_instmem_new(struct nvkm_device *, int, struct nvkm_instmem **); +int gk20a_instmem_new(struct nvkm_device *, int, struct nvkm_instmem **); #endif |