1XF86VIDMODE(3) Library Functions Manual XF86VIDMODE(3)
2
3
4
6 XF86VidModeQueryExtension, XF86VidModeQueryVersion, XF86VidModeSet‐
7 ClientVersion, XF86VidModeGetModeLine, XF86VidModeGetAllModeLines,
8 XF86VidModeDeleteModeLine, XF86VidModeModModeLine, XF86VidModeValidate‐
9 ModeLine, XF86VidModeSwitchMode, XF86VidModeSwitchToMode, XF86VidMode‐
10 LockModeSwitch, XF86VidModeGetMonitor, XF86VidModeGetViewPort, XF86Vid‐
11 ModeSetViewPort, XF86VidModeGetDotClocks, XF86VidModeGetGamma, XF86Vid‐
12 ModeSetGamma, XF86VidModeGetGammaRamp, XF86VidModeSetGammaRamp,
13 XF86VidModeGetGammaRampSize, XF86VidModeGetPermissions - Extension
14 library for the XFree86-VidMode X extension
15
17 #include <X11/extensions/xf86vmode.h>
18
19 Bool XF86VidModeQueryExtension(
20 Display *display,
21 int *event_base_return,
22 int *error_base_return);
23
24 Bool XF86VidModeQueryVersion(
25 Display *display,
26 int *major_version_return,
27 int *minor_version_return);
28
29 Bool XF86VidModeSetClientVersion(
30 Display *display);
31
32 Bool XF86VidModeGetModeLine(
33 Display *display,
34 int screen,
35 int *dotclock_return,
36 XF86VidModeModeLine *modeline);
37
38 Bool XF86VidModeGetAllModeLines(
39 Display *display,
40 int screen,
41 int *modecount_return,
42 XF86VidModeModeInfo ***modesinfo);
43
44 Bool XF86VidModeDeleteModeLine(
45 Display *display,
46 int screen,
47 XF86VidModeModeInfo *modeline);
48
49 Bool XF86VidModeModModeLine(
50 Display *display,
51 int screen,
52 XF86VidModeModeLine *modeline);
53
54 Status XF86VidModeValidateModeLine(
55 Display *display,
56 int screen,
57 XF86VidModeModeLine *modeline);
58
59 Bool XF86VidModeSwitchMode(
60 Display *display,
61 int screen,
62 int zoom);
63
64 Bool XF86VidModeSwitchToMode(
65 Display *display,
66 int screen,
67 XF86VidModeModeInfo *modeline);
68
69 Bool XF86VidModeLockModeSwitch(
70 Display *display,
71 int screen,
72 int lock);
73
74 Bool XF86VidModeGetMonitor(
75 Display *display,
76 int screen,
77 XF86VidModeMonitor *monitor);
78
79 Bool XF86VidModeGetViewPort(
80 Display *display,
81 int screen,
82 int *x_return,
83 int *y_return);
84
85 Bool XF86VidModeSetViewPort(
86 Display *display,
87 int screen,
88 int x,
89 int y);
90
91 XF86VidModeGetDotClocks(
92 Display *display,
93 int screen,
94 int *flags return,
95 int *number of clocks return,
96 int *max dot clock return,
97 int **clocks return);
98
99 XF86VidModeGetGamma(
100 Display *display,
101 int screen,
102 XF86VidModeGamma *Gamma);
103
104 XF86VidModeSetGamma(
105 Display *display,
106 int screen,
107 XF86VidModeGamma *Gamma);
108
109 XF86VidModeGetGammaRamp(
110 Display *display,
111 int screen,
112 int size,
113 unsigned short *red array,
114 unsigned short *green array,
115 unsigned short *blue array);
116
117 XF86VidModeSetGammaRamp(
118 Display *display,
119 int screen,
120 int size,
121 unsigned short *red array,
122 unsigned short *green array,
123 unsigned short *blue array);
124
125 XF86VidModeGetGammaRampSize(
126 Display *display,
127 int screen,
128 int *size);
129
131 display Specifies the connection to the X server.
132
133 screen Specifies which screen number the setting apply to.
134
135 event_base_return Returns the base event number for the extension.
136
137 error_base_return Returns the base error number for the extension.
138
139 major_version_return
140 Returns the major version number of the extension.
141
142 minor_version_return
143 Returns the minor version number of the extension.
144
145 dotclock_return Returns the clock for the mode line.
146
147 modecount_return Returns the number of video modes available in the
148 server.
149
150 zoom If greater than zero, indicates that the server
151 should switch to the next mode, otherwise switch to
152 the previous mode.
153
154 lock Indicates that mode switching should be locked, if
155 non-zero.
156
157 modeline Specifies or returns the timing values for a video
158 mode.
159
160 modesinfo Returns the timing values and dotclocks for all of
161 the available video modes.
162
163 monitor Returns information about the monitor.
164
165 x Specifies the desired X location for the viewport.
166
167 x_return Returns the current X location of the viewport.
168
169 y Specifies the desired Y location for the viewport.
170
171 y_return Returns the current Y location of the viewport.
172
174 Video Mode Settings:
175 typedef struct {
176 unsigned short hdisplay; /∗ Number of display pixels horizontally */
177 unsigned short hsyncstart; /∗ Horizontal sync start */
178 unsigned short hsyncend; /∗ Horizontal sync end */
179 unsigned short htotal; /∗ Total horizontal pixels */
180 unsigned short vdisplay; /∗ Number of display pixels vertically */
181 unsigned short vsyncstart; /∗ Vertical sync start */
182 unsigned short vsyncend; /∗ Vertical sync start */
183 unsigned short vtotal; /∗ Total vertical pixels */
184 unsigned int flags; /∗ Mode flags */
185 int privsize; /∗ Size of private */
186 INT32 *private; /∗ Server privates */
187 } XF86VidModeModeLine;
188
189 typedef struct {
190 unsigned int dotclock; /∗ Pixel clock */
191 unsigned short hdisplay; /∗ Number of display pixels horizontally */
192 unsigned short hsyncstart; /∗ Horizontal sync start */
193 unsigned short hsyncend; /∗ Horizontal sync end */
194 unsigned short htotal; /∗ Total horizontal pixels */
195 unsigned short vdisplay; /∗ Number of display pixels vertically */
196 unsigned short vsyncstart; /∗ Vertical sync start */
197 unsigned short vsyncend; /∗ Vertical sync start */
198 unsigned short vtotal; /∗ Total vertical pixels */
199 unsigned int flags; /∗ Mode flags */
200 int privsize; /∗ Size of private */
201 INT32 *private; /∗ Server privates */
202 } XF86VidModeModeInfo;
203
204 Monitor information:
205 typedef struct {
206 char* vendor; /∗ Name of manufacturer */
207 char* model; /∗ Model name */
208 float EMPTY; /∗ unused, for backward compatibility */
209 unsigned char nhsync; /∗ Number of horiz sync ranges */
210 XF86VidModeSyncRange* hsync;/∗ Horizontal sync ranges */
211 unsigned char nvsync; /∗ Number of vert sync ranges */
212 XF86VidModeSyncRange* vsync;/∗ Vertical sync ranges */
213 } XF86VidModeMonitor;
214
215 typedef struct {
216 float hi; /∗ Top of range */
217 float lo; /∗ Bottom of range */
218 } XF86VidModeSyncRange;
219
220 typedef struct {
221 int type; /∗ of event */
222 unsigned long serial; /∗ # of last request processed by server */
223 Bool send_event; /∗ true if this came from a SendEvent req */
224 Display *display; /∗ Display the event was read from */
225 Window root; /∗ root window of event screen */
226 int state; /∗ What happened */
227 int kind; /∗ What happened */
228 Bool forced; /∗ extents of new region */
229 Time time; /∗ event timestamp */
230 } XF86VidModeNotifyEvent;
231
232 typedef struct {
233 float red; /∗ Red Gamma value */
234 float green; /∗ Green Gamma value */
235 float blue; /∗ Blue Gamma value */
236 } XF86VidModeGamma;
237
239 These functions provide an interface to the server extension
240 XFree86-VidModeExtension which allows the video modes to be queried and
241 adjusted dynamically and mode switching to be controlled. Applications
242 that use these functions must be linked with -lXxf86vm
243
244 MODELINE FUNCTIONS
245 The XF86VidModeGetModeLine function is used to query the settings for
246 the currently selected video mode. The calling program should pass a
247 pointer to a XF86VidModeModeLine structure that it has already allo‐
248 cated. The function fills in the fields of the structure.
249
250 If there are any server private values (currently only applicable to
251 the S3 server) the function will allocate storage for them. Therefore,
252 if the privsize field is non-zero, the calling program should call
253 Xfree(private) to free the storage.
254
255 XF86VidModeGetAllModeLines returns the settings for all video modes.
256 The calling program supplies the address of a pointer which will be set
257 by the function to point to an array of XF86VidModeModeInfo structures.
258 The memory occupied by the array is dynamically allocated by the
259 XF86VidModeGetAllModeLines function and should be freed by the caller.
260 The first element of the array corresponds to the current video mode.
261
262 The XF86VidModeModModeLine function can be used to change the settings
263 of the current video mode provided the requested settings are valid
264 (e.g. they don't exceed the capabilities of the monitor).
265
266 Modes can be deleted with the XF86VidModeDeleteModeLine function. The
267 specified mode must match an existing mode. To be considered a match,
268 all of the fields of the given XF86VidModeModeInfo structure must
269 match, except the privsize and private fields. If the mode to be
270 deleted is the current mode, a mode switch to the next mode will occur
271 first. The last remaining mode can not be deleted.
272
273 The validity of a mode can be checked with the XF86VidModeValidateMode‐
274 Line function. If the specified mode can be used by the server (i.e.
275 meets all the constraints placed upon a mode by the combination of the
276 server, card, and monitor) the function returns MODE_OK, otherwise it
277 returns a value indicating the reason why the mode is invalid (as
278 defined in xf86.h)
279
280 MODE SWITCH FUNCTIONS
281 When the function XF86VidModeSwitchMode is called, the server will
282 change the video mode to next (or previous) video mode. The XF86VidMod‐
283 eSwitchToMode function can be used to switch directly to the specified
284 mode. Matching is as specified in the description of the XF86VidMod‐
285 eAddModeLine function above. The XF86VidModeLockModeSwitch function
286 can be used to allow or disallow mode switching whether the request to
287 switch modes comes from a call to the XF86VidModeSwitchMode or XF86Vid‐
288 ModeSwitchToMode functions or from one of the mode switch key
289 sequences.
290
291 Note: Because of the asynchronous nature of the X protocol, a call to
292 XFlush is needed if the application wants to see the mode change imme‐
293 diately. To be informed of the execution status of the request, a cus‐
294 tom error handler should be installed using XSetErrorHandler before
295 calling the mode switching function.
296
297 MONITOR FUNCTIONS
298 Information known to the server about the monitor is returned by the
299 XF86VidModeGetMonitor function. The hsync and vsync fields each point
300 to an array of XF86VidModeSyncRange structures. The arrays contain
301 nhsync and nvsync elements, respectively. The hi and low values will
302 be equal if a discreate value was given in the XF86Config file.
303
304 The vendor, model, hsync, and vsync fields point to dynamically allo‐
305 cated storage that should be freed by the caller.
306
307 VIEWPORT FUNCTIONS
308 The XF86VidModeGetViewPort and XF86VidModeSetViewPort functions can be
309 used to, respectively, query and change the location of the upper left
310 corner of the viewport into the virtual screen.
311
312 OTHER FUNCTIONS
313 The XF86VidModeQueryVersion function can be used to determine the ver‐
314 sion of the extension built into the server.
315
316 The function XF86VidModeQueryExtension returns the lowest numbered
317 error and event values assigned to the extension.
318
320 The XF86VidModeSetClientVersion, XF86VidModeGetDotClocks, XF86VidMod‐
321 eGetGamma, XF86VidModeSetGamma, XF86VidModeSetGammaRamp, XF86VidMod‐
322 eGetGammaRamp, XF86VidModeGetGammaRampSize, and XF86VidModeGetPermis‐
323 sions functions need to be documented. In the meantime, check the
324 source code for information about how to use them.
325
327 Xorg(1), xorg.conf(5), XFlush(3), XSetErrorHandler(3), xvidtune(1)
328
330 Kaleb Keithley, Jon Tombs, David Dawes, and Joe Moss
331
332
333
334X Version 11 libXxf86vm 1.1.3 XF86VIDMODE(3)