1 #ifndef __NVKM_FB_PRIV_H__
2 #define __NVKM_FB_PRIV_H__
6 #define nouveau_ram_create(p,e,o,d) \
7 nouveau_object_create_((p), (e), (o), 0, sizeof(**d), (void **)d)
8 #define nouveau_ram_destroy(p) \
9 nouveau_object_destroy(&(p)->base)
10 #define nouveau_ram_init(p) \
11 nouveau_object_init(&(p)->base)
12 #define nouveau_ram_fini(p,s) \
13 nouveau_object_fini(&(p)->base, (s))
15 #define _nouveau_ram_dtor nouveau_object_destroy
16 #define _nouveau_ram_init nouveau_object_init
17 #define _nouveau_ram_fini nouveau_object_fini
19 extern struct nouveau_oclass nv04_ram_oclass;
20 extern struct nouveau_oclass nv10_ram_oclass;
21 extern struct nouveau_oclass nv1a_ram_oclass;
22 extern struct nouveau_oclass nv20_ram_oclass;
23 extern struct nouveau_oclass nv40_ram_oclass;
24 extern struct nouveau_oclass nv41_ram_oclass;
25 extern struct nouveau_oclass nv44_ram_oclass;
26 extern struct nouveau_oclass nv49_ram_oclass;
27 extern struct nouveau_oclass nv4e_ram_oclass;
28 extern struct nouveau_oclass nv50_ram_oclass;
29 extern struct nouveau_oclass nva3_ram_oclass;
30 extern struct nouveau_oclass nvaa_ram_oclass;
31 extern struct nouveau_oclass nvc0_ram_oclass;
33 #define nouveau_fb_create(p,e,c,d) \
34 nouveau_fb_create_((p), (e), (c), sizeof(**d), (void **)d)
35 #define nouveau_fb_destroy(p) ({ \
36 struct nouveau_fb *pfb = (p); \
37 _nouveau_fb_dtor(nv_object(pfb)); \
39 #define nouveau_fb_init(p) ({ \
40 struct nouveau_fb *pfb = (p); \
41 _nouveau_fb_init(nv_object(pfb)); \
43 #define nouveau_fb_fini(p,s) ({ \
44 struct nouveau_fb *pfb = (p); \
45 _nouveau_fb_fini(nv_object(pfb), (s)); \
48 int nouveau_fb_create_(struct nouveau_object *, struct nouveau_object *,
49 struct nouveau_oclass *, int, void **);
50 void _nouveau_fb_dtor(struct nouveau_object *);
51 int _nouveau_fb_init(struct nouveau_object *);
52 int _nouveau_fb_fini(struct nouveau_object *, bool);
54 struct nouveau_fb_impl {
55 struct nouveau_oclass base;
56 struct nouveau_oclass *ram;
60 int nouveau_fb_bios_memtype(struct nouveau_bios *);
62 bool nv04_fb_memtype_valid(struct nouveau_fb *, u32 memtype);
64 void nv10_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
65 u32 pitch, u32 flags, struct nouveau_fb_tile *);
66 void nv10_fb_tile_fini(struct nouveau_fb *, int i, struct nouveau_fb_tile *);
67 void nv10_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
69 void nv20_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
70 u32 pitch, u32 flags, struct nouveau_fb_tile *);
71 void nv20_fb_tile_fini(struct nouveau_fb *, int i, struct nouveau_fb_tile *);
72 void nv20_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
74 int nv30_fb_init(struct nouveau_object *);
75 void nv30_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
76 u32 pitch, u32 flags, struct nouveau_fb_tile *);
78 void nv40_fb_tile_comp(struct nouveau_fb *, int i, u32 size, u32 flags,
79 struct nouveau_fb_tile *);
81 int nv41_fb_init(struct nouveau_object *);
82 void nv41_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
84 int nv44_fb_init(struct nouveau_object *);
85 void nv44_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
87 void nv46_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
88 u32 pitch, u32 flags, struct nouveau_fb_tile *);
90 void __nv50_ram_put(struct nouveau_fb *, struct nouveau_mem *);
91 extern int nv50_fb_memtype[0x80];