1 #ifndef __NOUVEAU_FB_H__
2 #define __NOUVEAU_FB_H__
4 #include <core/subdev.h>
5 #include <core/device.h>
10 /* memory type/access flags, do not match hardware values */
11 #define NV_MEM_ACCESS_RO 1
12 #define NV_MEM_ACCESS_WO 2
13 #define NV_MEM_ACCESS_RW (NV_MEM_ACCESS_RO | NV_MEM_ACCESS_WO)
14 #define NV_MEM_ACCESS_SYS 4
15 #define NV_MEM_ACCESS_VM 8
16 #define NV_MEM_ACCESS_NOSNOOP 16
18 #define NV_MEM_TARGET_VRAM 0
19 #define NV_MEM_TARGET_PCI 1
20 #define NV_MEM_TARGET_PCI_NOSNOOP 2
21 #define NV_MEM_TARGET_VM 3
22 #define NV_MEM_TARGET_GART 4
24 #define NV_MEM_TYPE_VM 0x7f
25 #define NV_MEM_COMP_VM 0x03
28 struct drm_device *dev;
30 struct nouveau_vma bar_vma;
31 struct nouveau_vma vma[2];
34 struct nouveau_mm_node *tag;
35 struct list_head regions;
43 struct nouveau_fb_tile {
44 struct nouveau_mm_node *tag;
52 struct nouveau_subdev base;
54 bool (*memtype_valid)(struct nouveau_fb *, u32 memtype);
56 struct nouveau_ram *ram;
58 struct nouveau_mm vram;
59 struct nouveau_mm tags;
62 struct nouveau_fb_tile region[16];
64 void (*init)(struct nouveau_fb *, int i, u32 addr, u32 size,
65 u32 pitch, u32 flags, struct nouveau_fb_tile *);
66 void (*comp)(struct nouveau_fb *, int i, u32 size, u32 flags,
67 struct nouveau_fb_tile *);
68 void (*fini)(struct nouveau_fb *, int i,
69 struct nouveau_fb_tile *);
70 void (*prog)(struct nouveau_fb *, int i,
71 struct nouveau_fb_tile *);
75 static inline struct nouveau_fb *
78 return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_FB];
81 extern struct nouveau_oclass *nv04_fb_oclass;
82 extern struct nouveau_oclass *nv10_fb_oclass;
83 extern struct nouveau_oclass *nv1a_fb_oclass;
84 extern struct nouveau_oclass *nv20_fb_oclass;
85 extern struct nouveau_oclass *nv25_fb_oclass;
86 extern struct nouveau_oclass *nv30_fb_oclass;
87 extern struct nouveau_oclass *nv35_fb_oclass;
88 extern struct nouveau_oclass *nv36_fb_oclass;
89 extern struct nouveau_oclass *nv40_fb_oclass;
90 extern struct nouveau_oclass *nv41_fb_oclass;
91 extern struct nouveau_oclass *nv44_fb_oclass;
92 extern struct nouveau_oclass *nv46_fb_oclass;
93 extern struct nouveau_oclass *nv47_fb_oclass;
94 extern struct nouveau_oclass *nv49_fb_oclass;
95 extern struct nouveau_oclass *nv4e_fb_oclass;
96 extern struct nouveau_oclass *nv50_fb_oclass;
97 extern struct nouveau_oclass *nv84_fb_oclass;
98 extern struct nouveau_oclass *nva3_fb_oclass;
99 extern struct nouveau_oclass *nvaa_fb_oclass;
100 extern struct nouveau_oclass *nvaf_fb_oclass;
101 extern struct nouveau_oclass *nvc0_fb_oclass;
102 extern struct nouveau_oclass *nve0_fb_oclass;
105 struct nouveau_object base;
107 NV_MEM_TYPE_UNKNOWN = 0,
126 int (*get)(struct nouveau_fb *, u64 size, u32 align,
127 u32 size_nc, u32 type, struct nouveau_mem **);
128 void (*put)(struct nouveau_fb *, struct nouveau_mem **);
130 int (*calc)(struct nouveau_fb *, u32 freq);
131 int (*prog)(struct nouveau_fb *);
132 void (*tidy)(struct nouveau_fb *);
137 } rammap, ramcfg, timing;