FreeBSD/Linux Kernel Cross Reference
sys/chips/screen.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * HISTORY
28 * $Log: screen.h,v $
29 * Revision 2.9 92/05/22 15:48:29 jfriedl
30 * Added SCREEN_BEING_UPDATED flag value.
31 * [92/05/21 18:50:43 af]
32 *
33 * Weird devices, weird fixes.
34 * [92/05/20 22:47:05 af]
35 *
36 * Various renames to make 2D/3D drivers work.
37 * [92/05/13 20:46:35 af]
38 *
39 * Revision 2.8 91/08/24 11:53:04 af
40 * Added frame size related defs, and get_status call.
41 * [91/08/02 02:05:23 af]
42 *
43 * Revision 2.7 91/06/19 11:54:17 rvb
44 * File moved here from mips/PMAX since it tries to be generic;
45 * it is used on the PMAX and the Vax3100.
46 * [91/06/04 rvb]
47 *
48 * Revision 2.6 91/05/14 17:27:25 mrt
49 * Correcting copyright
50 *
51 * Revision 2.5 91/03/16 14:54:40 rpd
52 * Fixed ioctl definitions for ANSI C.
53 * [91/02/20 rpd]
54 *
55 * Revision 2.4 91/02/05 17:44:13 mrt
56 * Added author notices
57 * [91/02/04 11:17:36 mrt]
58 *
59 * Changed to use new Mach copyright
60 * [91/02/02 12:16:09 mrt]
61 *
62 * Revision 2.3 90/12/05 23:34:10 af
63 * Works on both 3maxen and pmaxen.
64 * [90/12/03 23:35:23 af]
65 *
66 * Revision 2.1.1.1 90/11/01 03:41:33 af
67 * Created.
68 * [90/09/03 af]
69 */
70 /*
71 * File: screen.h
72 * Author: Alessandro Forin, Carnegie Mellon University
73 * Date: 9/90
74 *
75 * Definitions for the Generic Screen Driver.
76 */
77
78 /*
79 * Most of these structures are defined so that the
80 * resulting structure mapped to user space appears
81 * to be compatible with the one used by the DEC X
82 * servers (pm_info..). Keep it that way and the
83 * X servers will keep on running.
84 */
85
86 /*
87 * Generic structures and defines
88 */
89
90 /* colors */
91 typedef struct {
92 unsigned short red;
93 unsigned short green;
94 unsigned short blue;
95 } color_map_t;
96
97 typedef struct {
98 short unused;
99 unsigned short index;
100 color_map_t value;
101 } color_map_entry_t;
102
103 typedef struct {
104 unsigned int Bg_rgb[3];
105 unsigned int Fg_rgb[3];
106 } cursor_color_t;
107
108 /* generic input event */
109 typedef struct {
110 short x; /* x position */
111 short y; /* y position */
112 unsigned int time; /* 1 millisecond units */
113
114 unsigned char type; /* button up/down/raw or motion */
115 # define EVT_BUTTON_UP 0
116 # define EVT_BUTTON_DOWN 1
117 # define EVT_BUTTON_RAW 2
118 # define EVT_PTR_MOTION 3
119
120 unsigned char key; /* the key (button only) */
121 # define KEY_LEFT_BUTTON 1
122 # define KEY_MIDDLE_BUTTON 2
123 # define KEY_RIGHT_BUTTON 3
124 # define KEY_TBL_LEFT_BUTTON 0
125 # define KEY_TBL_FRONT_BUTTON 1
126 # define KEY_TBL_RIGHT_BUTTON 2
127 # define KEY_TBL_BACK_BUTTON 3
128
129 unsigned char index; /* which instance of device */
130
131 unsigned char device; /* which device */
132 # define DEV_NULL 0
133 # define DEV_MOUSE 1
134 # define DEV_KEYBD 2
135 # define DEV_TABLET 3
136 # define DEV_AUX 4
137 # define DEV_CONSOLE 5
138 # define DEV_KNOB 8
139 # define DEV_JOYSTICK 9
140
141 } screen_event_t;
142
143 /* timed coordinate info */
144 typedef struct {
145 unsigned int time;
146 short x, y;
147 } screen_timed_point_t;
148
149 /* queue of input events, and ring of mouse motions track */
150 typedef struct {
151 screen_event_t *events;
152 unsigned int q_size;
153 unsigned int q_head;
154 unsigned int q_tail;
155 unsigned long timestamp;
156 screen_timed_point_t *track;
157 unsigned int t_size;
158 unsigned int t_next;
159 } screen_evque_t;
160
161 /* mouse/cursor position */
162 typedef struct {
163 short x;
164 short y;
165 } screen_point_t;
166
167 /* mouse motion bounding boxes */
168 typedef struct {
169 short bottom;
170 short right;
171 short left;
172 short top;
173 } screen_rect_t;
174
175 /*
176 * Here it is, each field is marked as
177 *
178 * Kset : kernel sets it unconditionally
179 * Kuse : kernel uses it, safely
180 * Kdep : kernel might depend on it
181 */
182 typedef struct {
183 screen_evque_t evque; /* Kset, Kuse */
184 short mouse_buttons; /* Kset */
185 screen_point_t xx3 /*tablet*/;
186 short xx4 /*tswitches*/;
187 screen_point_t cursor; /* Kset */
188 short row; /* Kdep */
189 short col; /* Kdep */
190 short max_row; /* Kdep */
191 short max_col; /* Kdep */
192 short max_x; /* Kset */
193 short max_y; /* Kset */
194 short max_cur_x; /* Kdep */
195 short max_cur_y; /* Kdep */
196 int version; /* Kset */
197 union {
198 struct {
199 unsigned char * bitmap; /* Kset */
200 short * x16 /*scanmap*/;
201 short * x17 /*cursorbits*/;
202 short * x18 /*pmaddr*/;
203 unsigned char * planemask; /* Kset */
204 } pm;
205 struct {
206 int x15 /* flags */;
207 int * gram /* Kset */;
208 int * rb_addr /* Kset */;
209 int rb_phys /* Kset */;
210 int rb_size /* Kset */;
211 } gx;
212 } dev_dep_1;
213 screen_point_t mouse_loc; /* Kdep */
214 screen_rect_t mouse_box; /* Kdep */
215 short mouse_threshold;/* Kuse */
216 short mouse_scale; /* Kuse */
217 short min_cur_x; /* Kdep */
218 short min_cur_y; /* Kdep */
219 union {
220 struct {
221 int x26 /*dev_type*/;
222 char * x27 /*framebuffer*/;
223 char * x28 /*volatile struct bt459 *bt459*/;
224 int x29 /*slot*/;
225 char cursor_sprite[1024];/* Kset */
226 unsigned char Bg_color[3]; /* Kset */
227 unsigned char Fg_color[3]; /* Kset */
228 int tablet_scale_x; /* Kuse */
229 int tablet_scale_y; /* Kuse */
230 } pm;
231 struct {
232 char * gxo /* Kset */;
233 char stamp_width /* Kset */;
234 char stamp_height /* Kset */;
235 char nplanes /* Kset */;
236 char x27_4 /* n10_present */;
237 char x28_1 /* dplanes */;
238 char zplanes /* Kset */;
239 char zzplanes /* Kset */;
240 unsigned char cursor_sprite[1024] /* Kuse */;
241 char x285_0 /* padding for next, which was int */;
242 unsigned char Fg_color[4] /* Kuse */;
243 unsigned char Bg_color[4] /* Kuse */;
244 unsigned short cmap_index /* Kuse */;
245 unsigned short cmap_count /* Kuse */;
246 unsigned int colormap[256] /* Kuse */;
247 int * stic_dma_rb /* Kset */;
248 int * stic_reg /* Kset */;
249 int ptpt_phys /* Kdep */;
250 int ptpt_size /* Kdep */;
251 int * ptpt_pgin /* Kset */;
252 } gx;
253 } dev_dep_2;
254 short frame_scanline_width; /* in pixels, Kset */
255 short frame_height; /* in scanlines, Kset */
256 /*
257 * Event queues are allocated right after that
258 */
259 #define MAX_EVENTS 64
260 #define MAX_TRACK 100
261 screen_event_t event_queue[MAX_EVENTS]; /* Kset */
262 screen_timed_point_t point_track[MAX_TRACK]; /* Kset */
263 /*
264 * Some like it hot
265 */
266 unsigned int event_id;
267 int interrupt_info;
268 } user_info_t;
269
270
271 /*
272 * Screen get_status codes and arguments
273 */
274 #include <sys/ioctl.h>
275
276 /* Get size (and offset) of mapped info */
277 #define SCREEN_GET_OFFSETS _IOR('q', 6, unsigned **)
278
279 /* Get screen status flags */
280 #define SCREEN_STATUS_FLAGS _IOR('q', 22, int *)
281 # define MONO_SCREEN 0x01
282 # define COLOR_SCREEN 0x02
283 # define SCREEN_BEING_UPDATED 0x04
284
285 /*
286 * Screen set_status codes and arguments
287 */
288
289 /* start/stop screen saver, control fading interval */
290 #define SCREEN_FADE _IOW('q', 114, int) /* fade screen */
291 # define NO_FADE -1
292
293 /* Turn video on/off manually */
294 #define SCREEN_ON _IO('q', 10)
295 #define SCREEN_OFF _IO('q', 11)
296
297 /* Fixup pointers inside mapped info structure */
298 #define SCREEN_ADJ_MAPPED_INFO _IOR('q', 1, user_info_t *)
299
300 /* Initialize anything that needs to, hw-wise */
301 #define SCREEN_INIT _IO('q', 4)
302
303 /* Position cursor to a specific spot */
304 #define SCREEN_SET_CURSOR _IOW('q', 2, screen_point_t)
305
306 /* Load Bg/Fg colors for cursor */
307 #define SCREEN_SET_CURSOR_COLOR _IOW('q', 3, cursor_color_t)
308
309 /* Load cursor sprite, small cursor form */
310 typedef unsigned short cursor_sprite_t[32];
311
312 #define SCREEN_LOAD_CURSOR _IOW('q', 7, cursor_sprite_t)
313
314 /* Load cursor sprite, large 64x64 cursor form */
315 typedef char cursor_sprite_long_t[1024];
316
317 #define SCREEN_LOAD_CURSOR_LONG _IOW('q', 13, cursor_sprite_long_t)
318
319 /* Modify a given entry in the color map (VDAC) */
320 #define SCREEN_SET_CMAP_ENTRY _IOW('q', 12, color_map_entry_t)
321
322 /* Return some other information about hardware (optional) */
323 typedef struct {
324 int frame_width;
325 int frame_height;
326 int frame_visible_width;
327 int frame_visible_height;
328 } screen_hw_info_t;
329 #define SCREEN_HARDWARE_INFO _IOR('q', 23, screen_hw_info_t)
330
331 /* Screen-dependent, unspecified (and despised) */
332 #define SCREEN_HARDWARE_DEP _IO('q', 24)
333
Cache object: d85c9bdf24c08a9ead52b412cfa41fb2
|