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