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 Rotation
|
---|
466 | RRGetRotation (ScreenPtr pScreen);
|
---|
467 |
|
---|
468 | extern _X_EXPORT CARD16
|
---|
469 | RRVerticalRefresh (xRRModeInfo *mode);
|
---|
470 |
|
---|
471 | #ifdef RANDR_10_INTERFACE
|
---|
472 | /*
|
---|
473 | * This is the old interface, deprecated but left
|
---|
474 | * around for compatibility
|
---|
475 | */
|
---|
476 |
|
---|
477 | /*
|
---|
478 | * Then, register the specific size with the screen
|
---|
479 | */
|
---|
480 |
|
---|
481 | extern _X_EXPORT RRScreenSizePtr
|
---|
482 | RRRegisterSize (ScreenPtr pScreen,
|
---|
483 | short width,
|
---|
484 | short height,
|
---|
485 | short mmWidth,
|
---|
486 | short mmHeight);
|
---|
487 |
|
---|
488 | extern _X_EXPORT Bool
|
---|
489 | RRRegisterRate (ScreenPtr pScreen,
|
---|
490 | RRScreenSizePtr pSize,
|
---|
491 | int rate);
|
---|
492 |
|
---|
493 | /*
|
---|
494 | * Finally, set the current configuration of the screen
|
---|
495 | */
|
---|
496 |
|
---|
497 | extern _X_EXPORT void
|
---|
498 | RRSetCurrentConfig (ScreenPtr pScreen,
|
---|
499 | Rotation rotation,
|
---|
500 | int rate,
|
---|
501 | RRScreenSizePtr pSize);
|
---|
502 |
|
---|
503 | extern _X_EXPORT Bool RRScreenInit (ScreenPtr pScreen);
|
---|
504 |
|
---|
505 | extern _X_EXPORT Rotation
|
---|
506 | RRGetRotation (ScreenPtr pScreen);
|
---|
507 |
|
---|
508 | #endif
|
---|
509 |
|
---|
510 | /* rrcrtc.c */
|
---|
511 |
|
---|
512 | /*
|
---|
513 | * Notify the CRTC of some change; layoutChanged indicates that
|
---|
514 | * some position or size element changed
|
---|
515 | */
|
---|
516 | extern _X_EXPORT void
|
---|
517 | RRCrtcChanged (RRCrtcPtr crtc, Bool layoutChanged);
|
---|
518 |
|
---|
519 | /*
|
---|
520 | * Create a CRTC
|
---|
521 | */
|
---|
522 | extern _X_EXPORT RRCrtcPtr
|
---|
523 | RRCrtcCreate (ScreenPtr pScreen, void *devPrivate);
|
---|
524 |
|
---|
525 | /*
|
---|
526 | * Set the allowed rotations on a CRTC
|
---|
527 | */
|
---|
528 | extern _X_EXPORT void
|
---|
529 | RRCrtcSetRotations (RRCrtcPtr crtc, Rotation rotations);
|
---|
530 |
|
---|
531 | /*
|
---|
532 | * Set whether transforms are allowed on a CRTC
|
---|
533 | */
|
---|
534 | extern _X_EXPORT void
|
---|
535 | RRCrtcSetTransformSupport (RRCrtcPtr crtc, Bool transforms);
|
---|
536 |
|
---|
537 | /*
|
---|
538 | * Notify the extension that the Crtc has been reconfigured,
|
---|
539 | * the driver calls this whenever it has updated the mode
|
---|
540 | */
|
---|
541 | extern _X_EXPORT Bool
|
---|
542 | RRCrtcNotify (RRCrtcPtr crtc,
|
---|
543 | RRModePtr mode,
|
---|
544 | int x,
|
---|
545 | int y,
|
---|
546 | Rotation rotation,
|
---|
547 | RRTransformPtr transform,
|
---|
548 | int numOutputs,
|
---|
549 | RROutputPtr *outputs);
|
---|
550 |
|
---|
551 | extern _X_EXPORT void
|
---|
552 | RRDeliverCrtcEvent (ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc);
|
---|
553 |
|
---|
554 | /*
|
---|
555 | * Request that the Crtc be reconfigured
|
---|
556 | */
|
---|
557 | extern _X_EXPORT Bool
|
---|
558 | RRCrtcSet (RRCrtcPtr crtc,
|
---|
559 | RRModePtr mode,
|
---|
560 | int x,
|
---|
561 | int y,
|
---|
562 | Rotation rotation,
|
---|
563 | int numOutput,
|
---|
564 | RROutputPtr *outputs);
|
---|
565 |
|
---|
566 | /*
|
---|
567 | * Request that the Crtc gamma be changed
|
---|
568 | */
|
---|
569 |
|
---|
570 | extern _X_EXPORT Bool
|
---|
571 | RRCrtcGammaSet (RRCrtcPtr crtc,
|
---|
572 | CARD16 *red,
|
---|
573 | CARD16 *green,
|
---|
574 | CARD16 *blue);
|
---|
575 |
|
---|
576 | /*
|
---|
577 | * Request current gamma back from the DDX (if possible).
|
---|
578 | * This includes gamma size.
|
---|
579 | */
|
---|
580 |
|
---|
581 | extern _X_EXPORT Bool
|
---|
582 | RRCrtcGammaGet(RRCrtcPtr crtc);
|
---|
583 |
|
---|
584 | /*
|
---|
585 | * Notify the extension that the Crtc gamma has been changed
|
---|
586 | * The driver calls this whenever it has changed the gamma values
|
---|
587 | * in the RRCrtcRec
|
---|
588 | */
|
---|
589 |
|
---|
590 | extern _X_EXPORT Bool
|
---|
591 | RRCrtcGammaNotify (RRCrtcPtr crtc);
|
---|
592 |
|
---|
593 | /*
|
---|
594 | * Set the size of the gamma table at server startup time
|
---|
595 | */
|
---|
596 |
|
---|
597 | extern _X_EXPORT Bool
|
---|
598 | RRCrtcGammaSetSize (RRCrtcPtr crtc,
|
---|
599 | int size);
|
---|
600 |
|
---|
601 | /*
|
---|
602 | * Return the area of the frame buffer scanned out by the crtc,
|
---|
603 | * taking into account the current mode and rotation
|
---|
604 | */
|
---|
605 |
|
---|
606 | extern _X_EXPORT void
|
---|
607 | RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height);
|
---|
608 |
|
---|
609 | /*
|
---|
610 | * Compute the complete transformation matrix including
|
---|
611 | * client-specified transform, rotation/reflection values and the crtc
|
---|
612 | * offset.
|
---|
613 | *
|
---|
614 | * Return TRUE if the resulting transform is not a simple translation.
|
---|
615 | */
|
---|
616 | extern _X_EXPORT Bool
|
---|
617 | RRTransformCompute (int x,
|
---|
618 | int y,
|
---|
619 | int width,
|
---|
620 | int height,
|
---|
621 | Rotation rotation,
|
---|
622 | RRTransformPtr rr_transform,
|
---|
623 |
|
---|
624 | PictTransformPtr transform,
|
---|
625 | struct pict_f_transform *f_transform,
|
---|
626 | struct pict_f_transform *f_inverse);
|
---|
627 |
|
---|
628 | /*
|
---|
629 | * Return crtc transform
|
---|
630 | */
|
---|
631 | extern _X_EXPORT RRTransformPtr
|
---|
632 | RRCrtcGetTransform (RRCrtcPtr crtc);
|
---|
633 |
|
---|
634 | /*
|
---|
635 | * Check whether the pending and current transforms are the same
|
---|
636 | */
|
---|
637 | extern _X_EXPORT Bool
|
---|
638 | RRCrtcPendingTransform (RRCrtcPtr crtc);
|
---|
639 |
|
---|
640 | /*
|
---|
641 | * Destroy a Crtc at shutdown
|
---|
642 | */
|
---|
643 | extern _X_EXPORT void
|
---|
644 | RRCrtcDestroy (RRCrtcPtr crtc);
|
---|
645 |
|
---|
646 |
|
---|
647 | /*
|
---|
648 | * Set the pending CRTC transformation
|
---|
649 | */
|
---|
650 |
|
---|
651 | extern _X_EXPORT int
|
---|
652 | RRCrtcTransformSet (RRCrtcPtr crtc,
|
---|
653 | PictTransformPtr transform,
|
---|
654 | struct pict_f_transform *f_transform,
|
---|
655 | struct pict_f_transform *f_inverse,
|
---|
656 | char *filter,
|
---|
657 | int filter_len,
|
---|
658 | xFixed *params,
|
---|
659 | int nparams);
|
---|
660 |
|
---|
661 | /*
|
---|
662 | * Initialize crtc type
|
---|
663 | */
|
---|
664 | extern _X_EXPORT Bool
|
---|
665 | RRCrtcInit (void);
|
---|
666 |
|
---|
667 | /*
|
---|
668 | * Initialize crtc type error value
|
---|
669 | */
|
---|
670 | extern _X_EXPORT void
|
---|
671 | RRCrtcInitErrorValue (void);
|
---|
672 |
|
---|
673 | /*
|
---|
674 | * Crtc dispatch
|
---|
675 | */
|
---|
676 |
|
---|
677 | extern _X_EXPORT int
|
---|
678 | ProcRRGetCrtcInfo (ClientPtr client);
|
---|
679 |
|
---|
680 | extern _X_EXPORT int
|
---|
681 | ProcRRSetCrtcConfig (ClientPtr client);
|
---|
682 |
|
---|
683 | extern _X_EXPORT int
|
---|
684 | ProcRRGetCrtcGammaSize (ClientPtr client);
|
---|
685 |
|
---|
686 | extern _X_EXPORT int
|
---|
687 | ProcRRGetCrtcGamma (ClientPtr client);
|
---|
688 |
|
---|
689 | extern _X_EXPORT int
|
---|
690 | ProcRRSetCrtcGamma (ClientPtr client);
|
---|
691 |
|
---|
692 | extern _X_EXPORT int
|
---|
693 | ProcRRSetCrtcTransform (ClientPtr client);
|
---|
694 |
|
---|
695 | extern _X_EXPORT int
|
---|
696 | ProcRRGetCrtcTransform (ClientPtr client);
|
---|
697 |
|
---|
698 | int
|
---|
699 | ProcRRGetPanning (ClientPtr client);
|
---|
700 |
|
---|
701 | int
|
---|
702 | ProcRRSetPanning (ClientPtr client);
|
---|
703 |
|
---|
704 | void
|
---|
705 | RRConstrainCursorHarder (DeviceIntPtr, ScreenPtr, int, int *, int *);
|
---|
706 |
|
---|
707 | /* rrdispatch.c */
|
---|
708 | extern _X_EXPORT Bool
|
---|
709 | RRClientKnowsRates (ClientPtr pClient);
|
---|
710 |
|
---|
711 | /* rrmode.c */
|
---|
712 | /*
|
---|
713 | * Find, and if necessary, create a mode
|
---|
714 | */
|
---|
715 |
|
---|
716 | extern _X_EXPORT RRModePtr
|
---|
717 | RRModeGet (xRRModeInfo *modeInfo,
|
---|
718 | const char *name);
|
---|
719 |
|
---|
720 | /*
|
---|
721 | * Destroy a mode.
|
---|
722 | */
|
---|
723 |
|
---|
724 | extern _X_EXPORT void
|
---|
725 | RRModeDestroy (RRModePtr mode);
|
---|
726 |
|
---|
727 | /*
|
---|
728 | * Return a list of modes that are valid for some output in pScreen
|
---|
729 | */
|
---|
730 | extern _X_EXPORT RRModePtr *
|
---|
731 | RRModesForScreen (ScreenPtr pScreen, int *num_ret);
|
---|
732 |
|
---|
733 | /*
|
---|
734 | * Initialize mode type
|
---|
735 | */
|
---|
736 | extern _X_EXPORT Bool
|
---|
737 | RRModeInit (void);
|
---|
738 |
|
---|
739 | /*
|
---|
740 | * Initialize mode type error value
|
---|
741 | */
|
---|
742 | extern _X_EXPORT void
|
---|
743 | RRModeInitErrorValue (void);
|
---|
744 |
|
---|
745 | extern _X_EXPORT int
|
---|
746 | ProcRRCreateMode (ClientPtr client);
|
---|
747 |
|
---|
748 | extern _X_EXPORT int
|
---|
749 | ProcRRDestroyMode (ClientPtr client);
|
---|
750 |
|
---|
751 | extern _X_EXPORT int
|
---|
752 | ProcRRAddOutputMode (ClientPtr client);
|
---|
753 |
|
---|
754 | extern _X_EXPORT 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 | extern _X_EXPORT void
|
---|
766 | RROutputChanged (RROutputPtr output, Bool configChanged);
|
---|
767 |
|
---|
768 | /*
|
---|
769 | * Create an output
|
---|
770 | */
|
---|
771 |
|
---|
772 | extern _X_EXPORT 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 | extern _X_EXPORT Bool
|
---|
782 | RROutputSetClones (RROutputPtr output,
|
---|
783 | RROutputPtr *clones,
|
---|
784 | int numClones);
|
---|
785 |
|
---|
786 | extern _X_EXPORT Bool
|
---|
787 | RROutputSetModes (RROutputPtr output,
|
---|
788 | RRModePtr *modes,
|
---|
789 | int numModes,
|
---|
790 | int numPreferred);
|
---|
791 |
|
---|
792 | extern _X_EXPORT int
|
---|
793 | RROutputAddUserMode (RROutputPtr output,
|
---|
794 | RRModePtr mode);
|
---|
795 |
|
---|
796 | extern _X_EXPORT int
|
---|
797 | RROutputDeleteUserMode (RROutputPtr output,
|
---|
798 | RRModePtr mode);
|
---|
799 |
|
---|
800 | extern _X_EXPORT Bool
|
---|
801 | RROutputSetCrtcs (RROutputPtr output,
|
---|
802 | RRCrtcPtr *crtcs,
|
---|
803 | int numCrtcs);
|
---|
804 |
|
---|
805 | extern _X_EXPORT Bool
|
---|
806 | RROutputSetConnection (RROutputPtr output,
|
---|
807 | CARD8 connection);
|
---|
808 |
|
---|
809 | extern _X_EXPORT Bool
|
---|
810 | RROutputSetSubpixelOrder (RROutputPtr output,
|
---|
811 | int subpixelOrder);
|
---|
812 |
|
---|
813 | extern _X_EXPORT Bool
|
---|
814 | RROutputSetPhysicalSize (RROutputPtr output,
|
---|
815 | int mmWidth,
|
---|
816 | int mmHeight);
|
---|
817 |
|
---|
818 | extern _X_EXPORT void
|
---|
819 | RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output);
|
---|
820 |
|
---|
821 | extern _X_EXPORT void
|
---|
822 | RROutputDestroy (RROutputPtr output);
|
---|
823 |
|
---|
824 | extern _X_EXPORT int
|
---|
825 | ProcRRGetOutputInfo (ClientPtr client);
|
---|
826 |
|
---|
827 | extern _X_EXPORT int
|
---|
828 | ProcRRSetOutputPrimary (ClientPtr client);
|
---|
829 |
|
---|
830 | extern _X_EXPORT int
|
---|
831 | ProcRRGetOutputPrimary (ClientPtr client);
|
---|
832 |
|
---|
833 | /*
|
---|
834 | * Initialize output type
|
---|
835 | */
|
---|
836 | extern _X_EXPORT Bool
|
---|
837 | RROutputInit (void);
|
---|
838 |
|
---|
839 | /*
|
---|
840 | * Initialize output type error value
|
---|
841 | */
|
---|
842 | extern _X_EXPORT void
|
---|
843 | RROutputInitErrorValue (void);
|
---|
844 |
|
---|
845 | /* rrpointer.c */
|
---|
846 | extern _X_EXPORT void
|
---|
847 | RRPointerMoved (ScreenPtr pScreen, int x, int y);
|
---|
848 |
|
---|
849 | extern _X_EXPORT void
|
---|
850 | RRPointerScreenConfigured (ScreenPtr pScreen);
|
---|
851 |
|
---|
852 | /* rrproperty.c */
|
---|
853 |
|
---|
854 | extern _X_EXPORT void
|
---|
855 | RRDeleteAllOutputProperties (RROutputPtr output);
|
---|
856 |
|
---|
857 | extern _X_EXPORT RRPropertyValuePtr
|
---|
858 | RRGetOutputProperty (RROutputPtr output, Atom property, Bool pending);
|
---|
859 |
|
---|
860 | extern _X_EXPORT RRPropertyPtr
|
---|
861 | RRQueryOutputProperty (RROutputPtr output, Atom property);
|
---|
862 |
|
---|
863 | extern _X_EXPORT void
|
---|
864 | RRDeleteOutputProperty (RROutputPtr output, Atom property);
|
---|
865 |
|
---|
866 | extern _X_EXPORT Bool
|
---|
867 | RRPostPendingProperties (RROutputPtr output);
|
---|
868 |
|
---|
869 | extern _X_EXPORT int
|
---|
870 | RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type,
|
---|
871 | int format, int mode, unsigned long len,
|
---|
872 | pointer value, Bool sendevent, Bool pending);
|
---|
873 |
|
---|
874 | extern _X_EXPORT int
|
---|
875 | RRConfigureOutputProperty (RROutputPtr output, Atom property,
|
---|
876 | Bool pending, Bool range, Bool immutable,
|
---|
877 | int num_values, INT32 *values);
|
---|
878 | extern _X_EXPORT int
|
---|
879 | ProcRRChangeOutputProperty (ClientPtr client);
|
---|
880 |
|
---|
881 | extern _X_EXPORT int
|
---|
882 | ProcRRGetOutputProperty (ClientPtr client);
|
---|
883 |
|
---|
884 | extern _X_EXPORT int
|
---|
885 | ProcRRListOutputProperties (ClientPtr client);
|
---|
886 |
|
---|
887 | extern _X_EXPORT int
|
---|
888 | ProcRRQueryOutputProperty (ClientPtr client);
|
---|
889 |
|
---|
890 | extern _X_EXPORT int
|
---|
891 | ProcRRConfigureOutputProperty (ClientPtr client);
|
---|
892 |
|
---|
893 | extern _X_EXPORT int
|
---|
894 | ProcRRDeleteOutputProperty (ClientPtr client);
|
---|
895 |
|
---|
896 | /* rrxinerama.c */
|
---|
897 | #ifdef XINERAMA
|
---|
898 | extern _X_EXPORT void
|
---|
899 | RRXineramaExtensionInit(void);
|
---|
900 | #endif
|
---|
901 |
|
---|
902 | #endif /* _RANDRSTR_H_ */
|
---|
903 |
|
---|
904 | /*
|
---|
905 |
|
---|
906 | randr extension implementation structure
|
---|
907 |
|
---|
908 | Query state:
|
---|
909 | ProcRRGetScreenInfo/ProcRRGetScreenResources
|
---|
910 | RRGetInfo
|
---|
911 |
|
---|
912 | • Request configuration from driver, either 1.0 or 1.2 style
|
---|
913 | • These functions only record state changes, all
|
---|
914 | other actions are pended until RRTellChanged is called
|
---|
915 |
|
---|
916 | ->rrGetInfo
|
---|
917 | 1.0:
|
---|
918 | RRRegisterSize
|
---|
919 | RRRegisterRate
|
---|
920 | RRSetCurrentConfig
|
---|
921 | 1.2:
|
---|
922 | RRScreenSetSizeRange
|
---|
923 | RROutputSetCrtcs
|
---|
924 | RRModeGet
|
---|
925 | RROutputSetModes
|
---|
926 | RROutputSetConnection
|
---|
927 | RROutputSetSubpixelOrder
|
---|
928 | RROutputSetClones
|
---|
929 | RRCrtcNotify
|
---|
930 |
|
---|
931 | • Must delay scanning configuration until after ->rrGetInfo returns
|
---|
932 | because some drivers will call SetCurrentConfig in the middle
|
---|
933 | of the ->rrGetInfo operation.
|
---|
934 |
|
---|
935 | 1.0:
|
---|
936 |
|
---|
937 | • Scan old configuration, mirror to new structures
|
---|
938 |
|
---|
939 | RRScanOldConfig
|
---|
940 | RRCrtcCreate
|
---|
941 | RROutputCreate
|
---|
942 | RROutputSetCrtcs
|
---|
943 | RROutputSetConnection
|
---|
944 | RROutputSetSubpixelOrder
|
---|
945 | RROldModeAdd • This adds modes one-at-a-time
|
---|
946 | RRModeGet
|
---|
947 | RRCrtcNotify
|
---|
948 |
|
---|
949 | • send events, reset pointer if necessary
|
---|
950 |
|
---|
951 | RRTellChanged
|
---|
952 | WalkTree (sending events)
|
---|
953 |
|
---|
954 | • when layout has changed:
|
---|
955 | RRPointerScreenConfigured
|
---|
956 | RRSendConfigNotify
|
---|
957 |
|
---|
958 | Asynchronous state setting (1.2 only)
|
---|
959 | When setting state asynchronously, the driver invokes the
|
---|
960 | ->rrGetInfo function and then calls RRTellChanged to flush
|
---|
961 | the changes to the clients and reset pointer if necessary
|
---|
962 |
|
---|
963 | Set state
|
---|
964 |
|
---|
965 | ProcRRSetScreenConfig
|
---|
966 | RRCrtcSet
|
---|
967 | 1.2:
|
---|
968 | ->rrCrtcSet
|
---|
969 | RRCrtcNotify
|
---|
970 | 1.0:
|
---|
971 | ->rrSetConfig
|
---|
972 | RRCrtcNotify
|
---|
973 | RRTellChanged
|
---|
974 | */
|
---|