1 #ifndef _LINUX_FB_H
2 #define _LINUX_FB_H
3
4
5
6
7
8 #define FBIOGET_VSCREENINFO 0x4600
9 #define FBIOPUT_VSCREENINFO 0x4601
10 #define FBIOGET_FSCREENINFO 0x4602
11 #define FBIOGETCMAP 0x4604
12 #define FBIOPUTCMAP 0x4605
13 #define FBIOPAN_DISPLAY 0x4606
14
15 #define FB_TYPE_PACKED_PIXELS 0
16 #define FB_TYPE_PLANES 1
17 #define FB_TYPE_INTERLEAVED_PLANES 2
18
19 #define FB_VISUAL_MONO01 0
20 #define FB_VISUAL_MONO10 1
21 #define FB_VISUAL_TRUECOLOR 2
22 #define FB_VISUAL_PSEUDOCOLOR 3
23 #define FB_VISUAL_DIRECTCOLOR 4
24 #define FB_VISUAL_STATIC_PSEUDOCOLOR 5
25 #define FB_VISUAL_STATIC_DIRECTCOLOR 6
26
27 struct fb_fix_screeninfo {
28 char id[16];
29 unsigned long smem_start;
30 unsigned long smem_len;
31 int type;
32 int type_aux;
33 int visual;
34 u_short xpanstep;
35 u_short ypanstep;
36 u_short ywrapstep;
37 u_long line_length;
38 short reserved[9];
39 };
40
41 struct fb_bitfield {
42 int offset;
43 int length;
44 int msb_right;
45
46 };
47
48 #define FB_NONSTD_HAM 1
49
50 #define FB_ACTIVATE_NOW 0
51 #define FB_ACTIVATE_NXTOPEN 1
52 #define FB_ACTIVATE_TEST 2
53 #define FB_ACTIVATE_MASK 15
54
55 #define FB_ACTIVATE_VBL 16
56 #define FB_CHANGE_CMAP_VBL 32
57
58 #define FB_ACCEL_NONE 0
59 #define FB_ACCEL_ATARIBLITT 1
60 #define FB_ACCEL_AMIGABLITT 2
61 #define FB_ACCEL_CYBERVISION 3
62
63 #define FB_SYNC_HOR_HIGH_ACT 1
64 #define FB_SYNC_VERT_HIGH_ACT 2
65 #define FB_SYNC_EXT 4
66 #define FB_SYNC_COMP_HIGH_ACT 8
67 #define FB_SYNC_BROADCAST 16
68
69
70
71 #define FB_VMODE_NONINTERLACED 0
72 #define FB_VMODE_INTERLACED 1
73 #define FB_VMODE_DOUBLE 2
74 #define FB_VMODE_MASK 255
75
76 #define FB_VMODE_YWRAP 256
77 #define FB_VMODE_SMOOTH_XPAN 512
78 #define FB_VMODE_CONUPDATE 512
79
80 struct fb_var_screeninfo {
81 int xres;
82 int yres;
83 int xres_virtual;
84 int yres_virtual;
85 int xoffset;
86 int yoffset;
87
88 int bits_per_pixel;
89 int grayscale;
90
91 struct fb_bitfield red;
92 struct fb_bitfield green;
93 struct fb_bitfield blue;
94 struct fb_bitfield transp;
95
96 int nonstd;
97
98 int activate;
99
100 int height;
101 int width;
102
103 int accel;
104
105
106 unsigned long pixclock;
107 unsigned long left_margin;
108 unsigned long right_margin;
109 unsigned long upper_margin;
110 unsigned long lower_margin;
111 unsigned long hsync_len;
112 unsigned long vsync_len;
113 int sync;
114 int vmode;
115 int reserved[6];
116 };
117
118 struct fb_cmap {
119 int start;
120 int len;
121 unsigned short *red;
122 unsigned short *green;
123 unsigned short *blue;
124 unsigned short *transp;
125 };
126
127 #ifdef __KERNEL__
128
129 #include <linux/fs.h>
130
131 struct fb_ops {
132
133 int (*fb_get_fix) (struct fb_fix_screeninfo *, int);
134
135 int (*fb_get_var) (struct fb_var_screeninfo *, int);
136
137 int (*fb_set_var) (struct fb_var_screeninfo *, int);
138
139 int (*fb_get_cmap) (struct fb_cmap *, int, int);
140
141 int (*fb_set_cmap) (struct fb_cmap *, int, int);
142
143 int (*fb_pan_display) (struct fb_var_screeninfo *, int);
144
145 int (*fb_ioctl)(struct inode *, struct file *, unsigned int,
146 unsigned long, int);
147 };
148
149 int register_framebuffer(char *, int *, struct fb_ops *, int,
150 struct fb_var_screeninfo *);
151 int unregister_framebuffer(int);
152
153
154
155
156
157
158 struct display {
159
160
161 struct fb_var_screeninfo var;
162
163 struct fb_cmap cmap;
164 u_char *screen_base;
165 int visual;
166 int type;
167 int type_aux;
168 u_short ypanstep;
169 u_short ywrapstep;
170 u_long line_length;
171 u_short can_soft_blank;
172 u_short inverse;
173
174 #if 0
175 struct fb_fix_cursorinfo fcrsr;
176 struct fb_var_cursorinfo *vcrsr;
177 struct fb_cursorstate crsrstate;
178 #endif
179
180
181
182 struct vc_data *conp;
183 int vrows;
184 int cursor_x;
185 int cursor_y;
186 int fgcol;
187 int bgcol;
188 u_long next_line;
189 u_long next_plane;
190 u_char *fontdata;
191 int fontheight;
192 int fontwidth;
193 int userfont;
194 struct display_switch *dispsw;
195 u_short scrollmode;
196 short yscroll;
197 };
198
199
200 struct fb_info {
201 char modename[40];
202 struct display *disp;
203 char fontname[40];
204 int (*changevar)(int);
205 int (*switch_con)(int);
206 int (*updatevar)(int);
207 void (*blank)(int);
208 };
209
210 #endif
211
212 #if 1
213
214 #define FBCMD_GET_CURRENTPAR 0xDEAD0005
215 #define FBCMD_SET_CURRENTPAR 0xDEAD8005
216
217 #endif
218
219
220 #if 1
221
222
223
224
225
226 #define FBIOGET_FCURSORINFO 0x4607
227 #define FBIOGET_VCURSORINFO 0x4608
228 #define FBIOPUT_VCURSORINFO 0x4609
229 #define FBIOGET_CURSORSTATE 0x460A
230 #define FBIOPUT_CURSORSTATE 0x460B
231
232
233 struct fb_fix_cursorinfo {
234 u_short crsr_width;
235 u_short crsr_height;
236 u_short crsr_xsize;
237 u_short crsr_ysize;
238 u_short crsr_color1;
239 u_short crsr_color2;
240 };
241
242 struct fb_var_cursorinfo {
243 u_short width;
244 u_short height;
245 u_short xspot;
246 u_short yspot;
247 u_char data[1];
248 };
249
250 struct fb_cursorstate {
251 short xoffset;
252 short yoffset;
253 u_short mode;
254 };
255
256 #define FB_CURSOR_OFF 0
257 #define FB_CURSOR_ON 1
258 #define FB_CURSOR_FLASH 2
259
260 #define FBCMD_DRAWLINE 0x4621
261 #define FBCMD_MOVE 0x4622
262
263 #define FB_LINE_XOR 1
264 #define FB_LINE_BOX 2
265 #define FB_LINE_FILLED 4
266
267 struct fb_line {
268 int start_x;
269 int start_y;
270 int end_x;
271 int end_y;
272 int color;
273 int option;
274 };
275
276 struct fb_move {
277 int src_x;
278 int src_y;
279 int dest_x;
280 int dest_y;
281 int height;
282 int width;
283 };
284
285 #endif
286
287
288 #endif