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