os: Add CryptoAPI as a choice of SHA1 implementation
[xserver/hramrach.git] / randr / randrstr.h
blob273885de7c32d8b9e369aeb1d4bb191f276509f9
1 /*
2 * Copyright © 2000 Compaq Computer Corporation
3 * Copyright © 2002 Hewlett-Packard Company
4 * Copyright © 2006 Intel Corporation
5 * Copyright © 2008 Red Hat, Inc.
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.
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.
25 * Author: Jim Gettys, Hewlett-Packard Company, Inc.
26 * Keith Packard, Intel Corporation
29 #ifdef HAVE_DIX_CONFIG_H
30 #include <dix-config.h>
31 #endif
33 #ifndef _RANDRSTR_H_
34 #define _RANDRSTR_H_
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>
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
60 #define RANDR_INTERFACE_VERSION 0x0103
62 typedef XID RRMode;
63 typedef XID RROutput;
64 typedef XID RRCrtc;
66 extern _X_EXPORT int RREventBase, RRErrorBase;
68 extern _X_EXPORT int (*ProcRandrVector[RRNumberRequests]) (ClientPtr);
69 extern _X_EXPORT int (*SProcRandrVector[RRNumberRequests]) (ClientPtr);
72 * Modeline for a monitor. Name follows directly after this struct
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;
82 struct _rrMode {
83 int refcnt;
84 xRRModeInfo mode;
85 char *name;
86 ScreenPtr userScreen;
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 */
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;
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;
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;
155 #if RANDR_12_INTERFACE
156 typedef Bool (*RRScreenSetSizeProcPtr) (ScreenPtr pScreen,
157 CARD16 width,
158 CARD16 height,
159 CARD32 mmWidth, CARD32 mmHeight);
161 typedef Bool (*RRCrtcSetProcPtr) (ScreenPtr pScreen,
162 RRCrtcPtr crtc,
163 RRModePtr mode,
164 int x,
165 int y,
166 Rotation rotation,
167 int numOutputs, RROutputPtr * outputs);
169 typedef Bool (*RRCrtcSetGammaProcPtr) (ScreenPtr pScreen, RRCrtcPtr crtc);
171 typedef Bool (*RRCrtcGetGammaProcPtr) (ScreenPtr pScreen, RRCrtcPtr crtc);
173 typedef Bool (*RROutputSetPropertyProcPtr) (ScreenPtr pScreen,
174 RROutputPtr output,
175 Atom property,
176 RRPropertyValuePtr value);
178 typedef Bool (*RROutputValidateModeProcPtr) (ScreenPtr pScreen,
179 RROutputPtr output,
180 RRModePtr mode);
182 typedef void (*RRModeDestroyProcPtr) (ScreenPtr pScreen, RRModePtr mode);
184 #endif
186 #if RANDR_13_INTERFACE
187 typedef Bool (*RROutputGetPropertyProcPtr) (ScreenPtr pScreen,
188 RROutputPtr output, Atom property);
189 typedef Bool (*RRGetPanningProcPtr) (ScreenPtr pScrn,
190 RRCrtcPtr crtc,
191 BoxPtr totalArea,
192 BoxPtr trackingArea, INT16 *border);
193 typedef Bool (*RRSetPanningProcPtr) (ScreenPtr pScrn,
194 RRCrtcPtr crtc,
195 BoxPtr totalArea,
196 BoxPtr trackingArea, INT16 *border);
198 #endif /* RANDR_13_INTERFACE */
200 typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation * rotations);
201 typedef Bool (*RRCloseScreenProcPtr) (int i, ScreenPtr pscreen);
203 /* These are for 1.0 compatibility */
205 typedef struct _rrRefresh {
206 CARD16 rate;
207 RRModePtr mode;
208 } RRScreenRate, *RRScreenRatePtr;
210 typedef struct _rrScreenSize {
211 int id;
212 short width, height;
213 short mmWidth, mmHeight;
214 int nRates;
215 RRScreenRatePtr pRates;
216 } RRScreenSize, *RRScreenSizePtr;
218 #ifdef RANDR_10_INTERFACE
220 typedef Bool (*RRSetConfigProcPtr) (ScreenPtr pScreen,
221 Rotation rotation,
222 int rate, RRScreenSizePtr pSize);
224 #endif
226 typedef struct _rrScrPriv {
228 * 'public' part of the structure; DDXen fill this in
229 * as they initialize
231 #if RANDR_10_INTERFACE
232 RRSetConfigProcPtr rrSetConfig;
233 #endif
234 RRGetInfoProcPtr rrGetInfo;
235 #if RANDR_12_INTERFACE
236 RRScreenSetSizeProcPtr rrScreenSetSize;
237 RRCrtcSetProcPtr rrCrtcSet;
238 RRCrtcSetGammaProcPtr rrCrtcSetGamma;
239 RRCrtcGetGammaProcPtr rrCrtcGetGamma;
240 RROutputSetPropertyProcPtr rrOutputSetProperty;
241 RROutputValidateModeProcPtr rrOutputValidateMode;
242 RRModeDestroyProcPtr rrModeDestroy;
243 #endif
244 #if RANDR_13_INTERFACE
245 RROutputGetPropertyProcPtr rrOutputGetProperty;
246 RRGetPanningProcPtr rrGetPanning;
247 RRSetPanningProcPtr rrSetPanning;
248 #endif
251 * Private part of the structure; not considered part of the ABI
253 TimeStamp lastSetTime; /* last changed by client */
254 TimeStamp lastConfigTime; /* possible configs changed */
255 RRCloseScreenProcPtr CloseScreen;
257 Bool changed; /* some config changed */
258 Bool configChanged; /* configuration changed */
259 Bool layoutChanged; /* screen layout changed */
261 CARD16 minWidth, minHeight;
262 CARD16 maxWidth, maxHeight;
263 CARD16 width, height; /* last known screen size */
264 CARD16 mmWidth, mmHeight; /* last known screen size */
266 int numOutputs;
267 RROutputPtr *outputs;
268 RROutputPtr primaryOutput;
270 int numCrtcs;
271 RRCrtcPtr *crtcs;
273 /* Last known pointer position */
274 RRCrtcPtr pointerCrtc;
276 #ifdef RANDR_10_INTERFACE
278 * Configuration information
280 Rotation rotations;
281 CARD16 reqWidth, reqHeight;
283 int nSizes;
284 RRScreenSizePtr pSizes;
286 Rotation rotation;
287 int rate;
288 int size;
289 #endif
290 Bool discontiguous;
291 } rrScrPrivRec, *rrScrPrivPtr;
293 extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec;
295 #define rrPrivKey (&rrPrivKeyRec)
297 #define rrGetScrPriv(pScr) ((rrScrPrivPtr)dixLookupPrivate(&(pScr)->devPrivates, rrPrivKey))
298 #define rrScrPriv(pScr) rrScrPrivPtr pScrPriv = rrGetScrPriv(pScr)
299 #define SetRRScreen(s,p) dixSetPrivate(&(s)->devPrivates, rrPrivKey, p)
302 * each window has a list of clients requesting
303 * RRNotify events. Each client has a resource
304 * for each window it selects RRNotify input for,
305 * this resource is used to delete the RRNotifyRec
306 * entry from the per-window queue.
309 typedef struct _RREvent *RREventPtr;
311 typedef struct _RREvent {
312 RREventPtr next;
313 ClientPtr client;
314 WindowPtr window;
315 XID clientResource;
316 int mask;
317 } RREventRec;
319 typedef struct _RRTimes {
320 TimeStamp setTime;
321 TimeStamp configTime;
322 } RRTimesRec, *RRTimesPtr;
324 typedef struct _RRClient {
325 int major_version;
326 int minor_version;
327 /* RRTimesRec times[0]; */
328 } RRClientRec, *RRClientPtr;
330 extern _X_EXPORT RESTYPE RRClientType, RREventType; /* resource types for event masks */
331 extern _X_EXPORT DevPrivateKeyRec RRClientPrivateKeyRec;
333 #define RRClientPrivateKey (&RRClientPrivateKeyRec)
334 extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType;
336 #define VERIFY_RR_OUTPUT(id, ptr, a)\
338 int rc = dixLookupResourceByType((pointer *)&(ptr), id,\
339 RROutputType, client, a);\
340 if (rc != Success) {\
341 client->errorValue = id;\
342 return rc;\
346 #define VERIFY_RR_CRTC(id, ptr, a)\
348 int rc = dixLookupResourceByType((pointer *)&(ptr), id,\
349 RRCrtcType, client, a);\
350 if (rc != Success) {\
351 client->errorValue = id;\
352 return rc;\
356 #define VERIFY_RR_MODE(id, ptr, a)\
358 int rc = dixLookupResourceByType((pointer *)&(ptr), id,\
359 RRModeType, client, a);\
360 if (rc != Success) {\
361 client->errorValue = id;\
362 return rc;\
366 #define GetRRClient(pClient) ((RRClientPtr)dixLookupPrivate(&(pClient)->devPrivates, RRClientPrivateKey))
367 #define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient)
369 /* Initialize the extension */
370 extern _X_EXPORT void
371 RRExtensionInit(void);
373 #ifdef RANDR_12_INTERFACE
375 * Set the range of sizes for the screen
377 extern _X_EXPORT void
379 RRScreenSetSizeRange(ScreenPtr pScreen,
380 CARD16 minWidth,
381 CARD16 minHeight, CARD16 maxWidth, CARD16 maxHeight);
382 #endif
384 /* rrscreen.c */
386 * Notify the extension that the screen size has been changed.
387 * The driver is responsible for calling this whenever it has changed
388 * the size of the screen
390 extern _X_EXPORT void
391 RRScreenSizeNotify(ScreenPtr pScreen);
394 * Request that the screen be resized
396 extern _X_EXPORT Bool
398 RRScreenSizeSet(ScreenPtr pScreen,
399 CARD16 width, CARD16 height, CARD32 mmWidth, CARD32 mmHeight);
402 * Send ConfigureNotify event to root window when 'something' happens
404 extern _X_EXPORT void
405 RRSendConfigNotify(ScreenPtr pScreen);
408 * screen dispatch
410 extern _X_EXPORT int
411 ProcRRGetScreenSizeRange(ClientPtr client);
413 extern _X_EXPORT int
414 ProcRRSetScreenSize(ClientPtr client);
416 extern _X_EXPORT int
417 ProcRRGetScreenResources(ClientPtr client);
419 extern _X_EXPORT int
420 ProcRRGetScreenResourcesCurrent(ClientPtr client);
422 extern _X_EXPORT int
423 ProcRRSetScreenConfig(ClientPtr client);
425 extern _X_EXPORT int
426 ProcRRGetScreenInfo(ClientPtr client);
429 * Deliver a ScreenNotify event
431 extern _X_EXPORT void
432 RRDeliverScreenEvent(ClientPtr client, WindowPtr pWin, ScreenPtr pScreen);
434 /* randr.c */
436 * Send all pending events
438 extern _X_EXPORT void
439 RRTellChanged(ScreenPtr pScreen);
442 * Poll the driver for changed information
444 extern _X_EXPORT Bool
445 RRGetInfo(ScreenPtr pScreen, Bool force_query);
447 extern _X_EXPORT Bool RRInit(void);
449 extern _X_EXPORT Bool RRScreenInit(ScreenPtr pScreen);
451 extern _X_EXPORT RROutputPtr RRFirstOutput(ScreenPtr pScreen);
453 extern _X_EXPORT CARD16
454 RRVerticalRefresh(xRRModeInfo * mode);
456 #ifdef RANDR_10_INTERFACE
458 * This is the old interface, deprecated but left
459 * around for compatibility
463 * Then, register the specific size with the screen
466 extern _X_EXPORT RRScreenSizePtr
467 RRRegisterSize(ScreenPtr pScreen,
468 short width, short height, short mmWidth, short mmHeight);
470 extern _X_EXPORT Bool
471 RRRegisterRate(ScreenPtr pScreen, RRScreenSizePtr pSize, int rate);
474 * Finally, set the current configuration of the screen
477 extern _X_EXPORT void
479 RRSetCurrentConfig(ScreenPtr pScreen,
480 Rotation rotation, int rate, RRScreenSizePtr pSize);
482 extern _X_EXPORT Rotation RRGetRotation(ScreenPtr pScreen);
484 #endif
486 /* rrcrtc.c */
489 * Notify the CRTC of some change; layoutChanged indicates that
490 * some position or size element changed
492 extern _X_EXPORT void
493 RRCrtcChanged(RRCrtcPtr crtc, Bool layoutChanged);
496 * Create a CRTC
498 extern _X_EXPORT RRCrtcPtr RRCrtcCreate(ScreenPtr pScreen, void *devPrivate);
501 * Set the allowed rotations on a CRTC
503 extern _X_EXPORT void
504 RRCrtcSetRotations(RRCrtcPtr crtc, Rotation rotations);
507 * Set whether transforms are allowed on a CRTC
509 extern _X_EXPORT void
510 RRCrtcSetTransformSupport(RRCrtcPtr crtc, Bool transforms);
513 * Notify the extension that the Crtc has been reconfigured,
514 * the driver calls this whenever it has updated the mode
516 extern _X_EXPORT Bool
518 RRCrtcNotify(RRCrtcPtr crtc,
519 RRModePtr mode,
520 int x,
521 int y,
522 Rotation rotation,
523 RRTransformPtr transform, int numOutputs, RROutputPtr * outputs);
525 extern _X_EXPORT void
526 RRDeliverCrtcEvent(ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc);
529 * Request that the Crtc be reconfigured
531 extern _X_EXPORT Bool
533 RRCrtcSet(RRCrtcPtr crtc,
534 RRModePtr mode,
535 int x,
536 int y, Rotation rotation, int numOutput, RROutputPtr * outputs);
539 * Request that the Crtc gamma be changed
542 extern _X_EXPORT Bool
543 RRCrtcGammaSet(RRCrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue);
546 * Request current gamma back from the DDX (if possible).
547 * This includes gamma size.
550 extern _X_EXPORT Bool
551 RRCrtcGammaGet(RRCrtcPtr crtc);
554 * Notify the extension that the Crtc gamma has been changed
555 * The driver calls this whenever it has changed the gamma values
556 * in the RRCrtcRec
559 extern _X_EXPORT Bool
560 RRCrtcGammaNotify(RRCrtcPtr crtc);
563 * Set the size of the gamma table at server startup time
566 extern _X_EXPORT Bool
567 RRCrtcGammaSetSize(RRCrtcPtr crtc, int size);
570 * Return the area of the frame buffer scanned out by the crtc,
571 * taking into account the current mode and rotation
574 extern _X_EXPORT void
575 RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height);
578 * Compute the complete transformation matrix including
579 * client-specified transform, rotation/reflection values and the crtc
580 * offset.
582 * Return TRUE if the resulting transform is not a simple translation.
584 extern _X_EXPORT Bool
586 RRTransformCompute(int x,
587 int y,
588 int width,
589 int height,
590 Rotation rotation,
591 RRTransformPtr rr_transform,
592 PictTransformPtr transform,
593 struct pict_f_transform *f_transform,
594 struct pict_f_transform *f_inverse);
597 * Return crtc transform
599 extern _X_EXPORT RRTransformPtr RRCrtcGetTransform(RRCrtcPtr crtc);
602 * Check whether the pending and current transforms are the same
604 extern _X_EXPORT Bool
605 RRCrtcPendingTransform(RRCrtcPtr crtc);
608 * Destroy a Crtc at shutdown
610 extern _X_EXPORT void
611 RRCrtcDestroy(RRCrtcPtr crtc);
614 * Set the pending CRTC transformation
617 extern _X_EXPORT int
619 RRCrtcTransformSet(RRCrtcPtr crtc,
620 PictTransformPtr transform,
621 struct pict_f_transform *f_transform,
622 struct pict_f_transform *f_inverse,
623 char *filter, int filter_len, xFixed * params, int nparams);
626 * Initialize crtc type
628 extern _X_EXPORT Bool
629 RRCrtcInit(void);
632 * Initialize crtc type error value
634 extern _X_EXPORT void
635 RRCrtcInitErrorValue(void);
638 * Crtc dispatch
641 extern _X_EXPORT int
642 ProcRRGetCrtcInfo(ClientPtr client);
644 extern _X_EXPORT int
645 ProcRRSetCrtcConfig(ClientPtr client);
647 extern _X_EXPORT int
648 ProcRRGetCrtcGammaSize(ClientPtr client);
650 extern _X_EXPORT int
651 ProcRRGetCrtcGamma(ClientPtr client);
653 extern _X_EXPORT int
654 ProcRRSetCrtcGamma(ClientPtr client);
656 extern _X_EXPORT int
657 ProcRRSetCrtcTransform(ClientPtr client);
659 extern _X_EXPORT int
660 ProcRRGetCrtcTransform(ClientPtr client);
663 ProcRRGetPanning(ClientPtr client);
666 ProcRRSetPanning(ClientPtr client);
668 void
669 RRConstrainCursorHarder(DeviceIntPtr, ScreenPtr, int, int *, int *);
671 /* rrdispatch.c */
672 extern _X_EXPORT Bool
673 RRClientKnowsRates(ClientPtr pClient);
675 /* rrmode.c */
677 * Find, and if necessary, create a mode
680 extern _X_EXPORT RRModePtr RRModeGet(xRRModeInfo * modeInfo, const char *name);
683 * Destroy a mode.
686 extern _X_EXPORT void
687 RRModeDestroy(RRModePtr mode);
690 * Return a list of modes that are valid for some output in pScreen
692 extern _X_EXPORT RRModePtr *RRModesForScreen(ScreenPtr pScreen, int *num_ret);
695 * Initialize mode type
697 extern _X_EXPORT Bool
698 RRModeInit(void);
701 * Initialize mode type error value
703 extern _X_EXPORT void
704 RRModeInitErrorValue(void);
706 extern _X_EXPORT int
707 ProcRRCreateMode(ClientPtr client);
709 extern _X_EXPORT int
710 ProcRRDestroyMode(ClientPtr client);
712 extern _X_EXPORT int
713 ProcRRAddOutputMode(ClientPtr client);
715 extern _X_EXPORT int
716 ProcRRDeleteOutputMode(ClientPtr client);
718 /* rroutput.c */
721 * Notify the output of some change. configChanged indicates whether
722 * any external configuration (mode list, clones, connected status)
723 * has changed, or whether the change was strictly internal
724 * (which crtc is in use)
726 extern _X_EXPORT void
727 RROutputChanged(RROutputPtr output, Bool configChanged);
730 * Create an output
733 extern _X_EXPORT RROutputPtr
734 RROutputCreate(ScreenPtr pScreen,
735 const char *name, int nameLength, void *devPrivate);
738 * Notify extension that output parameters have been changed
740 extern _X_EXPORT Bool
741 RROutputSetClones(RROutputPtr output, RROutputPtr * clones, int numClones);
743 extern _X_EXPORT Bool
745 RROutputSetModes(RROutputPtr output,
746 RRModePtr * modes, int numModes, int numPreferred);
748 extern _X_EXPORT int
749 RROutputAddUserMode(RROutputPtr output, RRModePtr mode);
751 extern _X_EXPORT int
752 RROutputDeleteUserMode(RROutputPtr output, RRModePtr mode);
754 extern _X_EXPORT Bool
755 RROutputSetCrtcs(RROutputPtr output, RRCrtcPtr * crtcs, int numCrtcs);
757 extern _X_EXPORT Bool
758 RROutputSetConnection(RROutputPtr output, CARD8 connection);
760 extern _X_EXPORT Bool
761 RROutputSetSubpixelOrder(RROutputPtr output, int subpixelOrder);
763 extern _X_EXPORT Bool
764 RROutputSetPhysicalSize(RROutputPtr output, int mmWidth, int mmHeight);
766 extern _X_EXPORT void
767 RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output);
769 extern _X_EXPORT void
770 RROutputDestroy(RROutputPtr output);
772 extern _X_EXPORT int
773 ProcRRGetOutputInfo(ClientPtr client);
775 extern _X_EXPORT int
776 ProcRRSetOutputPrimary(ClientPtr client);
778 extern _X_EXPORT int
779 ProcRRGetOutputPrimary(ClientPtr client);
782 * Initialize output type
784 extern _X_EXPORT Bool
785 RROutputInit(void);
788 * Initialize output type error value
790 extern _X_EXPORT void
791 RROutputInitErrorValue(void);
793 /* rrpointer.c */
794 extern _X_EXPORT void
795 RRPointerMoved(ScreenPtr pScreen, int x, int y);
797 extern _X_EXPORT void
798 RRPointerScreenConfigured(ScreenPtr pScreen);
800 /* rrproperty.c */
802 extern _X_EXPORT void
803 RRDeleteAllOutputProperties(RROutputPtr output);
805 extern _X_EXPORT RRPropertyValuePtr
806 RRGetOutputProperty(RROutputPtr output, Atom property, Bool pending);
808 extern _X_EXPORT RRPropertyPtr
809 RRQueryOutputProperty(RROutputPtr output, Atom property);
811 extern _X_EXPORT void
812 RRDeleteOutputProperty(RROutputPtr output, Atom property);
814 extern _X_EXPORT Bool
815 RRPostPendingProperties(RROutputPtr output);
817 extern _X_EXPORT int
819 RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
820 int format, int mode, unsigned long len,
821 pointer value, Bool sendevent, Bool pending);
823 extern _X_EXPORT int
825 RRConfigureOutputProperty(RROutputPtr output, Atom property,
826 Bool pending, Bool range, Bool immutable,
827 int num_values, INT32 *values);
828 extern _X_EXPORT int
829 ProcRRChangeOutputProperty(ClientPtr client);
831 extern _X_EXPORT int
832 ProcRRGetOutputProperty(ClientPtr client);
834 extern _X_EXPORT int
835 ProcRRListOutputProperties(ClientPtr client);
837 extern _X_EXPORT int
838 ProcRRQueryOutputProperty(ClientPtr client);
840 extern _X_EXPORT int
841 ProcRRConfigureOutputProperty(ClientPtr client);
843 extern _X_EXPORT int
844 ProcRRDeleteOutputProperty(ClientPtr client);
846 /* rrxinerama.c */
847 #ifdef XINERAMA
848 extern _X_EXPORT void
849 RRXineramaExtensionInit(void);
850 #endif
852 #endif /* _RANDRSTR_H_ */
856 randr extension implementation structure
858 Query state:
859 ProcRRGetScreenInfo/ProcRRGetScreenResources
860 RRGetInfo
862 • Request configuration from driver, either 1.0 or 1.2 style
863 • These functions only record state changes, all
864 other actions are pended until RRTellChanged is called
866 ->rrGetInfo
867 1.0:
868 RRRegisterSize
869 RRRegisterRate
870 RRSetCurrentConfig
871 1.2:
872 RRScreenSetSizeRange
873 RROutputSetCrtcs
874 RRModeGet
875 RROutputSetModes
876 RROutputSetConnection
877 RROutputSetSubpixelOrder
878 RROutputSetClones
879 RRCrtcNotify
881 • Must delay scanning configuration until after ->rrGetInfo returns
882 because some drivers will call SetCurrentConfig in the middle
883 of the ->rrGetInfo operation.
885 1.0:
887 • Scan old configuration, mirror to new structures
889 RRScanOldConfig
890 RRCrtcCreate
891 RROutputCreate
892 RROutputSetCrtcs
893 RROutputSetConnection
894 RROutputSetSubpixelOrder
895 RROldModeAdd • This adds modes one-at-a-time
896 RRModeGet
897 RRCrtcNotify
899 • send events, reset pointer if necessary
901 RRTellChanged
902 WalkTree (sending events)
904 • when layout has changed:
905 RRPointerScreenConfigured
906 RRSendConfigNotify
908 Asynchronous state setting (1.2 only)
909 When setting state asynchronously, the driver invokes the
910 ->rrGetInfo function and then calls RRTellChanged to flush
911 the changes to the clients and reset pointer if necessary
913 Set state
915 ProcRRSetScreenConfig
916 RRCrtcSet
917 1.2:
918 ->rrCrtcSet
919 RRCrtcNotify
920 1.0:
921 ->rrSetConfig
922 RRCrtcNotify
923 RRTellChanged