]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - drivers/gpu/drm/nouveau/nvkm/subdev/fb/priv.h
329ff5e0115a6553c2bf21d62cbcc872690ca06d
[mirror_ubuntu-bionic-kernel.git] / drivers / gpu / drm / nouveau / nvkm / subdev / fb / priv.h
1 #ifndef __NVKM_FB_PRIV_H__
2 #define __NVKM_FB_PRIV_H__
3 #define nvkm_fb(p) container_of((p), struct nvkm_fb, subdev)
4 #include <subdev/fb.h>
5 struct nvkm_bios;
6
7 struct nvkm_fb_func {
8 void *(*dtor)(struct nvkm_fb *);
9 u32 (*tags)(struct nvkm_fb *);
10 int (*oneinit)(struct nvkm_fb *);
11 void (*init)(struct nvkm_fb *);
12 int (*init_page)(struct nvkm_fb *);
13 void (*init_unkn)(struct nvkm_fb *);
14 void (*intr)(struct nvkm_fb *);
15
16 struct {
17 int regions;
18 void (*init)(struct nvkm_fb *, int i, u32 addr, u32 size,
19 u32 pitch, u32 flags, struct nvkm_fb_tile *);
20 void (*comp)(struct nvkm_fb *, int i, u32 size, u32 flags,
21 struct nvkm_fb_tile *);
22 void (*fini)(struct nvkm_fb *, int i, struct nvkm_fb_tile *);
23 void (*prog)(struct nvkm_fb *, int i, struct nvkm_fb_tile *);
24 } tile;
25
26 int (*ram_new)(struct nvkm_fb *, struct nvkm_ram **);
27
28 bool (*memtype_valid)(struct nvkm_fb *, u32 memtype);
29
30 u8 default_bigpage;
31 };
32
33 void nvkm_fb_ctor(const struct nvkm_fb_func *, struct nvkm_device *device,
34 int index, struct nvkm_fb *);
35 int nvkm_fb_new_(const struct nvkm_fb_func *, struct nvkm_device *device,
36 int index, struct nvkm_fb **);
37 int nvkm_fb_bios_memtype(struct nvkm_bios *);
38
39 bool nv04_fb_memtype_valid(struct nvkm_fb *, u32 memtype);
40
41 void nv10_fb_tile_init(struct nvkm_fb *, int i, u32 addr, u32 size,
42 u32 pitch, u32 flags, struct nvkm_fb_tile *);
43 void nv10_fb_tile_fini(struct nvkm_fb *, int i, struct nvkm_fb_tile *);
44 void nv10_fb_tile_prog(struct nvkm_fb *, int, struct nvkm_fb_tile *);
45
46 u32 nv20_fb_tags(struct nvkm_fb *);
47 void nv20_fb_tile_init(struct nvkm_fb *, int i, u32 addr, u32 size,
48 u32 pitch, u32 flags, struct nvkm_fb_tile *);
49 void nv20_fb_tile_fini(struct nvkm_fb *, int i, struct nvkm_fb_tile *);
50 void nv20_fb_tile_prog(struct nvkm_fb *, int, struct nvkm_fb_tile *);
51
52 void nv30_fb_init(struct nvkm_fb *);
53 void nv30_fb_tile_init(struct nvkm_fb *, int i, u32 addr, u32 size,
54 u32 pitch, u32 flags, struct nvkm_fb_tile *);
55
56 void nv40_fb_tile_comp(struct nvkm_fb *, int i, u32 size, u32 flags,
57 struct nvkm_fb_tile *);
58
59 void nv41_fb_init(struct nvkm_fb *);
60 void nv41_fb_tile_prog(struct nvkm_fb *, int, struct nvkm_fb_tile *);
61
62 void nv44_fb_init(struct nvkm_fb *);
63 void nv44_fb_tile_prog(struct nvkm_fb *, int, struct nvkm_fb_tile *);
64
65 void nv46_fb_tile_init(struct nvkm_fb *, int i, u32 addr, u32 size,
66 u32 pitch, u32 flags, struct nvkm_fb_tile *);
67
68 int gf100_fb_oneinit(struct nvkm_fb *);
69 int gf100_fb_init_page(struct nvkm_fb *);
70 bool gf100_fb_memtype_valid(struct nvkm_fb *, u32);
71
72 int gm200_fb_init_page(struct nvkm_fb *);
73 #endif