GNU Linux-libre 4.14.259-gnu1
[releases.git] / drivers / gpu / drm / nouveau / nvkm / subdev / instmem / priv.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __NVKM_INSTMEM_PRIV_H__
3 #define __NVKM_INSTMEM_PRIV_H__
4 #define nvkm_instmem(p) container_of((p), struct nvkm_instmem, subdev)
5 #include <subdev/instmem.h>
6
7 struct nvkm_instmem_func {
8         void *(*dtor)(struct nvkm_instmem *);
9         int (*oneinit)(struct nvkm_instmem *);
10         void (*fini)(struct nvkm_instmem *);
11         u32  (*rd32)(struct nvkm_instmem *, u32 addr);
12         void (*wr32)(struct nvkm_instmem *, u32 addr, u32 data);
13         int (*memory_new)(struct nvkm_instmem *, u32 size, u32 align,
14                           bool zero, struct nvkm_memory **);
15         bool persistent;
16         bool zero;
17 };
18
19 void nvkm_instmem_ctor(const struct nvkm_instmem_func *, struct nvkm_device *,
20                        int index, struct nvkm_instmem *);
21 #endif