1 |
1633 |
jcastillo |
#ifndef _LINUX_FB_H
|
2 |
|
|
#define _LINUX_FB_H
|
3 |
|
|
|
4 |
|
|
/* Definitions of frame buffers */
|
5 |
|
|
|
6 |
|
|
/* ioctls
|
7 |
|
|
0x46 is 'F' */
|
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 /* Packed Pixels */
|
16 |
|
|
#define FB_TYPE_PLANES 1 /* Non interleaved planes */
|
17 |
|
|
#define FB_TYPE_INTERLEAVED_PLANES 2 /* Interleaved planes */
|
18 |
|
|
|
19 |
|
|
#define FB_VISUAL_MONO01 0 /* Monochr. 1=Black 0=White */
|
20 |
|
|
#define FB_VISUAL_MONO10 1 /* Monochr. 1=White 0=Black */
|
21 |
|
|
#define FB_VISUAL_TRUECOLOR 2 /* True color */
|
22 |
|
|
#define FB_VISUAL_PSEUDOCOLOR 3 /* Pseudo color (like atari) */
|
23 |
|
|
#define FB_VISUAL_DIRECTCOLOR 4 /* Direct color */
|
24 |
|
|
#define FB_VISUAL_STATIC_PSEUDOCOLOR 5 /* Pseudo color readonly */
|
25 |
|
|
#define FB_VISUAL_STATIC_DIRECTCOLOR 6 /* Direct color readonly */
|
26 |
|
|
|
27 |
|
|
struct fb_fix_screeninfo {
|
28 |
|
|
char id[16]; /* identification string eg "TT Builtin" */
|
29 |
|
|
unsigned long smem_start; /* Start of frame buffer mem */
|
30 |
|
|
unsigned long smem_len; /* Length of frame buffer mem */
|
31 |
|
|
int type; /* see FB_TYPE_* */
|
32 |
|
|
int type_aux; /* Interleave for interleaved Planes */
|
33 |
|
|
int visual; /* see FB_VISUAL_* */
|
34 |
|
|
u_short xpanstep; /* zero if no hardware panning */
|
35 |
|
|
u_short ypanstep; /* zero if no hardware panning */
|
36 |
|
|
u_short ywrapstep; /* zero if no hardware ywrap */
|
37 |
|
|
u_long line_length; /* length of a line in bytes */
|
38 |
|
|
short reserved[9]; /* Reserved for future compatibility */
|
39 |
|
|
};
|
40 |
|
|
|
41 |
|
|
struct fb_bitfield {
|
42 |
|
|
int offset; /* beginning of bitfield */
|
43 |
|
|
int length; /* length of bitfield */
|
44 |
|
|
int msb_right; /* != 0 : Most significant bit is */
|
45 |
|
|
/* right */
|
46 |
|
|
};
|
47 |
|
|
|
48 |
|
|
#define FB_NONSTD_HAM 1 /* Hold-And-Modify (HAM) */
|
49 |
|
|
|
50 |
|
|
#define FB_ACTIVATE_NOW 0 /* set values immediately (or vbl)*/
|
51 |
|
|
#define FB_ACTIVATE_NXTOPEN 1 /* activate on next open */
|
52 |
|
|
#define FB_ACTIVATE_TEST 2 /* don't set, round up impossible */
|
53 |
|
|
#define FB_ACTIVATE_MASK 15
|
54 |
|
|
/* values */
|
55 |
|
|
#define FB_ACTIVATE_VBL 16 /* activate values on next vbl */
|
56 |
|
|
#define FB_CHANGE_CMAP_VBL 32 /* change colormap on vbl */
|
57 |
|
|
|
58 |
|
|
#define FB_ACCEL_NONE 0 /* no hardware accelerator */
|
59 |
|
|
#define FB_ACCEL_ATARIBLITT 1 /* Atari Blitter */
|
60 |
|
|
#define FB_ACCEL_AMIGABLITT 2 /* Amiga Blitter */
|
61 |
|
|
#define FB_ACCEL_CYBERVISION 3 /* Cybervision64 (S3 Trio64) */
|
62 |
|
|
|
63 |
|
|
#define FB_SYNC_HOR_HIGH_ACT 1 /* horizontal sync high active */
|
64 |
|
|
#define FB_SYNC_VERT_HIGH_ACT 2 /* vertical sync high active */
|
65 |
|
|
#define FB_SYNC_EXT 4 /* external sync */
|
66 |
|
|
#define FB_SYNC_COMP_HIGH_ACT 8 /* composite sync high active */
|
67 |
|
|
#define FB_SYNC_BROADCAST 16 /* broadcast video timings */
|
68 |
|
|
/* vtotal = 144d/288n/576i => PAL */
|
69 |
|
|
/* vtotal = 121d/242n/484i => NTSC */
|
70 |
|
|
|
71 |
|
|
#define FB_VMODE_NONINTERLACED 0 /* non interlaced */
|
72 |
|
|
#define FB_VMODE_INTERLACED 1 /* interlaced */
|
73 |
|
|
#define FB_VMODE_DOUBLE 2 /* double scan */
|
74 |
|
|
#define FB_VMODE_MASK 255
|
75 |
|
|
|
76 |
|
|
#define FB_VMODE_YWRAP 256 /* ywrap instead of panning */
|
77 |
|
|
#define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */
|
78 |
|
|
#define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */
|
79 |
|
|
|
80 |
|
|
struct fb_var_screeninfo {
|
81 |
|
|
int xres; /* visible resolution */
|
82 |
|
|
int yres;
|
83 |
|
|
int xres_virtual; /* virtual resolution */
|
84 |
|
|
int yres_virtual;
|
85 |
|
|
int xoffset; /* offset from virtual to visible */
|
86 |
|
|
int yoffset; /* resolution */
|
87 |
|
|
|
88 |
|
|
int bits_per_pixel; /* guess what */
|
89 |
|
|
int grayscale; /* != 0 Graylevels instead of colors */
|
90 |
|
|
|
91 |
|
|
struct fb_bitfield red; /* bitfield in fb mem if true color, */
|
92 |
|
|
struct fb_bitfield green; /* else only length is significant */
|
93 |
|
|
struct fb_bitfield blue;
|
94 |
|
|
struct fb_bitfield transp; /* transparency */
|
95 |
|
|
|
96 |
|
|
int nonstd; /* != 0 Non standard pixel format */
|
97 |
|
|
|
98 |
|
|
int activate; /* see FB_ACTIVATE_* */
|
99 |
|
|
|
100 |
|
|
int height; /* height of picture in mm */
|
101 |
|
|
int width; /* width of picture in mm */
|
102 |
|
|
|
103 |
|
|
int accel; /* see FB_ACCEL_* */
|
104 |
|
|
|
105 |
|
|
/* Timing: All values in pixclocks, except pixclock (of course) */
|
106 |
|
|
unsigned long pixclock; /* pixel clock in ps (pico seconds) */
|
107 |
|
|
unsigned long left_margin; /* time from sync to picture */
|
108 |
|
|
unsigned long right_margin; /* time from picture to sync */
|
109 |
|
|
unsigned long upper_margin; /* time from sync to picture */
|
110 |
|
|
unsigned long lower_margin;
|
111 |
|
|
unsigned long hsync_len; /* length of horizontal sync */
|
112 |
|
|
unsigned long vsync_len; /* length of vertical sync */
|
113 |
|
|
int sync; /* see FB_SYNC_* */
|
114 |
|
|
int vmode; /* see FB_VMODE_* */
|
115 |
|
|
int reserved[6]; /* Reserved for future compatibility */
|
116 |
|
|
};
|
117 |
|
|
|
118 |
|
|
struct fb_cmap {
|
119 |
|
|
int start; /* First entry */
|
120 |
|
|
int len; /* Number of entries */
|
121 |
|
|
unsigned short *red; /* Red values */
|
122 |
|
|
unsigned short *green;
|
123 |
|
|
unsigned short *blue;
|
124 |
|
|
unsigned short *transp; /* transparency, can be NULL */
|
125 |
|
|
};
|
126 |
|
|
|
127 |
|
|
#ifdef __KERNEL__
|
128 |
|
|
|
129 |
|
|
#include <linux/fs.h>
|
130 |
|
|
|
131 |
|
|
struct fb_ops {
|
132 |
|
|
/* get non settable parameters */
|
133 |
|
|
int (*fb_get_fix) (struct fb_fix_screeninfo *, int);
|
134 |
|
|
/* get settable parameters */
|
135 |
|
|
int (*fb_get_var) (struct fb_var_screeninfo *, int);
|
136 |
|
|
/* set settable parameters */
|
137 |
|
|
int (*fb_set_var) (struct fb_var_screeninfo *, int);
|
138 |
|
|
/* get colormap */
|
139 |
|
|
int (*fb_get_cmap) (struct fb_cmap *, int, int);
|
140 |
|
|
/* set colormap */
|
141 |
|
|
int (*fb_set_cmap) (struct fb_cmap *, int, int);
|
142 |
|
|
/* pan display */
|
143 |
|
|
int (*fb_pan_display) (struct fb_var_screeninfo *, int);
|
144 |
|
|
/* perform fb specific ioctl */
|
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 |
|
|
* This is the interface between the low-level console driver and the
|
155 |
|
|
* low-level frame buffer device
|
156 |
|
|
*/
|
157 |
|
|
|
158 |
|
|
struct display {
|
159 |
|
|
/* Filled in by the frame buffer device */
|
160 |
|
|
|
161 |
|
|
struct fb_var_screeninfo var; /* variable infos. yoffset and vmode */
|
162 |
|
|
/* are updated by fbcon.c */
|
163 |
|
|
struct fb_cmap cmap; /* colormap */
|
164 |
|
|
u_char *screen_base; /* pointer to top of virtual screen */
|
165 |
|
|
int visual;
|
166 |
|
|
int type; /* see FB_TYPE_* */
|
167 |
|
|
int type_aux; /* Interleave for interleaved Planes */
|
168 |
|
|
u_short ypanstep; /* zero if no hardware ypan */
|
169 |
|
|
u_short ywrapstep; /* zero if no hardware ywrap */
|
170 |
|
|
u_long line_length; /* length of a line in bytes */
|
171 |
|
|
u_short can_soft_blank; /* zero if no hardware blanking */
|
172 |
|
|
u_short inverse; /* != 0 text black on white as default */
|
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 |
|
|
/* Filled in by the low-level console driver */
|
181 |
|
|
|
182 |
|
|
struct vc_data *conp; /* pointer to console data */
|
183 |
|
|
int vrows; /* number of virtual rows */
|
184 |
|
|
int cursor_x; /* current cursor position */
|
185 |
|
|
int cursor_y;
|
186 |
|
|
int fgcol; /* text colors */
|
187 |
|
|
int bgcol;
|
188 |
|
|
u_long next_line; /* offset to one line below */
|
189 |
|
|
u_long next_plane; /* offset to next plane */
|
190 |
|
|
u_char *fontdata; /* Font associated to this display */
|
191 |
|
|
int fontheight;
|
192 |
|
|
int fontwidth;
|
193 |
|
|
int userfont; /* != 0 if fontdata kmalloc()ed */
|
194 |
|
|
struct display_switch *dispsw; /* low level operations */
|
195 |
|
|
u_short scrollmode; /* Scroll Method */
|
196 |
|
|
short yscroll; /* Hardware scrolling */
|
197 |
|
|
};
|
198 |
|
|
|
199 |
|
|
|
200 |
|
|
struct fb_info {
|
201 |
|
|
char modename[40]; /* at boottime detected video mode */
|
202 |
|
|
struct display *disp; /* pointer to display variables */
|
203 |
|
|
char fontname[40]; /* default font name */
|
204 |
|
|
int (*changevar)(int); /* tell console var has changed */
|
205 |
|
|
int (*switch_con)(int); /* tell fb to switch consoles */
|
206 |
|
|
int (*updatevar)(int); /* tell fb to update the vars */
|
207 |
|
|
void (*blank)(int); /* tell fb to (un)blank the screen */
|
208 |
|
|
};
|
209 |
|
|
|
210 |
|
|
#endif /* __KERNEL__ */
|
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 /* Preliminary */
|
221 |
|
|
|
222 |
|
|
/*
|
223 |
|
|
* Hardware Cursor
|
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; /* width and height of the cursor in */
|
235 |
|
|
u_short crsr_height; /* pixels (zero if no cursor) */
|
236 |
|
|
u_short crsr_xsize; /* cursor size in display pixels */
|
237 |
|
|
u_short crsr_ysize;
|
238 |
|
|
u_short crsr_color1; /* colormap entry for cursor color1 */
|
239 |
|
|
u_short crsr_color2; /* colormap entry for cursor 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]; /* field with [height][width] */
|
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 /* Preliminary */
|
286 |
|
|
|
287 |
|
|
|
288 |
|
|
#endif /* _LINUX_FB_H */
|