2
.\" $TOG: XF86VM.man /main/6 1997/07/19 10:30:39 kaleb $
7
.\" Copyright (c) 1996 Joe Moss, The XFree86 Project
8
.\" $XFree86: xc/programs/Xserver/hw/xfree86/doc/man/XF86VM.man,v 3.14 2003/10/02 13:29:56 eich Exp $
11
.ie t \fB\^\\$1\^\fR\\$2
12
.el \fI\^\\$1\^\fP\\$2
14
.TH XF86VIDMODE __libmansuffix__ __vendorversion__
16
XF86VidModeQueryExtension, XF86VidModeQueryVersion, XF86VidModeSetClientVersion, XF86VidModeGetModeLine, XF86VidModeGetAllModeLines, XF86VidModeDeleteModeLine, XF86VidModeModModeLine, XF86VidModeValidateModeLine, XF86VidModeSwitchMode, XF86VidModeSwitchToMode, XF86VidModeLockModeSwitch, XF86VidModeGetMonitor, XF86VidModeGetViewPort, XF86VidModeSetViewPort, XF86VidModeGetDotClocks, XF86VidModeGetGamma, XF86VidModeSetGamma, XF86VidModeGetGammaRamp, XF86VidModeSetGammaRamp, XF86VidModeGetGammaRampSize, XF86VidModeGetPermissions \- Extension libary for the XFree86-VidMode X extension
20
\&#include <X11/extensions/xf86vmode.h>
22
Bool XF86VidModeQueryExtension(
23
Display *\fIdisplay\fP\^,
24
int *\fIevent_base_return\fP\^,
25
int *\fIerror_base_return\fP\^);
27
Bool XF86VidModeQueryVersion(
28
Display *\fIdisplay\fP\^,
29
int *\fImajor_version_return\fP\^,
30
int *\fIminor_version_return\fP\^);
32
Bool XF86VidModeSetClientVersion(
33
Display *\fIdisplay\fP\^);
35
Bool XF86VidModeGetModeLine(
36
Display *\fIdisplay\fP\^,
38
int *\fIdotclock_return\fP\^,
39
XF86VidModeModeLine *\fImodeline\fP\^);
41
Bool XF86VidModeGetAllModeLines(
42
Display *\fIdisplay\fP\^,
44
int *\fImodecount_return\fP\^,
45
XF86VidModeModeInfo ***\fImodesinfo\fP\^);
48
Bool XF86VidModeAddModeLine(
49
Display *\fIdisplay\fP\^,
51
XF86VidModeModeInfo *\fImodeline\fP\,
52
XF86VidModeModeInfo *\fIaftermode\fP\^);
55
Bool XF86VidModeDeleteModeLine(
56
Display *\fIdisplay\fP\^,
58
XF86VidModeModeInfo *\fImodeline\fP\^);
60
Bool XF86VidModeModModeLine(
61
Display *\fIdisplay\fP\^,
63
XF86VidModeModeLine *\fImodeline\fP\^);
65
Status XF86VidModeValidateModeLine(
66
Display *\fIdisplay\fP\^,
68
XF86VidModeModeLine *\fImodeline\fP\^);
70
Bool XF86VidModeSwitchMode(
71
Display *\fIdisplay\fP\^,
75
Bool XF86VidModeSwitchToMode(
76
Display *\fIdisplay\fP\^,
78
XF86VidModeModeInfo *\fImodeline\fP\^);
80
Bool XF86VidModeLockModeSwitch(
81
Display *\fIdisplay\fP\^,
85
Bool XF86VidModeGetMonitor(
86
Display *\fIdisplay\fP\^,
88
XF86VidModeMonitor *\fImonitor\fP\^);
90
Bool XF86VidModeGetViewPort(
91
Display *\fIdisplay\fP\^,
93
int *\fIx_return\fP\^,
94
int *\fIy_return\fP\^);
96
Bool XF86VidModeSetViewPort(
97
Display *\fIdisplay\fP\^,
102
XF86VidModeGetDotClocks(
103
Display *\fIdisplay\fP\^,
105
int *\fIflags return\fP\^,
106
int *\fInumber of clocks return\fP\^,
107
int *\fImax dot clock return\fP\^,
108
int **\fIclocks return\fP\^);
111
Display *\fIdisplay\fP\^,
113
XF86VidModeGamma *\fIGamma\fP\^);
116
Display *\fIdisplay\fP\^,
118
XF86VidModeGamma *\fIGamma\fP\^);
120
XF86VidModeGetGammaRamp(
121
Display *\fIdisplay\fP\^,
124
unsigned short *\fIred array\fP\^,
125
unsigned short *\fIgreen array\fP\^,
126
unsigned short *\fIblue array\fP\^);
128
XF86VidModeSetGammaRamp(
129
Display *\fIdisplay\fP\^,
132
unsigned short *\fIred array\fP\^,
133
unsigned short *\fIgreen array\fP\^,
134
unsigned short *\fIblue array\fP\^);
136
XF86VidModeGetGammaRampSize(
137
Display *\fIdisplay\fP\^,
143
Specifies the connection to the X server.
145
Specifies which screen number the setting apply to.
146
.IP \fIevent_base_return\fP 2i
147
Returns the base event number for the extension.
148
.IP \fIerror_base_return\fP 2i
149
Returns the base error number for the extension.
150
.IP \fImajor_version_return\fP 2i
151
Returns the major version number of the extension.
152
.IP \fIminor_version_return\fP 2i
153
Returns the minor version number of the extension.
154
.IP \fIdotclock_return\fP 2i
155
Returns the clock for the mode line.
156
.IP \fImodecount_return\fP 2i
157
Returns the number of video modes available in the server.
159
If greater than zero, indicates that the server should switch to
160
the next mode, otherwise switch to the previous mode.
162
Indicates that mode switching should be locked, if non-zero.
163
.IP \fImodeline\fP 2i
164
Specifies or returns the timing values for a video mode.
166
.IP \fIaftermode\fP 2i
167
Specifies the timing values for the video mode after which the
170
.IP \fImodesinfo\fP 2i
171
Returns the timing values and dotclocks for all of the available
174
Returns information about the monitor.
176
Specifies the desired X location for the viewport.
177
.IP \fIx_return\fP 2i
178
Returns the current X location of the viewport.
180
Specifies the desired Y location for the viewport.
181
.IP \fIy_return\fP 2i
182
Returns the current Y location of the viewport.
186
\fIVideo Mode Settings:\fP
188
unsigned short hdisplay; /\(** Number of display pixels horizontally */
189
unsigned short hsyncstart; /\(** Horizontal sync start */
190
unsigned short hsyncend; /\(** Horizontal sync end */
191
unsigned short htotal; /\(** Total horizontal pixels */
192
unsigned short vdisplay; /\(** Number of display pixels vertically */
193
unsigned short vsyncstart; /\(** Vertical sync start */
194
unsigned short vsyncend; /\(** Vertical sync start */
195
unsigned short vtotal; /\(** Total vertical pixels */
196
unsigned int flags; /\(** Mode flags */
197
int privsize; /\(** Size of private */
198
INT32 *private; /\(** Server privates */
199
} XF86VidModeModeLine;
202
unsigned int dotclock; /\(** Pixel clock */
203
unsigned short hdisplay; /\(** Number of display pixels horizontally */
204
unsigned short hsyncstart; /\(** Horizontal sync start */
205
unsigned short hsyncend; /\(** Horizontal sync end */
206
unsigned short htotal; /\(** Total horizontal pixels */
207
unsigned short vdisplay; /\(** Number of display pixels vertically */
208
unsigned short vsyncstart; /\(** Vertical sync start */
209
unsigned short vsyncend; /\(** Vertical sync start */
210
unsigned short vtotal; /\(** Total vertical pixels */
211
unsigned int flags; /\(** Mode flags */
212
int privsize; /\(** Size of private */
213
INT32 *private; /\(** Server privates */
214
} XF86VidModeModeInfo;
216
\fIMonitor information:\fP
218
char* vendor; /\(** Name of manufacturer */
219
char* model; /\(** Model name */
220
float EMPTY; /\(** unused, for backward compatibility */
221
unsigned char nhsync; /\(** Number of horiz sync ranges */
222
XF86VidModeSyncRange* hsync; /\(** Horizontal sync ranges */
223
unsigned char nvsync; /\(** Number of vert sync ranges */
224
XF86VidModeSyncRange* vsync; /\(** Vertical sync ranges */
225
} XF86VidModeMonitor;
228
float hi; /\(** Top of range */
229
float lo; /\(** Bottom of range */
230
} XF86VidModeSyncRange;
233
int type; /\(** of event */
234
unsigned long serial; /\(** # of last request processed by server */
235
Bool send_event; /\(** true if this came from a SendEvent req */
236
Display *display; /\(** Display the event was read from */
237
Window root; /\(** root window of event screen */
238
int state; /\(** What happened */
239
int kind; /\(** What happened */
240
Bool forced; /\(** extents of new region */
241
Time time; /\(** event timestamp */
242
} XF86VidModeNotifyEvent;
245
float red; /\(** Red Gamma value */
246
float green; /\(** Green Gamma value */
247
float blue; /\(** Blue Gamma value */
251
These functions provide an interface to the server extension
252
\fIXFree86-VidModeExtension\fP
253
which allows the video modes to be
254
queried and adjusted dynamically and mode switching to be controlled.
255
Applications that use these functions must be linked with
257
.SS "MODELINE FUNCTIONS"
259
.ZN XF86VidModeGetModeLine
260
function is used to query the settings for the currently selected
261
video mode. The calling program should pass a pointer to a
262
.ZN XF86VidModeModeLine
263
structure that it has already allocated. The function fills in
264
the fields of the structure.
266
If there are any server private values (currently only applicable to
267
the S3 server) the function will allocate storage for them.
270
field is non-zero, the calling program should call
274
.ZN XF86VidModeGetAllModeLines
275
returns the settings for all video modes.
276
The calling program supplies the address of a pointer which will be
277
set by the function to point to an array of
278
.ZN XF86VidModeModeInfo
279
structures. The memory occupied by the array is dynamically allocated
281
.ZN XF86VidModeGetAllModeLines
282
function and should be freed by the caller.
283
The first element of the array corresponds to the current video mode.
286
.ZN XF86VidModeModModeLine
287
function can be used to change the settings of the current video mode
288
provided the requested settings are valid (e.g. they don't exceed the
289
capabilities of the monitor).
292
To add a mode to the list of available modes, the
293
.ZN XF86VidModeAddModeLine
294
function can be used.
295
Assuming the settings are valid, the video mode will be added after
296
the existing mode which matches the timings specified by the
299
To be considered a match, all of the fields of the given
300
.ZN XF86VidModeModeInfo
301
structure must match, except the
308
parameter is zero, the mode will be added
309
after the current mode.
312
Modes can be deleted with the
313
.ZN XF86VidModeDeleteModeLine
314
function. The specified mode must match an existing mode.
315
To be considered a match, all of the fields of the given
316
.ZN XF86VidModeModeInfo
317
structure must match, except the
322
If the mode to be deleted is the current mode, a mode switch
323
to the next mode will occur first. The last remaining mode can not
326
The validity of a mode can be checked with the
327
.ZN XF86VidModeValidateModeLine
329
If the specified mode can be used by the server (i.e. meets all the
330
constraints placed upon a mode by the combination of the server, card,
331
and monitor) the function returns
333
otherwise it returns a value indicating the reason why the mode is
334
invalid (as defined in \fIxf86.h\fP)
335
.SS "MODE SWITCH FUNCTIONS"
337
.ZN XF86VidModeSwitchMode
338
is called, the server will change the video mode to next (or previous)
340
.ZN XF86VidModeSwitchToMode
341
function can be used to switch directly to the specified mode.
342
Matching is as specified in the description of the
343
.ZN XF86VidModeAddModeLine
346
.ZN XF86VidModeLockModeSwitch
347
function can be used to allow or disallow mode switching whether
348
the request to switch modes comes from a call to the
349
.ZN XF86VidModeSwitchMode
351
.ZN XF86VidModeSwitchToMode
352
functions or from one of the mode switch key sequences.
355
Because of the asynchronous nature of the X protocol, a call to
357
is needed if the application wants to see the mode change immediately.
358
To be informed of the execution status of the request, a
359
custom error handler should be installed using
361
before calling the mode switching function.
362
.SS "MONITOR FUNCTIONS"
363
Information known to the server about the monitor is returned by the
364
.ZN XF86VidModeGetMonitor
369
fields each point to an array of
370
.ZN XF86VidModeSyncRange
371
structures. The arrays contain
375
elements, respectively.
380
values will be equal if a discreate value was given in the
390
fields point to dynamically allocated storage that should be freed
392
.SS "VIEWPORT FUNCTIONS"
394
.ZN XF86VidModeGetViewPort
396
.ZN XF86VidModeSetViewPort
397
functions can be used to, respectively, query and change the location
398
of the upper left corner of the viewport into the virtual screen.
399
.SS "OTHER FUNCTIONS"
401
.ZN XF86VidModeQueryVersion
402
function can be used to determine the version of the extension
403
built into the server.
406
.ZN XF86VidModeQueryExtension
407
returns the lowest numbered error and event values
408
assigned to the extension.
411
XF86VidModeSetClientVersion,
412
XF86VidModeGetDotClocks,
415
XF86VidModeSetGammaRamp,
416
XF86VidModeGetGammaRamp,
417
XF86VidModeGetGammaRampSize,
419
XF86VidModeGetPermissions
420
functions need to be documented. In the meantime, check the source
421
code for information about how to use them.
423
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), XFlush(__libmansuffix__), XSetErrorHandler(__libmansuffix__), xvidtune(__appmansuffix__)
425
Kaleb Keithley, Jon Tombs, David Dawes, and Joe Moss