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
25 * Author: Jim Gettys, Hewlett-Packard Company, Inc.
26 * Keith Packard, Intel Corporation
29 #ifdef HAVE_DIX_CONFIG_H
30 #include <dix-config.h>
37 #include <X11/Xproto.h>
40 #include "dixstruct.h"
42 #include "scrnintstr.h"
43 #include "windowstr.h"
44 #include "pixmapstr.h"
45 #include "extnsionst.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 0x0104
65 typedef XID RRProvider
;
67 extern _X_EXPORT
int RREventBase
, RRErrorBase
;
69 extern _X_EXPORT
int (*ProcRandrVector
[RRNumberRequests
]) (ClientPtr
);
70 extern _X_EXPORT
int (*SProcRandrVector
[RRNumberRequests
]) (ClientPtr
);
73 * Modeline for a monitor. Name follows directly after this struct
76 #define RRModeName(pMode) ((char *) (pMode + 1))
77 typedef struct _rrMode RRModeRec
, *RRModePtr
;
78 typedef struct _rrPropertyValue RRPropertyValueRec
, *RRPropertyValuePtr
;
79 typedef struct _rrProperty RRPropertyRec
, *RRPropertyPtr
;
80 typedef struct _rrCrtc RRCrtcRec
, *RRCrtcPtr
;
81 typedef struct _rrOutput RROutputRec
, *RROutputPtr
;
82 typedef struct _rrProvider RRProviderRec
, *RRProviderPtr
;
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 */
106 RRPropertyValueRec current
, pending
;
118 RROutputPtr
*outputs
;
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
;
131 PixmapPtr scanout_pixmap
;
152 RRModePtr
*userModes
;
154 RRPropertyPtr properties
;
155 Bool pendingProperties
;
162 uint32_t capabilities
;
165 RRPropertyPtr properties
;
166 Bool pendingProperties
;
168 struct _rrProvider
*offload_sink
;
169 struct _rrProvider
*output_source
;
172 #if RANDR_12_INTERFACE
173 typedef Bool (*RRScreenSetSizeProcPtr
) (ScreenPtr pScreen
,
176 CARD32 mmWidth
, CARD32 mmHeight
);
178 typedef Bool (*RRCrtcSetProcPtr
) (ScreenPtr pScreen
,
184 int numOutputs
, RROutputPtr
* outputs
);
186 typedef Bool (*RRCrtcSetGammaProcPtr
) (ScreenPtr pScreen
, RRCrtcPtr crtc
);
188 typedef Bool (*RRCrtcGetGammaProcPtr
) (ScreenPtr pScreen
, RRCrtcPtr crtc
);
190 typedef Bool (*RROutputSetPropertyProcPtr
) (ScreenPtr pScreen
,
193 RRPropertyValuePtr value
);
195 typedef Bool (*RROutputValidateModeProcPtr
) (ScreenPtr pScreen
,
199 typedef void (*RRModeDestroyProcPtr
) (ScreenPtr pScreen
, RRModePtr mode
);
203 #if RANDR_13_INTERFACE
204 typedef Bool (*RROutputGetPropertyProcPtr
) (ScreenPtr pScreen
,
205 RROutputPtr output
, Atom property
);
206 typedef Bool (*RRGetPanningProcPtr
) (ScreenPtr pScrn
,
209 BoxPtr trackingArea
, INT16
*border
);
210 typedef Bool (*RRSetPanningProcPtr
) (ScreenPtr pScrn
,
213 BoxPtr trackingArea
, INT16
*border
);
215 #endif /* RANDR_13_INTERFACE */
217 typedef Bool (*RRProviderGetPropertyProcPtr
) (ScreenPtr pScreen
,
218 RRProviderPtr provider
, Atom property
);
219 typedef Bool (*RRProviderSetPropertyProcPtr
) (ScreenPtr pScreen
,
220 RRProviderPtr provider
,
222 RRPropertyValuePtr value
);
224 typedef Bool (*RRGetInfoProcPtr
) (ScreenPtr pScreen
, Rotation
* rotations
);
225 typedef Bool (*RRCloseScreenProcPtr
) (ScreenPtr pscreen
);
227 typedef Bool (*RRProviderSetOutputSourceProcPtr
)(ScreenPtr pScreen
,
228 RRProviderPtr provider
,
229 RRProviderPtr output_source
);
231 typedef Bool (*RRProviderSetOffloadSinkProcPtr
)(ScreenPtr pScreen
,
232 RRProviderPtr provider
,
233 RRProviderPtr offload_sink
);
236 typedef void (*RRProviderDestroyProcPtr
)(ScreenPtr pScreen
,
237 RRProviderPtr provider
);
239 /* These are for 1.0 compatibility */
241 typedef struct _rrRefresh
{
244 } RRScreenRate
, *RRScreenRatePtr
;
246 typedef struct _rrScreenSize
{
249 short mmWidth
, mmHeight
;
251 RRScreenRatePtr pRates
;
252 } RRScreenSize
, *RRScreenSizePtr
;
254 #ifdef RANDR_10_INTERFACE
256 typedef Bool (*RRSetConfigProcPtr
) (ScreenPtr pScreen
,
258 int rate
, RRScreenSizePtr pSize
);
262 typedef Bool (*RRCrtcSetScanoutPixmapProcPtr
)(RRCrtcPtr crtc
, PixmapPtr pixmap
);
264 typedef struct _rrScrPriv
{
266 * 'public' part of the structure; DDXen fill this in
269 #if RANDR_10_INTERFACE
270 RRSetConfigProcPtr rrSetConfig
;
272 RRGetInfoProcPtr rrGetInfo
;
273 #if RANDR_12_INTERFACE
274 RRScreenSetSizeProcPtr rrScreenSetSize
;
275 RRCrtcSetProcPtr rrCrtcSet
;
276 RRCrtcSetGammaProcPtr rrCrtcSetGamma
;
277 RRCrtcGetGammaProcPtr rrCrtcGetGamma
;
278 RROutputSetPropertyProcPtr rrOutputSetProperty
;
279 RROutputValidateModeProcPtr rrOutputValidateMode
;
280 RRModeDestroyProcPtr rrModeDestroy
;
282 #if RANDR_13_INTERFACE
283 RROutputGetPropertyProcPtr rrOutputGetProperty
;
284 RRGetPanningProcPtr rrGetPanning
;
285 RRSetPanningProcPtr rrSetPanning
;
287 /* TODO #if RANDR_15_INTERFACE */
288 RRCrtcSetScanoutPixmapProcPtr rrCrtcSetScanoutPixmap
;
290 RRProviderSetOutputSourceProcPtr rrProviderSetOutputSource
;
291 RRProviderSetOffloadSinkProcPtr rrProviderSetOffloadSink
;
292 RRProviderGetPropertyProcPtr rrProviderGetProperty
;
293 RRProviderSetPropertyProcPtr rrProviderSetProperty
;
295 * Private part of the structure; not considered part of the ABI
297 TimeStamp lastSetTime
; /* last changed by client */
298 TimeStamp lastConfigTime
; /* possible configs changed */
299 RRCloseScreenProcPtr CloseScreen
;
301 Bool changed
; /* some config changed */
302 Bool configChanged
; /* configuration changed */
303 Bool layoutChanged
; /* screen layout changed */
304 Bool resourcesChanged
; /* screen resources change */
306 CARD16 minWidth
, minHeight
;
307 CARD16 maxWidth
, maxHeight
;
308 CARD16 width
, height
; /* last known screen size */
309 CARD16 mmWidth
, mmHeight
; /* last known screen size */
312 RROutputPtr
*outputs
;
313 RROutputPtr primaryOutput
;
318 /* Last known pointer position */
319 RRCrtcPtr pointerCrtc
;
321 #ifdef RANDR_10_INTERFACE
323 * Configuration information
326 CARD16 reqWidth
, reqHeight
;
329 RRScreenSizePtr pSizes
;
337 RRProviderPtr provider
;
339 RRProviderDestroyProcPtr rrProviderDestroy
;
341 } rrScrPrivRec
, *rrScrPrivPtr
;
343 extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec
;
345 #define rrPrivKey (&rrPrivKeyRec)
347 #define rrGetScrPriv(pScr) ((rrScrPrivPtr)dixLookupPrivate(&(pScr)->devPrivates, rrPrivKey))
348 #define rrScrPriv(pScr) rrScrPrivPtr pScrPriv = rrGetScrPriv(pScr)
349 #define SetRRScreen(s,p) dixSetPrivate(&(s)->devPrivates, rrPrivKey, p)
352 * each window has a list of clients requesting
353 * RRNotify events. Each client has a resource
354 * for each window it selects RRNotify input for,
355 * this resource is used to delete the RRNotifyRec
356 * entry from the per-window queue.
359 typedef struct _RREvent
*RREventPtr
;
361 typedef struct _RREvent
{
369 typedef struct _RRTimes
{
371 TimeStamp configTime
;
372 } RRTimesRec
, *RRTimesPtr
;
374 typedef struct _RRClient
{
377 /* RRTimesRec times[0]; */
378 } RRClientRec
, *RRClientPtr
;
380 extern _X_EXPORT RESTYPE RRClientType
, RREventType
; /* resource types for event masks */
381 extern _X_EXPORT DevPrivateKeyRec RRClientPrivateKeyRec
;
383 #define RRClientPrivateKey (&RRClientPrivateKeyRec)
384 extern _X_EXPORT RESTYPE RRCrtcType
, RRModeType
, RROutputType
, RRProviderType
;
386 #define VERIFY_RR_OUTPUT(id, ptr, a)\
388 int rc = dixLookupResourceByType((pointer *)&(ptr), id,\
389 RROutputType, client, a);\
390 if (rc != Success) {\
391 client->errorValue = id;\
396 #define VERIFY_RR_CRTC(id, ptr, a)\
398 int rc = dixLookupResourceByType((pointer *)&(ptr), id,\
399 RRCrtcType, client, a);\
400 if (rc != Success) {\
401 client->errorValue = id;\
406 #define VERIFY_RR_MODE(id, ptr, a)\
408 int rc = dixLookupResourceByType((pointer *)&(ptr), id,\
409 RRModeType, client, a);\
410 if (rc != Success) {\
411 client->errorValue = id;\
416 #define VERIFY_RR_PROVIDER(id, ptr, a)\
418 int rc = dixLookupResourceByType((pointer *)&(ptr), id,\
419 RRProviderType, client, a);\
420 if (rc != Success) {\
421 client->errorValue = id;\
426 #define GetRRClient(pClient) ((RRClientPtr)dixLookupPrivate(&(pClient)->devPrivates, RRClientPrivateKey))
427 #define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient)
429 #ifdef RANDR_12_INTERFACE
431 * Set the range of sizes for the screen
433 extern _X_EXPORT
void
435 RRScreenSetSizeRange(ScreenPtr pScreen
,
437 CARD16 minHeight
, CARD16 maxWidth
, CARD16 maxHeight
);
442 * Notify the extension that the screen size has been changed.
443 * The driver is responsible for calling this whenever it has changed
444 * the size of the screen
446 extern _X_EXPORT
void
447 RRScreenSizeNotify(ScreenPtr pScreen
);
450 * Request that the screen be resized
452 extern _X_EXPORT Bool
454 RRScreenSizeSet(ScreenPtr pScreen
,
455 CARD16 width
, CARD16 height
, CARD32 mmWidth
, CARD32 mmHeight
);
458 * Send ConfigureNotify event to root window when 'something' happens
460 extern _X_EXPORT
void
461 RRSendConfigNotify(ScreenPtr pScreen
);
467 ProcRRGetScreenSizeRange(ClientPtr client
);
470 ProcRRSetScreenSize(ClientPtr client
);
473 ProcRRGetScreenResources(ClientPtr client
);
476 ProcRRGetScreenResourcesCurrent(ClientPtr client
);
479 ProcRRSetScreenConfig(ClientPtr client
);
482 ProcRRGetScreenInfo(ClientPtr client
);
485 * Deliver a ScreenNotify event
487 extern _X_EXPORT
void
488 RRDeliverScreenEvent(ClientPtr client
, WindowPtr pWin
, ScreenPtr pScreen
);
490 extern _X_EXPORT
void
491 RRResourcesChanged(ScreenPtr pScreen
);
494 /* set a screen change on the primary screen */
495 extern _X_EXPORT
void
496 RRSetChanged(ScreenPtr pScreen
);
499 * Send all pending events
501 extern _X_EXPORT
void
502 RRTellChanged(ScreenPtr pScreen
);
505 * Poll the driver for changed information
507 extern _X_EXPORT Bool
508 RRGetInfo(ScreenPtr pScreen
, Bool force_query
);
510 extern _X_EXPORT Bool
RRInit(void);
512 extern _X_EXPORT Bool
RRScreenInit(ScreenPtr pScreen
);
514 extern _X_EXPORT RROutputPtr
RRFirstOutput(ScreenPtr pScreen
);
516 extern _X_EXPORT CARD16
517 RRVerticalRefresh(xRRModeInfo
* mode
);
519 #ifdef RANDR_10_INTERFACE
521 * This is the old interface, deprecated but left
522 * around for compatibility
526 * Then, register the specific size with the screen
529 extern _X_EXPORT RRScreenSizePtr
530 RRRegisterSize(ScreenPtr pScreen
,
531 short width
, short height
, short mmWidth
, short mmHeight
);
533 extern _X_EXPORT Bool
534 RRRegisterRate(ScreenPtr pScreen
, RRScreenSizePtr pSize
, int rate
);
537 * Finally, set the current configuration of the screen
540 extern _X_EXPORT
void
542 RRSetCurrentConfig(ScreenPtr pScreen
,
543 Rotation rotation
, int rate
, RRScreenSizePtr pSize
);
545 extern _X_EXPORT Rotation
RRGetRotation(ScreenPtr pScreen
);
552 * Notify the CRTC of some change; layoutChanged indicates that
553 * some position or size element changed
555 extern _X_EXPORT
void
556 RRCrtcChanged(RRCrtcPtr crtc
, Bool layoutChanged
);
561 extern _X_EXPORT RRCrtcPtr
RRCrtcCreate(ScreenPtr pScreen
, void *devPrivate
);
564 * Set the allowed rotations on a CRTC
566 extern _X_EXPORT
void
567 RRCrtcSetRotations(RRCrtcPtr crtc
, Rotation rotations
);
570 * Set whether transforms are allowed on a CRTC
572 extern _X_EXPORT
void
573 RRCrtcSetTransformSupport(RRCrtcPtr crtc
, Bool transforms
);
576 * Notify the extension that the Crtc has been reconfigured,
577 * the driver calls this whenever it has updated the mode
579 extern _X_EXPORT Bool
581 RRCrtcNotify(RRCrtcPtr crtc
,
586 RRTransformPtr transform
, int numOutputs
, RROutputPtr
* outputs
);
588 extern _X_EXPORT
void
589 RRDeliverCrtcEvent(ClientPtr client
, WindowPtr pWin
, RRCrtcPtr crtc
);
592 * Request that the Crtc be reconfigured
594 extern _X_EXPORT Bool
596 RRCrtcSet(RRCrtcPtr crtc
,
599 int y
, Rotation rotation
, int numOutput
, RROutputPtr
* outputs
);
602 * Request that the Crtc gamma be changed
605 extern _X_EXPORT Bool
606 RRCrtcGammaSet(RRCrtcPtr crtc
, CARD16
*red
, CARD16
*green
, CARD16
*blue
);
609 * Request current gamma back from the DDX (if possible).
610 * This includes gamma size.
613 extern _X_EXPORT Bool
614 RRCrtcGammaGet(RRCrtcPtr crtc
);
617 * Notify the extension that the Crtc gamma has been changed
618 * The driver calls this whenever it has changed the gamma values
622 extern _X_EXPORT Bool
623 RRCrtcGammaNotify(RRCrtcPtr crtc
);
626 * Set the size of the gamma table at server startup time
629 extern _X_EXPORT Bool
630 RRCrtcGammaSetSize(RRCrtcPtr crtc
, int size
);
633 * Return the area of the frame buffer scanned out by the crtc,
634 * taking into account the current mode and rotation
637 extern _X_EXPORT
void
638 RRCrtcGetScanoutSize(RRCrtcPtr crtc
, int *width
, int *height
);
641 * Return crtc transform
643 extern _X_EXPORT RRTransformPtr
RRCrtcGetTransform(RRCrtcPtr crtc
);
646 * Check whether the pending and current transforms are the same
648 extern _X_EXPORT Bool
649 RRCrtcPendingTransform(RRCrtcPtr crtc
);
652 * Destroy a Crtc at shutdown
654 extern _X_EXPORT
void
655 RRCrtcDestroy(RRCrtcPtr crtc
);
658 * Set the pending CRTC transformation
663 RRCrtcTransformSet(RRCrtcPtr crtc
,
664 PictTransformPtr transform
,
665 struct pict_f_transform
*f_transform
,
666 struct pict_f_transform
*f_inverse
,
667 char *filter
, int filter_len
, xFixed
* params
, int nparams
);
670 * Initialize crtc type
672 extern _X_EXPORT Bool
676 * Initialize crtc type error value
678 extern _X_EXPORT
void
679 RRCrtcInitErrorValue(void);
682 * Detach and free a scanout pixmap
684 extern _X_EXPORT
void
685 RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc
);
687 extern _X_EXPORT Bool
688 RRReplaceScanoutPixmap(DrawablePtr pDrawable
, PixmapPtr pPixmap
, Bool enable
);
695 ProcRRGetCrtcInfo(ClientPtr client
);
698 ProcRRSetCrtcConfig(ClientPtr client
);
701 ProcRRGetCrtcGammaSize(ClientPtr client
);
704 ProcRRGetCrtcGamma(ClientPtr client
);
707 ProcRRSetCrtcGamma(ClientPtr client
);
710 ProcRRSetCrtcTransform(ClientPtr client
);
713 ProcRRGetCrtcTransform(ClientPtr client
);
716 ProcRRGetPanning(ClientPtr client
);
719 ProcRRSetPanning(ClientPtr client
);
722 RRConstrainCursorHarder(DeviceIntPtr
, ScreenPtr
, int, int *, int *);
725 extern _X_EXPORT Bool
726 RRClientKnowsRates(ClientPtr pClient
);
730 * Find, and if necessary, create a mode
733 extern _X_EXPORT RRModePtr
RRModeGet(xRRModeInfo
* modeInfo
, const char *name
);
739 extern _X_EXPORT
void
740 RRModeDestroy(RRModePtr mode
);
743 * Return a list of modes that are valid for some output in pScreen
745 extern _X_EXPORT RRModePtr
*RRModesForScreen(ScreenPtr pScreen
, int *num_ret
);
748 * Initialize mode type
750 extern _X_EXPORT Bool
754 * Initialize mode type error value
756 extern _X_EXPORT
void
757 RRModeInitErrorValue(void);
760 ProcRRCreateMode(ClientPtr client
);
763 ProcRRDestroyMode(ClientPtr client
);
766 ProcRRAddOutputMode(ClientPtr client
);
769 ProcRRDeleteOutputMode(ClientPtr client
);
774 * Notify the output of some change. configChanged indicates whether
775 * any external configuration (mode list, clones, connected status)
776 * has changed, or whether the change was strictly internal
777 * (which crtc is in use)
779 extern _X_EXPORT
void
780 RROutputChanged(RROutputPtr output
, Bool configChanged
);
786 extern _X_EXPORT RROutputPtr
787 RROutputCreate(ScreenPtr pScreen
,
788 const char *name
, int nameLength
, void *devPrivate
);
791 * Notify extension that output parameters have been changed
793 extern _X_EXPORT Bool
794 RROutputSetClones(RROutputPtr output
, RROutputPtr
* clones
, int numClones
);
796 extern _X_EXPORT Bool
798 RROutputSetModes(RROutputPtr output
,
799 RRModePtr
* modes
, int numModes
, int numPreferred
);
802 RROutputAddUserMode(RROutputPtr output
, RRModePtr mode
);
805 RROutputDeleteUserMode(RROutputPtr output
, RRModePtr mode
);
807 extern _X_EXPORT Bool
808 RROutputSetCrtcs(RROutputPtr output
, RRCrtcPtr
* crtcs
, int numCrtcs
);
810 extern _X_EXPORT Bool
811 RROutputSetConnection(RROutputPtr output
, CARD8 connection
);
813 extern _X_EXPORT Bool
814 RROutputSetSubpixelOrder(RROutputPtr output
, int subpixelOrder
);
816 extern _X_EXPORT Bool
817 RROutputSetPhysicalSize(RROutputPtr output
, int mmWidth
, int mmHeight
);
819 extern _X_EXPORT
void
820 RRDeliverOutputEvent(ClientPtr client
, WindowPtr pWin
, RROutputPtr output
);
822 extern _X_EXPORT
void
823 RROutputDestroy(RROutputPtr output
);
826 ProcRRGetOutputInfo(ClientPtr client
);
829 ProcRRSetOutputPrimary(ClientPtr client
);
832 ProcRRGetOutputPrimary(ClientPtr client
);
835 * Initialize output type
837 extern _X_EXPORT Bool
841 * Initialize output type error value
843 extern _X_EXPORT
void
844 RROutputInitErrorValue(void);
847 extern _X_EXPORT
void
848 RRPointerMoved(ScreenPtr pScreen
, int x
, int y
);
850 extern _X_EXPORT
void
851 RRPointerScreenConfigured(ScreenPtr pScreen
);
855 extern _X_EXPORT
void
856 RRDeleteAllOutputProperties(RROutputPtr output
);
858 extern _X_EXPORT RRPropertyValuePtr
859 RRGetOutputProperty(RROutputPtr output
, Atom property
, Bool pending
);
861 extern _X_EXPORT RRPropertyPtr
862 RRQueryOutputProperty(RROutputPtr output
, Atom property
);
864 extern _X_EXPORT
void
865 RRDeleteOutputProperty(RROutputPtr output
, Atom property
);
867 extern _X_EXPORT Bool
868 RRPostPendingProperties(RROutputPtr output
);
872 RRChangeOutputProperty(RROutputPtr output
, Atom property
, Atom type
,
873 int format
, int mode
, unsigned long len
,
874 pointer value
, Bool sendevent
, Bool pending
);
878 RRConfigureOutputProperty(RROutputPtr output
, Atom property
,
879 Bool pending
, Bool range
, Bool immutable
,
880 int num_values
, INT32
*values
);
882 ProcRRChangeOutputProperty(ClientPtr client
);
885 ProcRRGetOutputProperty(ClientPtr client
);
888 ProcRRListOutputProperties(ClientPtr client
);
891 ProcRRQueryOutputProperty(ClientPtr client
);
894 ProcRRConfigureOutputProperty(ClientPtr client
);
897 ProcRRDeleteOutputProperty(ClientPtr client
);
900 extern _X_EXPORT
void
901 RRProviderInitErrorValue(void);
904 ProcRRGetProviders(ClientPtr client
);
907 ProcRRGetProviderInfo(ClientPtr client
);
910 ProcRRSetProviderOutputSource(ClientPtr client
);
913 ProcRRSetProviderOffloadSink(ClientPtr client
);
915 extern _X_EXPORT Bool
916 RRProviderInit(void);
918 extern _X_EXPORT RRProviderPtr
919 RRProviderCreate(ScreenPtr pScreen
, const char *name
,
922 extern _X_EXPORT
void
923 RRProviderDestroy (RRProviderPtr provider
);
925 extern _X_EXPORT
void
926 RRProviderSetCapabilities(RRProviderPtr provider
, uint32_t capabilities
);
928 extern _X_EXPORT Bool
929 RRProviderLookup(XID id
, RRProviderPtr
*provider_p
);
931 extern _X_EXPORT
void
932 RRDeliverProviderEvent(ClientPtr client
, WindowPtr pWin
, RRProviderPtr provider
);
934 /* rrproviderproperty.c */
936 extern _X_EXPORT
void
937 RRDeleteAllProviderProperties(RRProviderPtr provider
);
939 extern _X_EXPORT RRPropertyValuePtr
940 RRGetProviderProperty(RRProviderPtr provider
, Atom property
, Bool pending
);
942 extern _X_EXPORT RRPropertyPtr
943 RRQueryProviderProperty(RRProviderPtr provider
, Atom property
);
945 extern _X_EXPORT
void
946 RRDeleteProviderProperty(RRProviderPtr provider
, Atom property
);
949 RRChangeProviderProperty(RRProviderPtr provider
, Atom property
, Atom type
,
950 int format
, int mode
, unsigned long len
,
951 pointer value
, Bool sendevent
, Bool pending
);
954 RRConfigureProviderProperty(RRProviderPtr provider
, Atom property
,
955 Bool pending
, Bool range
, Bool immutable
,
956 int num_values
, INT32
*values
);
958 extern _X_EXPORT Bool
959 RRPostProviderPendingProperties(RRProviderPtr provider
);
962 ProcRRGetProviderProperty(ClientPtr client
);
965 ProcRRListProviderProperties(ClientPtr client
);
968 ProcRRQueryProviderProperty(ClientPtr client
);
971 ProcRRConfigureProviderProperty(ClientPtr client
);
974 ProcRRChangeProviderProperty(ClientPtr client
);
977 ProcRRDeleteProviderProperty(ClientPtr client
);
980 extern _X_EXPORT
void
981 RRXineramaExtensionInit(void);
984 #endif /* _RANDRSTR_H_ */
988 randr extension implementation structure
991 ProcRRGetScreenInfo/ProcRRGetScreenResources
994 • Request configuration from driver, either 1.0 or 1.2 style
995 • These functions only record state changes, all
996 other actions are pended until RRTellChanged is called
1004 RRScreenSetSizeRange
1008 RROutputSetConnection
1009 RROutputSetSubpixelOrder
1013 • Must delay scanning configuration until after ->rrGetInfo returns
1014 because some drivers will call SetCurrentConfig in the middle
1015 of the ->rrGetInfo operation.
1019 • Scan old configuration, mirror to new structures
1025 RROutputSetConnection
1026 RROutputSetSubpixelOrder
1027 RROldModeAdd • This adds modes one-at-a-time
1031 • send events, reset pointer if necessary
1034 WalkTree (sending events)
1036 • when layout has changed:
1037 RRPointerScreenConfigured
1040 Asynchronous state setting (1.2 only)
1041 When setting state asynchronously, the driver invokes the
1042 ->rrGetInfo function and then calls RRTellChanged to flush
1043 the changes to the clients and reset pointer if necessary
1047 ProcRRSetScreenConfig