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