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 | void
|
---|
568 | RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height);
|
---|
569 |
|
---|
570 | /*
|
---|
571 | * Destroy a Crtc at shutdown
|
---|
572 | */
|
---|
573 | void
|
---|
574 | RRCrtcDestroy (RRCrtcPtr crtc);
|
---|
575 |
|
---|
576 | /*
|
---|
577 | * Initialize crtc type
|
---|
578 | */
|
---|
579 | Bool
|
---|
580 | RRCrtcInit (void);
|
---|
581 |
|
---|
582 | /*
|
---|
583 | * Crtc dispatch
|
---|
584 | */
|
---|
585 |
|
---|
586 | int
|
---|
587 | ProcRRGetCrtcInfo (ClientPtr client);
|
---|
588 |
|
---|
589 | int
|
---|
590 | ProcRRSetCrtcConfig (ClientPtr client);
|
---|
591 |
|
---|
592 | int
|
---|
593 | ProcRRGetCrtcGammaSize (ClientPtr client);
|
---|
594 |
|
---|
595 | int
|
---|
596 | ProcRRGetCrtcGamma (ClientPtr client);
|
---|
597 |
|
---|
598 | int
|
---|
599 | ProcRRSetCrtcGamma (ClientPtr client);
|
---|
600 |
|
---|
601 | /* rrdispatch.c */
|
---|
602 | Bool
|
---|
603 | RRClientKnowsRates (ClientPtr pClient);
|
---|
604 |
|
---|
605 | /* rrmode.c */
|
---|
606 | /*
|
---|
607 | * Find, and if necessary, create a mode
|
---|
608 | */
|
---|
609 |
|
---|
610 | RRModePtr
|
---|
611 | RRModeGet (xRRModeInfo *modeInfo,
|
---|
612 | const char *name);
|
---|
613 |
|
---|
614 | void
|
---|
615 | RRModePruneUnused (ScreenPtr pScreen);
|
---|
616 |
|
---|
617 | /*
|
---|
618 | * Destroy a mode.
|
---|
619 | */
|
---|
620 |
|
---|
621 | void
|
---|
622 | RRModeDestroy (RRModePtr mode);
|
---|
623 |
|
---|
624 | /*
|
---|
625 | * Return a list of modes that are valid for some output in pScreen
|
---|
626 | */
|
---|
627 | RRModePtr *
|
---|
628 | RRModesForScreen (ScreenPtr pScreen, int *num_ret);
|
---|
629 |
|
---|
630 | /*
|
---|
631 | * Initialize mode type
|
---|
632 | */
|
---|
633 | Bool
|
---|
634 | RRModeInit (void);
|
---|
635 |
|
---|
636 | int
|
---|
637 | ProcRRCreateMode (ClientPtr client);
|
---|
638 |
|
---|
639 | int
|
---|
640 | ProcRRDestroyMode (ClientPtr client);
|
---|
641 |
|
---|
642 | int
|
---|
643 | ProcRRAddOutputMode (ClientPtr client);
|
---|
644 |
|
---|
645 | int
|
---|
646 | ProcRRDeleteOutputMode (ClientPtr client);
|
---|
647 |
|
---|
648 | /* rroutput.c */
|
---|
649 |
|
---|
650 | /*
|
---|
651 | * Notify the output of some change. configChanged indicates whether
|
---|
652 | * any external configuration (mode list, clones, connected status)
|
---|
653 | * has changed, or whether the change was strictly internal
|
---|
654 | * (which crtc is in use)
|
---|
655 | */
|
---|
656 | void
|
---|
657 | RROutputChanged (RROutputPtr output, Bool configChanged);
|
---|
658 |
|
---|
659 | /*
|
---|
660 | * Create an output
|
---|
661 | */
|
---|
662 |
|
---|
663 | RROutputPtr
|
---|
664 | RROutputCreate (ScreenPtr pScreen,
|
---|
665 | const char *name,
|
---|
666 | int nameLength,
|
---|
667 | void *devPrivate);
|
---|
668 |
|
---|
669 | /*
|
---|
670 | * Notify extension that output parameters have been changed
|
---|
671 | */
|
---|
672 | Bool
|
---|
673 | RROutputSetClones (RROutputPtr output,
|
---|
674 | RROutputPtr *clones,
|
---|
675 | int numClones);
|
---|
676 |
|
---|
677 | Bool
|
---|
678 | RROutputSetModes (RROutputPtr output,
|
---|
679 | RRModePtr *modes,
|
---|
680 | int numModes,
|
---|
681 | int numPreferred);
|
---|
682 |
|
---|
683 | int
|
---|
684 | RROutputAddUserMode (RROutputPtr output,
|
---|
685 | RRModePtr mode);
|
---|
686 |
|
---|
687 | int
|
---|
688 | RROutputDeleteUserMode (RROutputPtr output,
|
---|
689 | RRModePtr mode);
|
---|
690 |
|
---|
691 | Bool
|
---|
692 | RROutputSetCrtcs (RROutputPtr output,
|
---|
693 | RRCrtcPtr *crtcs,
|
---|
694 | int numCrtcs);
|
---|
695 |
|
---|
696 | void
|
---|
697 | RROutputSetCrtc (RROutputPtr output, RRCrtcPtr crtc);
|
---|
698 |
|
---|
699 | Bool
|
---|
700 | RROutputSetConnection (RROutputPtr output,
|
---|
701 | CARD8 connection);
|
---|
702 |
|
---|
703 | Bool
|
---|
704 | RROutputSetSubpixelOrder (RROutputPtr output,
|
---|
705 | int subpixelOrder);
|
---|
706 |
|
---|
707 | Bool
|
---|
708 | RROutputSetPhysicalSize (RROutputPtr output,
|
---|
709 | int mmWidth,
|
---|
710 | int mmHeight);
|
---|
711 |
|
---|
712 | void
|
---|
713 | RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output);
|
---|
714 |
|
---|
715 | void
|
---|
716 | RROutputDestroy (RROutputPtr output);
|
---|
717 |
|
---|
718 | int
|
---|
719 | ProcRRGetOutputInfo (ClientPtr client);
|
---|
720 |
|
---|
721 | /*
|
---|
722 | * Initialize output type
|
---|
723 | */
|
---|
724 | Bool
|
---|
725 | RROutputInit (void);
|
---|
726 |
|
---|
727 | /* rrpointer.c */
|
---|
728 | void
|
---|
729 | RRPointerMoved (ScreenPtr pScreen, int x, int y);
|
---|
730 |
|
---|
731 | void
|
---|
732 | RRPointerScreenConfigured (ScreenPtr pScreen);
|
---|
733 |
|
---|
734 | /* rrproperty.c */
|
---|
735 |
|
---|
736 | void
|
---|
737 | RRDeleteAllOutputProperties (RROutputPtr output);
|
---|
738 |
|
---|
739 | RRPropertyValuePtr
|
---|
740 | RRGetOutputProperty (RROutputPtr output, Atom property, Bool pending);
|
---|
741 |
|
---|
742 | RRPropertyPtr
|
---|
743 | RRQueryOutputProperty (RROutputPtr output, Atom property);
|
---|
744 |
|
---|
745 | void
|
---|
746 | RRDeleteOutputProperty (RROutputPtr output, Atom property);
|
---|
747 |
|
---|
748 | Bool
|
---|
749 | RRPostPendingProperties (RROutputPtr output);
|
---|
750 |
|
---|
751 | int
|
---|
752 | RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type,
|
---|
753 | int format, int mode, unsigned long len,
|
---|
754 | pointer value, Bool sendevent, Bool pending);
|
---|
755 |
|
---|
756 | int
|
---|
757 | RRConfigureOutputProperty (RROutputPtr output, Atom property,
|
---|
758 | Bool pending, Bool range, Bool immutable,
|
---|
759 | int num_values, INT32 *values);
|
---|
760 | int
|
---|
761 | ProcRRChangeOutputProperty (ClientPtr client);
|
---|
762 |
|
---|
763 | int
|
---|
764 | ProcRRGetOutputProperty (ClientPtr client);
|
---|
765 |
|
---|
766 | int
|
---|
767 | ProcRRListOutputProperties (ClientPtr client);
|
---|
768 |
|
---|
769 | int
|
---|
770 | ProcRRQueryOutputProperty (ClientPtr client);
|
---|
771 |
|
---|
772 | int
|
---|
773 | ProcRRConfigureOutputProperty (ClientPtr client);
|
---|
774 |
|
---|
775 | int
|
---|
776 | ProcRRDeleteOutputProperty (ClientPtr client);
|
---|
777 |
|
---|
778 | /* rrxinerama.c */
|
---|
779 | void
|
---|
780 | RRXineramaExtensionInit(void);
|
---|
781 |
|
---|
782 | #endif /* _RANDRSTR_H_ */
|
---|
783 |
|
---|
784 | /*
|
---|
785 |
|
---|
786 | randr extension implementation structure
|
---|
787 |
|
---|
788 | Query state:
|
---|
789 | ProcRRGetScreenInfo/ProcRRGetScreenResources
|
---|
790 | RRGetInfo
|
---|
791 |
|
---|
792 | • Request configuration from driver, either 1.0 or 1.2 style
|
---|
793 | • These functions only record state changes, all
|
---|
794 | other actions are pended until RRTellChanged is called
|
---|
795 |
|
---|
796 | ->rrGetInfo
|
---|
797 | 1.0:
|
---|
798 | RRRegisterSize
|
---|
799 | RRRegisterRate
|
---|
800 | RRSetCurrentConfig
|
---|
801 | 1.2:
|
---|
802 | RRScreenSetSizeRange
|
---|
803 | RROutputSetCrtcs
|
---|
804 | RROutputSetCrtc
|
---|
805 | RRModeGet
|
---|
806 | RROutputSetModes
|
---|
807 | RROutputSetConnection
|
---|
808 | RROutputSetSubpixelOrder
|
---|
809 | RROutputSetClones
|
---|
810 | RRCrtcNotify
|
---|
811 |
|
---|
812 | • Must delay scanning configuration until after ->rrGetInfo returns
|
---|
813 | because some drivers will call SetCurrentConfig in the middle
|
---|
814 | of the ->rrGetInfo operation.
|
---|
815 |
|
---|
816 | 1.0:
|
---|
817 |
|
---|
818 | • Scan old configuration, mirror to new structures
|
---|
819 |
|
---|
820 | RRScanOldConfig
|
---|
821 | RRCrtcCreate
|
---|
822 | RROutputCreate
|
---|
823 | RROutputSetCrtcs
|
---|
824 | RROutputSetCrtc
|
---|
825 | RROutputSetConnection
|
---|
826 | RROutputSetSubpixelOrder
|
---|
827 | RROldModeAdd • This adds modes one-at-a-time
|
---|
828 | RRModeGet
|
---|
829 | RRCrtcNotify
|
---|
830 |
|
---|
831 | • send events, reset pointer if necessary
|
---|
832 |
|
---|
833 | RRTellChanged
|
---|
834 | WalkTree (sending events)
|
---|
835 |
|
---|
836 | • when layout has changed:
|
---|
837 | RRPointerScreenConfigured
|
---|
838 | RRSendConfigNotify
|
---|
839 |
|
---|
840 | Asynchronous state setting (1.2 only)
|
---|
841 | When setting state asynchronously, the driver invokes the
|
---|
842 | ->rrGetInfo function and then calls RRTellChanged to flush
|
---|
843 | the changes to the clients and reset pointer if necessary
|
---|
844 |
|
---|
845 | Set state
|
---|
846 |
|
---|
847 | ProcRRSetScreenConfig
|
---|
848 | RRCrtcSet
|
---|
849 | 1.2:
|
---|
850 | ->rrCrtcSet
|
---|
851 | RRCrtcNotify
|
---|
852 | 1.0:
|
---|
853 | ->rrSetConfig
|
---|
854 | RRCrtcNotify
|
---|
855 | RRTellChanged
|
---|
856 | */
|
---|