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