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 	int (*oneinit)(struct nvkm_fb *);
10 	void (*init)(struct nvkm_fb *);
11 	void (*init_page)(struct nvkm_fb *);
12 	void (*init_unkn)(struct nvkm_fb *);
13 	void (*intr)(struct nvkm_fb *);
14 
15 	struct {
16 		int regions;
17 		void (*init)(struct nvkm_fb *, int i, u32 addr, u32 size,
18 			     u32 pitch, u32 flags, struct nvkm_fb_tile *);
19 		void (*comp)(struct nvkm_fb *, int i, u32 size, u32 flags,
20 			     struct nvkm_fb_tile *);
21 		void (*fini)(struct nvkm_fb *, int i, struct nvkm_fb_tile *);
22 		void (*prog)(struct nvkm_fb *, int i, struct nvkm_fb_tile *);
23 	} tile;
24 
25 	int (*ram_new)(struct nvkm_fb *, struct nvkm_ram **);
26 
27 	bool (*memtype_valid)(struct nvkm_fb *, u32 memtype);
28 };
29 
30 void nvkm_fb_ctor(const struct nvkm_fb_func *, struct nvkm_device *device,
31 		  int index, struct nvkm_fb *);
32 int nvkm_fb_new_(const struct nvkm_fb_func *, struct nvkm_device *device,
33 		 int index, struct nvkm_fb **);
34 int nvkm_fb_bios_memtype(struct nvkm_bios *);
35 
36 bool nv04_fb_memtype_valid(struct nvkm_fb *, u32 memtype);
37 
38 void nv10_fb_tile_init(struct nvkm_fb *, int i, u32 addr, u32 size,
39 		       u32 pitch, u32 flags, struct nvkm_fb_tile *);
40 void nv10_fb_tile_fini(struct nvkm_fb *, int i, struct nvkm_fb_tile *);
41 void nv10_fb_tile_prog(struct nvkm_fb *, int, struct nvkm_fb_tile *);
42 
43 void nv20_fb_tile_init(struct nvkm_fb *, int i, u32 addr, u32 size,
44 		       u32 pitch, u32 flags, struct nvkm_fb_tile *);
45 void nv20_fb_tile_fini(struct nvkm_fb *, int i, struct nvkm_fb_tile *);
46 void nv20_fb_tile_prog(struct nvkm_fb *, int, struct nvkm_fb_tile *);
47 
48 void nv30_fb_init(struct nvkm_fb *);
49 void nv30_fb_tile_init(struct nvkm_fb *, int i, u32 addr, u32 size,
50 		       u32 pitch, u32 flags, struct nvkm_fb_tile *);
51 
52 void nv40_fb_tile_comp(struct nvkm_fb *, int i, u32 size, u32 flags,
53 		       struct nvkm_fb_tile *);
54 
55 void nv41_fb_init(struct nvkm_fb *);
56 void nv41_fb_tile_prog(struct nvkm_fb *, int, struct nvkm_fb_tile *);
57 
58 void nv44_fb_init(struct nvkm_fb *);
59 void nv44_fb_tile_prog(struct nvkm_fb *, int, struct nvkm_fb_tile *);
60 
61 void nv46_fb_tile_init(struct nvkm_fb *, int i, u32 addr, u32 size,
62 		       u32 pitch, u32 flags, struct nvkm_fb_tile *);
63 
64 int gf100_fb_oneinit(struct nvkm_fb *);
65 void gf100_fb_init_page(struct nvkm_fb *);
66 bool gf100_fb_memtype_valid(struct nvkm_fb *, u32);
67 
68 void gm200_fb_init_page(struct nvkm_fb *);
69 #endif
70