1/* $XFree86: xc/include/extensions/xf86vmstr.h,v 3.27 2001/08/01 00:44:36 tsi Exp $ */
2/*
3
4Copyright 1995  Kaleb S. KEITHLEY
5
6Permission is hereby granted, free of charge, to any person obtaining
7a copy of this software and associated documentation files (the
8"Software"), to deal in the Software without restriction, including
9without limitation the rights to use, copy, modify, merge, publish,
10distribute, sublicense, and/or sell copies of the Software, and to
11permit persons to whom the Software is furnished to do so, subject to
12the following conditions:
13
14The above copyright notice and this permission notice shall be
15included in all copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES
21OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23OTHER DEALINGS IN THE SOFTWARE.
24
25Except as contained in this notice, the name of Kaleb S. KEITHLEY
26shall not be used in advertising or otherwise to promote the sale, use
27or other dealings in this Software without prior written authorization
28from Kaleb S. KEITHLEY
29
30*/
31/* $Xorg: xf86vmstr.h,v 1.3 2000/08/18 04:05:46 coskrey Exp $ */
32
33/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
34
35#ifndef _XF86VIDMODESTR_H_
36#define _XF86VIDMODESTR_H_
37
38#include "xf86vmode.h"
39
40#define XF86VIDMODENAME "XFree86-VidModeExtension"
41
42#define XF86VIDMODE_MAJOR_VERSION	2	/* current version numbers */
43#define XF86VIDMODE_MINOR_VERSION	1
44/*
45 * major version 0 == uses parameter-to-wire functions in XFree86 libXxf86vm.
46 * major version 1 == uses parameter-to-wire functions hard-coded in xvidtune
47 *                    client.
48 * major version 2 == uses new protocol version in XFree86 4.0.
49 */
50
51typedef struct _XF86VidModeQueryVersion {
52    CARD8	reqType;		/* always XF86VidModeReqCode */
53    CARD8	xf86vidmodeReqType;	/* always X_XF86VidModeQueryVersion */
54    CARD16	length B16;
55} xXF86VidModeQueryVersionReq;
56#define sz_xXF86VidModeQueryVersionReq	4
57
58typedef struct {
59    BYTE	type;			/* X_Reply */
60    BOOL	pad1;
61    CARD16	sequenceNumber B16;
62    CARD32	length B32;
63    CARD16	majorVersion B16;	/* major version of XF86VidMode */
64    CARD16	minorVersion B16;	/* minor version of XF86VidMode */
65    CARD32	pad2 B32;
66    CARD32	pad3 B32;
67    CARD32	pad4 B32;
68    CARD32	pad5 B32;
69    CARD32	pad6 B32;
70} xXF86VidModeQueryVersionReply;
71#define sz_xXF86VidModeQueryVersionReply	32
72
73typedef struct _XF86VidModeGetModeLine {
74    CARD8	reqType;		/* always XF86VidModeReqCode */
75    CARD8	xf86vidmodeReqType;
76    CARD16	length B16;
77    CARD16	screen B16;
78    CARD16	pad B16;
79} xXF86VidModeGetModeLineReq,
80  xXF86VidModeGetAllModeLinesReq,
81  xXF86VidModeGetMonitorReq,
82  xXF86VidModeGetViewPortReq,
83  xXF86VidModeGetDotClocksReq;
84#define sz_xXF86VidModeGetModeLineReq		8
85#define sz_xXF86VidModeGetAllModeLinesReq	8
86#define sz_xXF86VidModeGetMonitorReq		8
87#define sz_xXF86VidModeGetViewPortReq		8
88#define sz_xXF86VidModeGetDotClocksReq		8
89
90typedef struct {
91    BYTE	type;			/* X_Reply */
92    BOOL	pad1;
93    CARD16	sequenceNumber B16;
94    CARD32	length B32;
95    CARD32	dotclock B32;
96    CARD16	hdisplay B16;
97    CARD16	hsyncstart B16;
98    CARD16	hsyncend B16;
99    CARD16	htotal B16;
100    CARD16	hskew B16;
101    CARD16	vdisplay B16;
102    CARD16	vsyncstart B16;
103    CARD16	vsyncend B16;
104    CARD16	vtotal B16;
105    CARD16	pad2 B16;
106    CARD32	flags B32;
107    CARD32	reserved1 B32;
108    CARD32	reserved2 B32;
109    CARD32	reserved3 B32;
110    CARD32	privsize B32;
111} xXF86VidModeGetModeLineReply;
112#define sz_xXF86VidModeGetModeLineReply	52
113
114/* 0.x version */
115typedef struct {
116    BYTE	type;			/* X_Reply */
117    BOOL	pad1;
118    CARD16	sequenceNumber B16;
119    CARD32	length B32;
120    CARD32	dotclock B32;
121    CARD16	hdisplay B16;
122    CARD16	hsyncstart B16;
123    CARD16	hsyncend B16;
124    CARD16	htotal B16;
125    CARD16	vdisplay B16;
126    CARD16	vsyncstart B16;
127    CARD16	vsyncend B16;
128    CARD16	vtotal B16;
129    CARD32	flags B32;
130    CARD32	privsize B32;
131} xXF86OldVidModeGetModeLineReply;
132#define sz_xXF86OldVidModeGetModeLineReply	36
133
134typedef struct {
135    CARD32	dotclock B32;
136    CARD16	hdisplay B16;
137    CARD16	hsyncstart B16;
138    CARD16	hsyncend B16;
139    CARD16	htotal B16;
140    CARD32	hskew B16;
141    CARD16	vdisplay B16;
142    CARD16	vsyncstart B16;
143    CARD16	vsyncend B16;
144    CARD16	vtotal B16;
145    CARD16	pad1 B16;
146    CARD32	flags B32;
147    CARD32	reserved1 B32;
148    CARD32	reserved2 B32;
149    CARD32	reserved3 B32;
150    CARD32	privsize B32;
151} xXF86VidModeModeInfo;
152
153/* 0.x version */
154typedef struct {
155    CARD32	dotclock B32;
156    CARD16	hdisplay B16;
157    CARD16	hsyncstart B16;
158    CARD16	hsyncend B16;
159    CARD16	htotal B16;
160    CARD16	vdisplay B16;
161    CARD16	vsyncstart B16;
162    CARD16	vsyncend B16;
163    CARD16	vtotal B16;
164    CARD32	flags B32;
165    CARD32	privsize B32;
166} xXF86OldVidModeModeInfo;
167
168typedef struct {
169    BYTE	type;			/* X_Reply */
170    BOOL	pad1;
171    CARD16	sequenceNumber B16;
172    CARD32	length B32;
173    CARD32	modecount B32;
174    CARD32	pad2 B32;
175    CARD32	pad3 B32;
176    CARD32	pad4 B32;
177    CARD32	pad5 B32;
178    CARD32	pad6 B32;
179} xXF86VidModeGetAllModeLinesReply;
180#define sz_xXF86VidModeGetAllModeLinesReply	32
181
182typedef struct _XF86VidModeAddModeLine {
183    CARD8	reqType;		/* always XF86VidModeReqCode */
184    CARD8	xf86vidmodeReqType;	/* always X_XF86VidModeAddMode */
185    CARD16	length B16;
186    CARD32	screen B32;		/* could be CARD16 but need the pad */
187    CARD32	dotclock B32;
188    CARD16	hdisplay B16;
189    CARD16	hsyncstart B16;
190    CARD16	hsyncend B16;
191    CARD16	htotal B16;
192    CARD16	hskew B16;
193    CARD16	vdisplay B16;
194    CARD16	vsyncstart B16;
195    CARD16	vsyncend B16;
196    CARD16	vtotal B16;
197    CARD16	pad1 B16;
198    CARD32	flags B32;
199    CARD32	reserved1 B32;
200    CARD32	reserved2 B32;
201    CARD32	reserved3 B32;
202    CARD32	privsize B32;
203    CARD32	after_dotclock B32;
204    CARD16	after_hdisplay B16;
205    CARD16	after_hsyncstart B16;
206    CARD16	after_hsyncend B16;
207    CARD16	after_htotal B16;
208    CARD16	after_hskew B16;
209    CARD16	after_vdisplay B16;
210    CARD16	after_vsyncstart B16;
211    CARD16	after_vsyncend B16;
212    CARD16	after_vtotal B16;
213    CARD16	pad2 B16;
214    CARD32	after_flags B32;
215    CARD32	reserved4 B32;
216    CARD32	reserved5 B32;
217    CARD32	reserved6 B32;
218} xXF86VidModeAddModeLineReq;
219#define sz_xXF86VidModeAddModeLineReq	92
220
221/* 0.x version */
222typedef struct _XF86OldVidModeAddModeLine {
223    CARD8	reqType;		/* always XF86VidModeReqCode */
224    CARD8	xf86vidmodeReqType;	/* always X_XF86VidModeAddMode */
225    CARD16	length B16;
226    CARD32	screen B32;		/* could be CARD16 but need the pad */
227    CARD32	dotclock B32;
228    CARD16	hdisplay B16;
229    CARD16	hsyncstart B16;
230    CARD16	hsyncend B16;
231    CARD16	htotal B16;
232    CARD16	vdisplay B16;
233    CARD16	vsyncstart B16;
234    CARD16	vsyncend B16;
235    CARD16	vtotal B16;
236    CARD32	flags B32;
237    CARD32	privsize B32;
238    CARD32	after_dotclock B32;
239    CARD16	after_hdisplay B16;
240    CARD16	after_hsyncstart B16;
241    CARD16	after_hsyncend B16;
242    CARD16	after_htotal B16;
243    CARD16	after_vdisplay B16;
244    CARD16	after_vsyncstart B16;
245    CARD16	after_vsyncend B16;
246    CARD16	after_vtotal B16;
247    CARD32	after_flags B32;
248} xXF86OldVidModeAddModeLineReq;
249#define sz_xXF86OldVidModeAddModeLineReq	60
250
251typedef struct _XF86VidModeModModeLine {
252    CARD8	reqType;		/* always XF86VidModeReqCode */
253    CARD8	xf86vidmodeReqType;	/* always X_XF86VidModeModModeLine */
254    CARD16	length B16;
255    CARD32	screen B32;		/* could be CARD16 but need the pad */
256    CARD16	hdisplay B16;
257    CARD16	hsyncstart B16;
258    CARD16	hsyncend B16;
259    CARD16	htotal B16;
260    CARD16	hskew B16;
261    CARD16	vdisplay B16;
262    CARD16	vsyncstart B16;
263    CARD16	vsyncend B16;
264    CARD16	vtotal B16;
265    CARD16	pad1 B16;
266    CARD32	flags B32;
267    CARD32	reserved1 B32;
268    CARD32	reserved2 B32;
269    CARD32	reserved3 B32;
270    CARD32	privsize B32;
271} xXF86VidModeModModeLineReq;
272#define sz_xXF86VidModeModModeLineReq	48
273
274/* 0.x version */
275typedef struct _XF86OldVidModeModModeLine {
276    CARD8	reqType;		/* always XF86OldVidModeReqCode */
277    CARD8	xf86vidmodeReqType;	/* always X_XF86OldVidModeModModeLine */
278    CARD16	length B16;
279    CARD32	screen B32;		/* could be CARD16 but need the pad */
280    CARD16	hdisplay B16;
281    CARD16	hsyncstart B16;
282    CARD16	hsyncend B16;
283    CARD16	htotal B16;
284    CARD16	vdisplay B16;
285    CARD16	vsyncstart B16;
286    CARD16	vsyncend B16;
287    CARD16	vtotal B16;
288    CARD32	flags B32;
289    CARD32	privsize B32;
290} xXF86OldVidModeModModeLineReq;
291#define sz_xXF86OldVidModeModModeLineReq	32
292
293typedef struct _XF86VidModeValidateModeLine {
294    CARD8	reqType;		/* always XF86VidModeReqCode */
295    CARD8	xf86vidmodeReqType;
296    CARD16	length B16;
297    CARD32	screen B32;		/* could be CARD16 but need the pad */
298    CARD32	dotclock B32;
299    CARD16	hdisplay B16;
300    CARD16	hsyncstart B16;
301    CARD16	hsyncend B16;
302    CARD16	htotal B16;
303    CARD16	hskew B16;
304    CARD16	vdisplay B16;
305    CARD16	vsyncstart B16;
306    CARD16	vsyncend B16;
307    CARD16	vtotal B16;
308    CARD16	pad1 B16;
309    CARD32	flags B32;
310    CARD32	reserved1 B32;
311    CARD32	reserved2 B32;
312    CARD32	reserved3 B32;
313    CARD32	privsize B32;
314} xXF86VidModeDeleteModeLineReq,
315  xXF86VidModeValidateModeLineReq,
316  xXF86VidModeSwitchToModeReq;
317#define sz_xXF86VidModeDeleteModeLineReq	52
318#define sz_xXF86VidModeValidateModeLineReq	52
319#define sz_xXF86VidModeSwitchToModeReq		52
320
321/* 0.x version */
322typedef struct _XF86OldVidModeValidateModeLine {
323    CARD8	reqType;		/* always XF86OldVidModeReqCode */
324    CARD8	xf86vidmodeReqType;
325    CARD16	length B16;
326    CARD32	screen B32;		/* could be CARD16 but need the pad */
327    CARD32	dotclock B32;
328    CARD16	hdisplay B16;
329    CARD16	hsyncstart B16;
330    CARD16	hsyncend B16;
331    CARD16	htotal B16;
332    CARD16	vdisplay B16;
333    CARD16	vsyncstart B16;
334    CARD16	vsyncend B16;
335    CARD16	vtotal B16;
336    CARD32	flags B32;
337    CARD32	privsize B32;
338} xXF86OldVidModeDeleteModeLineReq,
339  xXF86OldVidModeValidateModeLineReq,
340  xXF86OldVidModeSwitchToModeReq;
341#define sz_xXF86OldVidModeDeleteModeLineReq	36
342#define sz_xXF86OldVidModeValidateModeLineReq	36
343#define sz_xXF86OldVidModeSwitchToModeReq	36
344
345typedef struct _XF86VidModeSwitchMode {
346    CARD8	reqType;		/* always XF86VidModeReqCode */
347    CARD8	xf86vidmodeReqType;	/* always X_XF86VidModeSwitchMode */
348    CARD16	length B16;
349    CARD16	screen B16;
350    CARD16	zoom B16;
351} xXF86VidModeSwitchModeReq;
352#define sz_xXF86VidModeSwitchModeReq	8
353
354typedef struct _XF86VidModeLockModeSwitch {
355    CARD8	reqType;		/* always XF86VidModeReqCode */
356    CARD8	xf86vidmodeReqType;	/* always X_XF86VidModeLockModeSwitch */
357    CARD16	length B16;
358    CARD16	screen B16;
359    CARD16	lock B16;
360} xXF86VidModeLockModeSwitchReq;
361#define sz_xXF86VidModeLockModeSwitchReq	8
362
363typedef struct {
364    BYTE	type;			/* X_Reply */
365    BOOL	pad1;
366    CARD16	sequenceNumber B16;
367    CARD32	length B32;
368    CARD32	status B32;
369    CARD32	pad2 B32;
370    CARD32	pad3 B32;
371    CARD32	pad4 B32;
372    CARD32	pad5 B32;
373    CARD32	pad6 B32;
374} xXF86VidModeValidateModeLineReply;
375#define sz_xXF86VidModeValidateModeLineReply	32
376
377typedef struct {
378    BYTE	type;			/* X_Reply */
379    BOOL	pad1;
380    CARD16	sequenceNumber B16;
381    CARD32	length B32;
382    CARD8	vendorLength;
383    CARD8	modelLength;
384    CARD8	nhsync;
385    CARD8	nvsync;
386    CARD32	pad2 B32;
387    CARD32	pad3 B32;
388    CARD32	pad4 B32;
389    CARD32	pad5 B32;
390    CARD32	pad6 B32;
391} xXF86VidModeGetMonitorReply;
392#define sz_xXF86VidModeGetMonitorReply	32
393
394typedef struct {
395    BYTE	type;
396    BOOL	pad1;
397    CARD16	sequenceNumber B16;
398    CARD32	length B32;
399    CARD32	x B32;
400    CARD32	y B32;
401    CARD32	pad2 B32;
402    CARD32	pad3 B32;
403    CARD32	pad4 B32;
404    CARD32	pad5 B32;
405} xXF86VidModeGetViewPortReply;
406#define sz_xXF86VidModeGetViewPortReply	32
407
408typedef struct _XF86VidModeSetViewPort {
409    CARD8	reqType;		/* always VidModeReqCode */
410    CARD8	xf86vidmodeReqType;	/* always X_XF86VidModeSetViewPort */
411    CARD16	length B16;
412    CARD16	screen B16;
413    CARD16	pad B16;
414    CARD32      x B32;
415    CARD32	y B32;
416} xXF86VidModeSetViewPortReq;
417#define sz_xXF86VidModeSetViewPortReq	16
418
419typedef struct {
420    BYTE	type;
421    BOOL	pad1;
422    CARD16	sequenceNumber B16;
423    CARD32	length B32;
424    CARD32	flags B32;
425    CARD32	clocks B32;
426    CARD32	maxclocks B32;
427    CARD32	pad2 B32;
428    CARD32	pad3 B32;
429    CARD32	pad4 B32;
430} xXF86VidModeGetDotClocksReply;
431#define sz_xXF86VidModeGetDotClocksReply	32
432
433typedef struct _XF86VidModeSetClientVersion {
434    CARD8	reqType;		/* always XF86VidModeReqCode */
435    CARD8	xf86vidmodeReqType;
436    CARD16	length B16;
437    CARD16	major B16;
438    CARD16	minor B16;
439} xXF86VidModeSetClientVersionReq;
440#define sz_xXF86VidModeSetClientVersionReq	8
441
442typedef struct _XF86VidModeGetGamma {
443    CARD8	reqType;		/* always XF86VidModeReqCode */
444    CARD8	xf86vidmodeReqType;
445    CARD16	length B16;
446    CARD16	screen B16;
447    CARD16	pad B16;
448    CARD32	pad1 B32;
449    CARD32	pad2 B32;
450    CARD32	pad3 B32;
451    CARD32	pad4 B32;
452    CARD32	pad5 B32;
453    CARD32	pad6 B32;
454} xXF86VidModeGetGammaReq;
455#define sz_xXF86VidModeGetGammaReq		32
456
457typedef struct {
458    BYTE	type;
459    BOOL	pad;
460    CARD16	sequenceNumber B16;
461    CARD32	length B32;
462    CARD32	red B32;
463    CARD32	green B32;
464    CARD32	blue B32;
465    CARD32	pad1 B32;
466    CARD32	pad2 B32;
467    CARD32	pad3 B32;
468} xXF86VidModeGetGammaReply;
469#define sz_xXF86VidModeGetGammaReply		32
470
471typedef struct _XF86VidModeSetGamma {
472    CARD8	reqType;		/* always XF86VidModeReqCode */
473    CARD8	xf86vidmodeReqType;
474    CARD16	length B16;
475    CARD16	screen B16;
476    CARD16	pad B16;
477    CARD32	red B32;
478    CARD32	green B32;
479    CARD32	blue B32;
480    CARD32	pad1 B32;
481    CARD32	pad2 B32;
482    CARD32	pad3 B32;
483} xXF86VidModeSetGammaReq;
484#define sz_xXF86VidModeSetGammaReq		32
485
486
487typedef struct _XF86VidModeSetGammaRamp {
488    CARD8       reqType;                /* always XF86VidModeReqCode */
489    CARD8       xf86vidmodeReqType;
490    CARD16      length B16;
491    CARD16      screen B16;
492    CARD16      size B16;
493} xXF86VidModeSetGammaRampReq;
494#define sz_xXF86VidModeSetGammaRampReq             8
495
496typedef struct _XF86VidModeGetGammaRamp {
497    CARD8       reqType;                /* always XF86VidModeReqCode */
498    CARD8       xf86vidmodeReqType;
499    CARD16      length B16;
500    CARD16      screen B16;
501    CARD16      size B16;
502} xXF86VidModeGetGammaRampReq;
503#define sz_xXF86VidModeGetGammaRampReq             8
504
505typedef struct {
506    BYTE        type;
507    BOOL        pad;
508    CARD16      sequenceNumber B16;
509    CARD32      length B32;
510    CARD16      size B16;
511    CARD16      pad0 B16;
512    CARD32      pad1 B32;
513    CARD32      pad2 B32;
514    CARD32      pad3 B32;
515    CARD32      pad4 B32;
516    CARD32      pad5 B32;
517} xXF86VidModeGetGammaRampReply;
518#define sz_xXF86VidModeGetGammaRampReply            32
519
520typedef struct _XF86VidModeGetGammaRampSize {
521    CARD8       reqType;                /* always XF86VidModeReqCode */
522    CARD8       xf86vidmodeReqType;
523    CARD16      length B16;
524    CARD16      screen B16;
525    CARD16      pad B16;
526} xXF86VidModeGetGammaRampSizeReq;
527#define sz_xXF86VidModeGetGammaRampSizeReq             8
528
529typedef struct {
530    BYTE        type;
531    BOOL        pad;
532    CARD16      sequenceNumber B16;
533    CARD32      length B32;
534    CARD16      size B16;
535    CARD16      pad0 B16;
536    CARD32      pad1 B32;
537    CARD32      pad2 B32;
538    CARD32      pad3 B32;
539    CARD32      pad4 B32;
540    CARD32      pad5 B32;
541} xXF86VidModeGetGammaRampSizeReply;
542#define sz_xXF86VidModeGetGammaRampSizeReply            32
543
544
545#endif /* _XF86VIDMODESTR_H_ */
546
547