1 | /*
|
---|
2 | * Copyright © 2000 Compaq Computer Corporation
|
---|
3 | * Copyright © 2002 Hewlett-Packard Company
|
---|
4 | * Copyright © 2006 Intel Corporation
|
---|
5 | *
|
---|
6 | * Permission to use, copy, modify, distribute, and sell this software and its
|
---|
7 | * documentation for any purpose is hereby granted without fee, provided that
|
---|
8 | * the above copyright notice appear in all copies and that both that copyright
|
---|
9 | * notice and this permission notice appear in supporting documentation, and
|
---|
10 | * that the name of the copyright holders not be used in advertising or
|
---|
11 | * publicity pertaining to distribution of the software without specific,
|
---|
12 | * written prior permission. The copyright holders make no representations
|
---|
13 | * about the suitability of this software for any purpose. It is provided "as
|
---|
14 | * is" without express or implied warranty.
|
---|
15 | *
|
---|
16 | * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
---|
17 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
---|
18 | * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
---|
19 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
---|
20 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
---|
21 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
---|
22 | * OF THIS SOFTWARE.
|
---|
23 | *
|
---|
24 | * Author: Jim Gettys, Hewlett-Packard Company, Inc.
|
---|
25 | * Keith Packard, Intel Corporation
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifdef HAVE_DIX_CONFIG_H
|
---|
29 | #include <dix-config.h>
|
---|
30 | #endif
|
---|
31 |
|
---|
32 | #ifndef _RANDRSTR_H_
|
---|
33 | #define _RANDRSTR_H_
|
---|
34 |
|
---|
35 | #include <X11/X.h>
|
---|
36 | #include <X11/Xproto.h>
|
---|
37 | #include "misc.h"
|
---|
38 | #include "os.h"
|
---|
39 | #include "dixstruct.h"
|
---|
40 | #include "resource.h"
|
---|
41 | #include "scrnintstr.h"
|
---|
42 | #include "windowstr.h"
|
---|
43 | #include "pixmapstr.h"
|
---|
44 | #include "extnsionst.h"
|
---|
45 | #include "servermd.h"
|
---|
46 | #include <X11/extensions/randr.h>
|
---|
47 | #include <X11/extensions/randrproto.h>
|
---|
48 | #ifdef RENDER
|
---|
49 | #include <X11/extensions/render.h> /* we share subpixel order information */
|
---|
50 | #include "picturestr.h"
|
---|
51 | #endif
|
---|
52 | #include <X11/Xfuncproto.h>
|
---|
53 |
|
---|
54 | /* required for ABI compatibility for now */
|
---|
55 | #define RANDR_10_INTERFACE 1
|
---|
56 | #define RANDR_12_INTERFACE 1
|
---|
57 |
|
---|
58 | typedef XID RRMode;
|
---|
59 | typedef XID RROutput;
|
---|
60 | typedef XID RRCrtc;
|
---|
61 |
|
---|
62 | extern int RREventBase, RRErrorBase;
|
---|
63 |
|
---|
64 | extern int (*ProcRandrVector[RRNumberRequests])(ClientPtr);
|
---|
65 | extern int (*SProcRandrVector[RRNumberRequests])(ClientPtr);
|
---|
66 |
|
---|
67 | /*
|
---|
68 | * Modeline for a monitor. Name follows directly after this struct
|
---|
69 | */
|
---|
70 |
|
---|
71 | #define RRModeName(pMode) ((char *) (pMode + 1))
|
---|
72 | typedef struct _rrMode RRModeRec, *RRModePtr;
|
---|
73 | typedef struct _rrPropertyValue RRPropertyValueRec, *RRPropertyValuePtr;
|
---|
74 | typedef struct _rrProperty RRPropertyRec, *RRPropertyPtr;
|
---|
75 | typedef struct _rrCrtc RRCrtcRec, *RRCrtcPtr;
|
---|
76 | typedef struct _rrOutput RROutputRec, *RROutputPtr;
|
---|
77 |
|
---|
78 | struct _rrMode {
|
---|
79 | int refcnt;
|
---|
80 | xRRModeInfo mode;
|
---|
81 | char *name;
|
---|
82 | ScreenPtr userScreen;
|
---|
83 | };
|
---|
84 |
|
---|
85 | struct _rrPropertyValue {
|
---|
86 | Atom type; /* ignored by server */
|
---|
87 | short format; /* format of data for swapping - 8,16,32 */
|
---|
88 | long size; /* size of data in (format/8) bytes */
|
---|
89 | pointer data; /* private to client */
|
---|
90 | };
|
---|
91 |
|
---|
92 | struct _rrProperty {
|
---|
93 | RRPropertyPtr next;
|
---|
94 | ATOM propertyName;
|
---|
95 | Bool is_pending;
|
---|
96 | Bool range;
|
---|
97 | Bool immutable;
|
---|
98 | int num_valid;
|
---|
99 | INT32 *valid_values;
|
---|
100 | RRPropertyValueRec current, pending;
|
---|
101 | };
|
---|
102 |
|
---|
103 | struct _rrCrtc {
|
---|
104 | RRCrtc id;
|
---|
105 | ScreenPtr pScreen;
|
---|
106 | RRModePtr mode;
|
---|
107 | int x, y;
|
---|
108 | Rotation rotation;
|
---|
109 | Rotation rotations;
|
---|
110 | Bool changed;
|
---|
111 | int numOutputs;
|
---|
112 | RROutputPtr *outputs;
|
---|
113 | int gammaSize;
|
---|
114 | CARD16 *gammaRed;
|
---|
115 | CARD16 *gammaBlue;
|
---|
116 | CARD16 *gammaGreen;
|
---|
117 | void *devPrivate;
|
---|
118 | };
|
---|
119 |
|
---|
120 | struct _rrOutput {
|
---|
121 | RROutput id;
|
---|
122 | ScreenPtr pScreen;
|
---|
123 | char *name;
|
---|
124 | int nameLength;
|
---|
125 | CARD8 connection;
|
---|
126 | CARD8 subpixelOrder;
|
---|
127 | int mmWidth;
|
---|
128 | int mmHeight;
|
---|
129 | RRCrtcPtr crtc;
|
---|
130 | int numCrtcs;
|
---|
131 | RRCrtcPtr *crtcs;
|
---|
132 | int numClones;
|
---|
133 | RROutputPtr *clones;
|
---|
134 | int numModes;
|
---|
135 | int numPreferred;
|
---|
136 | RRModePtr *modes;
|
---|
137 | int numUserModes;
|
---|
138 | RRModePtr *userModes;
|
---|
139 | Bool changed;
|
---|
140 | RRPropertyPtr properties;
|
---|
141 | Bool pendingProperties;
|
---|
142 | void *devPrivate;
|
---|
143 | };
|
---|
144 |
|
---|
145 | #if RANDR_12_INTERFACE
|
---|
146 | typedef Bool (*RRScreenSetSizeProcPtr) (ScreenPtr pScreen,
|
---|
147 | CARD16 width,
|
---|
148 | CARD16 height,
|
---|
149 | CARD32 mmWidth,
|
---|
150 | CARD32 mmHeight);
|
---|
151 |
|
---|
152 | typedef Bool (*RRCrtcSetProcPtr) (ScreenPtr pScreen,
|
---|
153 | RRCrtcPtr crtc,
|
---|
154 | RRModePtr mode,
|
---|
155 | int x,
|
---|
156 | int y,
|
---|
157 | Rotation rotation,
|
---|
158 | int numOutputs,
|
---|
159 | RROutputPtr *outputs);
|
---|
160 |
|
---|
161 | typedef Bool (*RRCrtcSetGammaProcPtr) (ScreenPtr pScreen,
|
---|
162 | RRCrtcPtr crtc);
|
---|
163 |
|
---|
164 | typedef Bool (*RROutputSetPropertyProcPtr) (ScreenPtr pScreen,
|
---|
165 | RROutputPtr output,
|
---|
166 | Atom property,
|
---|
167 | RRPropertyValuePtr value);
|
---|
168 |
|
---|
169 | typedef Bool (*RROutputValidateModeProcPtr) (ScreenPtr pScreen,
|
---|
170 | RROutputPtr output,
|
---|
171 | RRModePtr mode);
|
---|
172 |
|
---|
173 | typedef void (*RRModeDestroyProcPtr) (ScreenPtr pScreen,
|
---|
174 | RRModePtr mode);
|
---|
175 |
|
---|
176 | #endif
|
---|
177 |
|
---|
178 | typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation *rotations);
|
---|
179 | typedef Bool (*RRCloseScreenProcPtr) ( int i, ScreenPtr pscreen);
|
---|
180 |
|
---|
181 | /* These are for 1.0 compatibility */
|
---|
182 |
|
---|
183 | typedef struct _rrRefresh {
|
---|
184 | CARD16 rate;
|
---|
185 | RRModePtr mode;
|
---|
186 | } RRScreenRate, *RRScreenRatePtr;
|
---|
187 |
|
---|
188 | typedef struct _rrScreenSize {
|
---|
189 | int id;
|
---|
190 | short width, height;
|
---|
191 | short mmWidth, mmHeight;
|
---|
192 | int nRates;
|
---|
193 | RRScreenRatePtr pRates;
|
---|
194 | } RRScreenSize, *RRScreenSizePtr;
|
---|
195 |
|
---|
196 | #ifdef RANDR_10_INTERFACE
|
---|
197 |
|
---|
198 | typedef Bool (*RRSetConfigProcPtr) (ScreenPtr pScreen,
|
---|
199 | Rotation rotation,
|
---|
200 | int rate,
|
---|
201 | RRScreenSizePtr pSize);
|
---|
202 |
|
---|
203 | #endif
|
---|
204 |
|
---|
205 |
|
---|
206 | typedef struct _rrScrPriv {
|
---|
207 | /*
|
---|
208 | * 'public' part of the structure; DDXen fill this in
|
---|
209 | * as they initialize
|
---|
210 | */
|
---|
211 | #if RANDR_10_INTERFACE
|
---|
212 | RRSetConfigProcPtr rrSetConfig;
|
---|
213 | #endif
|
---|
214 | RRGetInfoProcPtr rrGetInfo;
|
---|
215 | #if RANDR_12_INTERFACE
|
---|
216 | RRScreenSetSizeProcPtr rrScreenSetSize;
|
---|
217 | RRCrtcSetProcPtr rrCrtcSet;
|
---|
218 | RRCrtcSetGammaProcPtr rrCrtcSetGamma;
|
---|
219 | RROutputSetPropertyProcPtr rrOutputSetProperty;
|
---|
220 | RROutputValidateModeProcPtr rrOutputValidateMode;
|
---|
221 | RRModeDestroyProcPtr rrModeDestroy;
|
---|
222 | #endif
|
---|
223 |
|
---|
224 | /*
|
---|
225 | * Private part of the structure; not considered part of the ABI
|
---|
226 | */
|
---|
227 | TimeStamp lastSetTime; /* last changed by client */
|
---|
228 | TimeStamp lastConfigTime; /* possible configs changed */
|
---|
229 | RRCloseScreenProcPtr CloseScreen;
|
---|
230 |
|
---|
231 | Bool changed; /* some config changed */
|
---|
232 | Bool configChanged; /* configuration changed */
|
---|
233 | Bool layoutChanged; /* screen layout changed */
|
---|
234 |
|
---|
235 | CARD16 minWidth, minHeight;
|
---|
236 | CARD16 maxWidth, maxHeight;
|
---|
237 | CARD16 width, height; /* last known screen size */
|
---|
238 | CARD16 mmWidth, mmHeight; /* last known screen size */
|
---|
239 |
|
---|
240 | int numOutputs;
|
---|
241 | RROutputPtr *outputs;
|
---|
242 |
|
---|
243 | int numCrtcs;
|
---|
244 | RRCrtcPtr *crtcs;
|
---|
245 |
|
---|
246 | /* Last known pointer position */
|
---|
247 | RRCrtcPtr pointerCrtc;
|
---|
248 |
|
---|
249 | #ifdef RANDR_10_INTERFACE
|
---|
250 | /*
|
---|
251 | * Configuration information
|
---|
252 | */
|
---|
253 | Rotation rotations;
|
---|
254 | CARD16 reqWidth, reqHeight;
|
---|
255 |
|
---|
256 | int nSizes;
|
---|
257 | RRScreenSizePtr pSizes;
|
---|
258 |
|
---|
259 | Rotation rotation;
|
---|
260 | int rate;
|
---|
261 | int size;
|
---|
262 | #endif
|
---|
263 | } rrScrPrivRec, *rrScrPrivPtr;
|
---|
264 |
|
---|
265 | extern int rrPrivIndex;
|
---|
266 |
|
---|
267 | #define rrGetScrPriv(pScr) ((rrScrPrivPtr) (pScr)->devPrivates[rrPrivIndex].ptr)
|
---|
268 | #define rrScrPriv(pScr) rrScrPrivPtr pScrPriv = rrGetScrPriv(pScr)
|
---|
269 | #define SetRRScreen(s,p) ((s)->devPrivates[rrPrivIndex].ptr = (pointer) (p))
|
---|
270 |
|
---|
271 | /*
|
---|
272 | * each window has a list of clients requesting
|
---|
273 | * RRNotify events. Each client has a resource
|
---|
274 | * for each window it selects RRNotify input for,
|
---|
275 | * this resource is used to delete the RRNotifyRec
|
---|
276 | * entry from the per-window queue.
|
---|
277 | */
|
---|
278 |
|
---|
279 | typedef struct _RREvent *RREventPtr;
|
---|
280 |
|
---|
281 | typedef struct _RREvent {
|
---|
282 | RREventPtr next;
|
---|
283 | ClientPtr client;
|
---|
284 | WindowPtr window;
|
---|
285 | XID clientResource;
|
---|
286 | int mask;
|
---|
287 | } RREventRec;
|
---|
288 |
|
---|
289 | typedef struct _RRTimes {
|
---|
290 | TimeStamp setTime;
|
---|
291 | TimeStamp configTime;
|
---|
292 | } RRTimesRec, *RRTimesPtr;
|
---|
293 |
|
---|
294 | typedef struct _RRClient {
|
---|
295 | int major_version;
|
---|
296 | int minor_version;
|
---|
297 | /* RRTimesRec times[0]; */
|
---|
298 | } RRClientRec, *RRClientPtr;
|
---|
299 |
|
---|
300 | extern RESTYPE RRClientType, RREventType; /* resource types for event masks */
|
---|
301 | extern int RRClientPrivateIndex;
|
---|
302 | extern RESTYPE RRCrtcType, RRModeType, RROutputType;
|
---|
303 |
|
---|
304 | #define LookupOutput(client,id,a) ((RROutputPtr) \
|
---|
305 | (SecurityLookupIDByType (client, id, \
|
---|
306 | RROutputType, a)))
|
---|
307 | #define LookupCrtc(client,id,a) ((RRCrtcPtr) \
|
---|
308 | (SecurityLookupIDByType (client, id, \
|
---|
309 | RRCrtcType, a)))
|
---|
310 | #define LookupMode(client,id,a) ((RRModePtr) \
|
---|
311 | (SecurityLookupIDByType (client, id, \
|
---|
312 | RRModeType, a)))
|
---|
313 |
|
---|
314 | #define GetRRClient(pClient) ((RRClientPtr) (pClient)->devPrivates[RRClientPrivateIndex].ptr)
|
---|
315 | #define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient)
|
---|
316 |
|
---|
317 | /* Initialize the extension */
|
---|
318 | void
|
---|
319 | RRExtensionInit (void);
|
---|
320 |
|
---|
321 | #ifdef RANDR_12_INTERFACE
|
---|
322 | /*
|
---|
323 | * Set the range of sizes for the screen
|
---|
324 | */
|
---|
325 | void
|
---|
326 | RRScreenSetSizeRange (ScreenPtr pScreen,
|
---|
327 | CARD16 minWidth,
|
---|
328 | CARD16 minHeight,
|
---|
329 | CARD16 maxWidth,
|
---|
330 | CARD16 maxHeight);
|
---|
331 | #endif
|
---|
332 |
|
---|
333 | /* rrscreen.c */
|
---|
334 | /*
|
---|
335 | * Notify the extension that the screen size has been changed.
|
---|
336 | * The driver is responsible for calling this whenever it has changed
|
---|
337 | * the size of the screen
|
---|
338 | */
|
---|
339 | void
|
---|
340 | RRScreenSizeNotify (ScreenPtr pScreen);
|
---|
341 |
|
---|
342 | /*
|
---|
343 | * Request that the screen be resized
|
---|
344 | */
|
---|
345 | Bool
|
---|
346 | RRScreenSizeSet (ScreenPtr pScreen,
|
---|
347 | CARD16 width,
|
---|
348 | CARD16 height,
|
---|
349 | CARD32 mmWidth,
|
---|
350 | CARD32 mmHeight);
|
---|
351 |
|
---|
352 | /*
|
---|
353 | * Send ConfigureNotify event to root window when 'something' happens
|
---|
354 | */
|
---|
355 | void
|
---|
356 | RRSendConfigNotify (ScreenPtr pScreen);
|
---|
357 |
|
---|
358 | /*
|
---|
359 | * screen dispatch
|
---|
360 | */
|
---|
361 | int
|
---|
362 | ProcRRGetScreenSizeRange (ClientPtr client);
|
---|
363 |
|
---|
364 | int
|
---|
365 | ProcRRSetScreenSize (ClientPtr client);
|
---|
366 |
|
---|
367 | int
|
---|
368 | ProcRRGetScreenResources (ClientPtr client);
|
---|
369 |
|
---|
370 | int
|
---|
371 | ProcRRSetScreenConfig (ClientPtr client);
|
---|
372 |
|
---|
373 | int
|
---|
374 | ProcRRGetScreenInfo (ClientPtr client);
|
---|
375 |
|
---|
376 | /*
|
---|
377 | * Deliver a ScreenNotify event
|
---|
378 | */
|
---|
379 | void
|
---|
380 | RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen);
|
---|
381 |
|
---|
382 | /* mirandr.c */
|
---|
383 | Bool
|
---|
384 | miRandRInit (ScreenPtr pScreen);
|
---|
385 |
|
---|
386 | Bool
|
---|
387 | miRRGetInfo (ScreenPtr pScreen, Rotation *rotations);
|
---|
388 |
|
---|
389 | Bool
|
---|
390 | miRRGetScreenInfo (ScreenPtr pScreen);
|
---|
391 |
|
---|
392 | Bool
|
---|
393 | miRRCrtcSet (ScreenPtr pScreen,
|
---|
394 | RRCrtcPtr crtc,
|
---|
395 | RRModePtr mode,
|
---|
396 | int x,
|
---|
397 | int y,
|
---|
398 | Rotation rotation,
|
---|
399 | int numOutput,
|
---|
400 | RROutputPtr *outputs);
|
---|
401 |
|
---|
402 | Bool
|
---|
403 | miRROutputSetProperty (ScreenPtr pScreen,
|
---|
404 | RROutputPtr output,
|
---|
405 | Atom property,
|
---|
406 | RRPropertyValuePtr value);
|
---|
407 |
|
---|
408 | Bool
|
---|
409 | miRROutputValidateMode (ScreenPtr pScreen,
|
---|
410 | RROutputPtr output,
|
---|
411 | RRModePtr mode);
|
---|
412 |
|
---|
413 | void
|
---|
414 | miRRModeDestroy (ScreenPtr pScreen,
|
---|
415 | RRModePtr mode);
|
---|
416 |
|
---|
417 | /* randr.c */
|
---|
418 | /*
|
---|
419 | * Send all pending events
|
---|
420 | */
|
---|
421 | void
|
---|
422 | RRTellChanged (ScreenPtr pScreen);
|
---|
423 |
|
---|
424 | /*
|
---|
425 | * Poll the driver for changed information
|
---|
426 | */
|
---|
427 | Bool
|
---|
428 | RRGetInfo (ScreenPtr pScreen);
|
---|
429 |
|
---|
430 | Bool RRInit (void);
|
---|
431 |
|
---|
432 | Bool RRScreenInit(ScreenPtr pScreen);
|
---|
433 |
|
---|
434 | RROutputPtr
|
---|
435 | RRFirstOutput (ScreenPtr pScreen);
|
---|
436 |
|
---|
437 | Rotation
|
---|
438 | RRGetRotation (ScreenPtr pScreen);
|
---|
439 |
|
---|
440 | CARD16
|
---|
441 | RRVerticalRefresh (xRRModeInfo *mode);
|
---|
442 |
|
---|
443 | #ifdef RANDR_10_INTERFACE
|
---|
444 | /*
|
---|
445 | * This is the old interface, deprecated but left
|
---|
446 | * around for compatibility
|
---|
447 | */
|
---|
448 |
|
---|
449 | /*
|
---|
450 | * Then, register the specific size with the screen
|
---|
451 | */
|
---|
452 |
|
---|
453 | RRScreenSizePtr
|
---|
454 | RRRegisterSize (ScreenPtr pScreen,
|
---|
455 | short width,
|
---|
456 | short height,
|
---|
457 | short mmWidth,
|
---|
458 | short mmHeight);
|
---|
459 |
|
---|
460 | Bool RRRegisterRate (ScreenPtr pScreen,
|
---|
461 | RRScreenSizePtr pSize,
|
---|
462 | int rate);
|
---|
463 |
|
---|
464 | /*
|
---|
465 | * Finally, set the current configuration of the screen
|
---|
466 | */
|
---|
467 |
|
---|
468 | void
|
---|
469 | RRSetCurrentConfig (ScreenPtr pScreen,
|
---|
470 | Rotation rotation,
|
---|
471 | int rate,
|
---|
472 | RRScreenSizePtr pSize);
|
---|
473 |
|
---|
474 | Bool RRScreenInit (ScreenPtr pScreen);
|
---|
475 |
|
---|
476 | Rotation
|
---|
477 | RRGetRotation (ScreenPtr pScreen);
|
---|
478 |
|
---|
479 | int
|
---|
480 | RRSetScreenConfig (ScreenPtr pScreen,
|
---|
481 | Rotation rotation,
|
---|
482 | int rate,
|
---|
483 | RRScreenSizePtr pSize);
|
---|
484 |
|
---|
485 | #endif
|
---|
486 |
|
---|
487 | /* rrcrtc.c */
|
---|
488 |
|
---|
489 | /*
|
---|
490 | * Notify the CRTC of some change; layoutChanged indicates that
|
---|
491 | * some position or size element changed
|
---|
492 | */
|
---|
493 | void
|
---|
494 | RRCrtcChanged (RRCrtcPtr crtc, Bool layoutChanged);
|
---|
495 |
|
---|
496 | /*
|
---|
497 | * Create a CRTC
|
---|
498 | */
|
---|
499 | RRCrtcPtr
|
---|
500 | RRCrtcCreate (ScreenPtr pScreen, void *devPrivate);
|
---|
501 |
|
---|
502 | /*
|
---|
503 | * Set the allowed rotations on a CRTC
|
---|
504 | */
|
---|
505 | void
|
---|
506 | RRCrtcSetRotations (RRCrtcPtr crtc, Rotation rotations);
|
---|
507 |
|
---|
508 | /*
|
---|
509 | * Notify the extension that the Crtc has been reconfigured,
|
---|
510 | * the driver calls this whenever it has updated the mode
|
---|
511 | */
|
---|
512 | Bool
|
---|
513 | RRCrtcNotify (RRCrtcPtr crtc,
|
---|
514 | RRModePtr mode,
|
---|
515 | int x,
|
---|
516 | int y,
|
---|
517 | Rotation rotation,
|
---|
518 | int numOutputs,
|
---|
519 | RROutputPtr *outputs);
|
---|
520 |
|
---|
521 | void
|
---|
522 | RRDeliverCrtcEvent (ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc);
|
---|
523 |
|
---|
524 | /*
|
---|
525 | * Request that the Crtc be reconfigured
|
---|
526 | */
|
---|
527 | Bool
|
---|
528 | RRCrtcSet (RRCrtcPtr crtc,
|
---|
529 | RRModePtr mode,
|
---|
530 | int x,
|
---|
531 | int y,
|
---|
532 | Rotation rotation,
|
---|
533 | int numOutput,
|
---|
534 | RROutputPtr *outputs);
|
---|
535 |
|
---|
536 | /*
|
---|
537 | * Request that the Crtc gamma be changed
|
---|
538 | */
|
---|
539 |
|
---|
540 | Bool
|
---|
541 | RRCrtcGammaSet (RRCrtcPtr crtc,
|
---|
542 | CARD16 *red,
|
---|
543 | CARD16 *green,
|
---|
544 | CARD16 *blue);
|
---|
545 |
|
---|
546 | /*
|
---|
547 | * Notify the extension that the Crtc gamma has been changed
|
---|
548 | * The driver calls this whenever it has changed the gamma values
|
---|
549 | * in the RRCrtcRec
|
---|
550 | */
|
---|
551 |
|
---|
552 | Bool
|
---|
553 | RRCrtcGammaNotify (RRCrtcPtr crtc);
|
---|
554 |
|
---|
555 | /*
|
---|
556 | * Set the size of the gamma table at server startup time
|
---|
557 | */
|
---|
558 |
|
---|
559 | Bool
|
---|
560 | RRCrtcGammaSetSize (RRCrtcPtr crtc,
|
---|
561 | int size);
|
---|
562 |
|
---|
563 | /*
|
---|
564 | * Return the area of the frame buffer scanned out by the crtc,
|
---|
565 | * taking into account the current mode and rotation
|
---|
566 | */
|
---|
567 |
|
---|
568 | void
|
---|
569 | RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height);
|
---|
570 |
|
---|
571 | /*
|
---|
572 | * Destroy a Crtc at shutdown
|
---|
573 | */
|
---|
574 | void
|
---|
575 | RRCrtcDestroy (RRCrtcPtr crtc);
|
---|
576 |
|
---|
577 | /*
|
---|
578 | * Initialize crtc type
|
---|
579 | */
|
---|
580 | Bool
|
---|
581 | RRCrtcInit (void);
|
---|
582 |
|
---|
583 | /*
|
---|
584 | * Crtc dispatch
|
---|
585 | */
|
---|
586 |
|
---|
587 | int
|
---|
588 | ProcRRGetCrtcInfo (ClientPtr client);
|
---|
589 |
|
---|
590 | int
|
---|
591 | ProcRRSetCrtcConfig (ClientPtr client);
|
---|
592 |
|
---|
593 | int
|
---|
594 | ProcRRGetCrtcGammaSize (ClientPtr client);
|
---|
595 |
|
---|
596 | int
|
---|
597 | ProcRRGetCrtcGamma (ClientPtr client);
|
---|
598 |
|
---|
599 | int
|
---|
600 | ProcRRSetCrtcGamma (ClientPtr client);
|
---|
601 |
|
---|
602 | /* rrdispatch.c */
|
---|
603 | Bool
|
---|
604 | RRClientKnowsRates (ClientPtr pClient);
|
---|
605 |
|
---|
606 | /* rrmode.c */
|
---|
607 | /*
|
---|
608 | * Find, and if necessary, create a mode
|
---|
609 | */
|
---|
610 |
|
---|
611 | RRModePtr
|
---|
612 | RRModeGet (xRRModeInfo *modeInfo,
|
---|
613 | const char *name);
|
---|
614 |
|
---|
615 | void
|
---|
616 | RRModePruneUnused (ScreenPtr pScreen);
|
---|
617 |
|
---|
618 | /*
|
---|
619 | * Destroy a mode.
|
---|
620 | */
|
---|
621 |
|
---|
622 | void
|
---|
623 | RRModeDestroy (RRModePtr mode);
|
---|
624 |
|
---|
625 | /*
|
---|
626 | * Return a list of modes that are valid for some output in pScreen
|
---|
627 | */
|
---|
628 | RRModePtr *
|
---|
629 | RRModesForScreen (ScreenPtr pScreen, int *num_ret);
|
---|
630 |
|
---|
631 | /*
|
---|
632 | * Initialize mode type
|
---|
633 | */
|
---|
634 | Bool
|
---|
635 | RRModeInit (void);
|
---|
636 |
|
---|
637 | int
|
---|
638 | ProcRRCreateMode (ClientPtr client);
|
---|
639 |
|
---|
640 | int
|
---|
641 | ProcRRDestroyMode (ClientPtr client);
|
---|
642 |
|
---|
643 | int
|
---|
644 | ProcRRAddOutputMode (ClientPtr client);
|
---|
645 |
|
---|
646 | int
|
---|
647 | ProcRRDeleteOutputMode (ClientPtr client);
|
---|
648 |
|
---|
649 | /* rroutput.c */
|
---|
650 |
|
---|
651 | /*
|
---|
652 | * Notify the output of some change. configChanged indicates whether
|
---|
653 | * any external configuration (mode list, clones, connected status)
|
---|
654 | * has changed, or whether the change was strictly internal
|
---|
655 | * (which crtc is in use)
|
---|
656 | */
|
---|
657 | void
|
---|
658 | RROutputChanged (RROutputPtr output, Bool configChanged);
|
---|
659 |
|
---|
660 | /*
|
---|
661 | * Create an output
|
---|
662 | */
|
---|
663 |
|
---|
664 | RROutputPtr
|
---|
665 | RROutputCreate (ScreenPtr pScreen,
|
---|
666 | const char *name,
|
---|
667 | int nameLength,
|
---|
668 | void *devPrivate);
|
---|
669 |
|
---|
670 | /*
|
---|
671 | * Notify extension that output parameters have been changed
|
---|
672 | */
|
---|
673 | Bool
|
---|
674 | RROutputSetClones (RROutputPtr output,
|
---|
675 | RROutputPtr *clones,
|
---|
676 | int numClones);
|
---|
677 |
|
---|
678 | Bool
|
---|
679 | RROutputSetModes (RROutputPtr output,
|
---|
680 | RRModePtr *modes,
|
---|
681 | int numModes,
|
---|
682 | int numPreferred);
|
---|
683 |
|
---|
684 | int
|
---|
685 | RROutputAddUserMode (RROutputPtr output,
|
---|
686 | RRModePtr mode);
|
---|
687 |
|
---|
688 | int
|
---|
689 | RROutputDeleteUserMode (RROutputPtr output,
|
---|
690 | RRModePtr mode);
|
---|
691 |
|
---|
692 | Bool
|
---|
693 | RROutputSetCrtcs (RROutputPtr output,
|
---|
694 | RRCrtcPtr *crtcs,
|
---|
695 | int numCrtcs);
|
---|
696 |
|
---|
697 | Bool
|
---|
698 | RROutputSetConnection (RROutputPtr output,
|
---|
699 | CARD8 connection);
|
---|
700 |
|
---|
701 | Bool
|
---|
702 | RROutputSetSubpixelOrder (RROutputPtr output,
|
---|
703 | int subpixelOrder);
|
---|
704 |
|
---|
705 | Bool
|
---|
706 | RROutputSetPhysicalSize (RROutputPtr output,
|
---|
707 | int mmWidth,
|
---|
708 | int mmHeight);
|
---|
709 |
|
---|
710 | void
|
---|
711 | RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output);
|
---|
712 |
|
---|
713 | void
|
---|
714 | RROutputDestroy (RROutputPtr output);
|
---|
715 |
|
---|
716 | int
|
---|
717 | ProcRRGetOutputInfo (ClientPtr client);
|
---|
718 |
|
---|
719 | /*
|
---|
720 | * Initialize output type
|
---|
721 | */
|
---|
722 | Bool
|
---|
723 | RROutputInit (void);
|
---|
724 |
|
---|
725 | /* rrpointer.c */
|
---|
726 | void
|
---|
727 | RRPointerMoved (ScreenPtr pScreen, int x, int y);
|
---|
728 |
|
---|
729 | void
|
---|
730 | RRPointerScreenConfigured (ScreenPtr pScreen);
|
---|
731 |
|
---|
732 | /* rrproperty.c */
|
---|
733 |
|
---|
734 | void
|
---|
735 | RRDeleteAllOutputProperties (RROutputPtr output);
|
---|
736 |
|
---|
737 | RRPropertyValuePtr
|
---|
738 | RRGetOutputProperty (RROutputPtr output, Atom property, Bool pending);
|
---|
739 |
|
---|
740 | RRPropertyPtr
|
---|
741 | RRQueryOutputProperty (RROutputPtr output, Atom property);
|
---|
742 |
|
---|
743 | void
|
---|
744 | RRDeleteOutputProperty (RROutputPtr output, Atom property);
|
---|
745 |
|
---|
746 | Bool
|
---|
747 | RRPostPendingProperties (RROutputPtr output);
|
---|
748 |
|
---|
749 | int
|
---|
750 | RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type,
|
---|
751 | int format, int mode, unsigned long len,
|
---|
752 | pointer value, Bool sendevent, Bool pending);
|
---|
753 |
|
---|
754 | int
|
---|
755 | RRConfigureOutputProperty (RROutputPtr output, Atom property,
|
---|
756 | Bool pending, Bool range, Bool immutable,
|
---|
757 | int num_values, INT32 *values);
|
---|
758 | int
|
---|
759 | ProcRRChangeOutputProperty (ClientPtr client);
|
---|
760 |
|
---|
761 | int
|
---|
762 | ProcRRGetOutputProperty (ClientPtr client);
|
---|
763 |
|
---|
764 | int
|
---|
765 | ProcRRListOutputProperties (ClientPtr client);
|
---|
766 |
|
---|
767 | int
|
---|
768 | ProcRRQueryOutputProperty (ClientPtr client);
|
---|
769 |
|
---|
770 | int
|
---|
771 | ProcRRConfigureOutputProperty (ClientPtr client);
|
---|
772 |
|
---|
773 | int
|
---|
774 | ProcRRDeleteOutputProperty (ClientPtr client);
|
---|
775 |
|
---|
776 | /* rrxinerama.c */
|
---|
777 | void
|
---|
778 | RRXineramaExtensionInit(void);
|
---|
779 |
|
---|
780 | #endif /* _RANDRSTR_H_ */
|
---|
781 |
|
---|
782 | /*
|
---|
783 |
|
---|
784 | randr extension implementation structure
|
---|
785 |
|
---|
786 | Query state:
|
---|
787 | ProcRRGetScreenInfo/ProcRRGetScreenResources
|
---|
788 | RRGetInfo
|
---|
789 |
|
---|
790 | • Request configuration from driver, either 1.0 or 1.2 style
|
---|
791 | • These functions only record state changes, all
|
---|
792 | other actions are pended until RRTellChanged is called
|
---|
793 |
|
---|
794 | ->rrGetInfo
|
---|
795 | 1.0:
|
---|
796 | RRRegisterSize
|
---|
797 | RRRegisterRate
|
---|
798 | RRSetCurrentConfig
|
---|
799 | 1.2:
|
---|
800 | RRScreenSetSizeRange
|
---|
801 | RROutputSetCrtcs
|
---|
802 | RRModeGet
|
---|
803 | RROutputSetModes
|
---|
804 | RROutputSetConnection
|
---|
805 | RROutputSetSubpixelOrder
|
---|
806 | RROutputSetClones
|
---|
807 | RRCrtcNotify
|
---|
808 |
|
---|
809 | • Must delay scanning configuration until after ->rrGetInfo returns
|
---|
810 | because some drivers will call SetCurrentConfig in the middle
|
---|
811 | of the ->rrGetInfo operation.
|
---|
812 |
|
---|
813 | 1.0:
|
---|
814 |
|
---|
815 | • Scan old configuration, mirror to new structures
|
---|
816 |
|
---|
817 | RRScanOldConfig
|
---|
818 | RRCrtcCreate
|
---|
819 | RROutputCreate
|
---|
820 | RROutputSetCrtcs
|
---|
821 | RROutputSetConnection
|
---|
822 | RROutputSetSubpixelOrder
|
---|
823 | RROldModeAdd • This adds modes one-at-a-time
|
---|
824 | RRModeGet
|
---|
825 | RRCrtcNotify
|
---|
826 |
|
---|
827 | • send events, reset pointer if necessary
|
---|
828 |
|
---|
829 | RRTellChanged
|
---|
830 | WalkTree (sending events)
|
---|
831 |
|
---|
832 | • when layout has changed:
|
---|
833 | RRPointerScreenConfigured
|
---|
834 | RRSendConfigNotify
|
---|
835 |
|
---|
836 | Asynchronous state setting (1.2 only)
|
---|
837 | When setting state asynchronously, the driver invokes the
|
---|
838 | ->rrGetInfo function and then calls RRTellChanged to flush
|
---|
839 | the changes to the clients and reset pointer if necessary
|
---|
840 |
|
---|
841 | Set state
|
---|
842 |
|
---|
843 | ProcRRSetScreenConfig
|
---|
844 | RRCrtcSet
|
---|
845 | 1.2:
|
---|
846 | ->rrCrtcSet
|
---|
847 | RRCrtcNotify
|
---|
848 | 1.0:
|
---|
849 | ->rrSetConfig
|
---|
850 | RRCrtcNotify
|
---|
851 | RRTellChanged
|
---|
852 | */
|
---|