randrstr.h revision f7df2e56
105b261ecSmrg/*
205b261ecSmrg * Copyright © 2000 Compaq Computer Corporation
305b261ecSmrg * Copyright © 2002 Hewlett-Packard Company
405b261ecSmrg * Copyright © 2006 Intel Corporation
54642e01fSmrg * Copyright © 2008 Red Hat, Inc.
605b261ecSmrg *
705b261ecSmrg * Permission to use, copy, modify, distribute, and sell this software and its
805b261ecSmrg * documentation for any purpose is hereby granted without fee, provided that
905b261ecSmrg * the above copyright notice appear in all copies and that both that copyright
1005b261ecSmrg * notice and this permission notice appear in supporting documentation, and
1105b261ecSmrg * that the name of the copyright holders not be used in advertising or
1205b261ecSmrg * publicity pertaining to distribution of the software without specific,
1305b261ecSmrg * written prior permission.  The copyright holders make no representations
1405b261ecSmrg * about the suitability of this software for any purpose.  It is provided "as
1505b261ecSmrg * is" without express or implied warranty.
1605b261ecSmrg *
1705b261ecSmrg * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
1805b261ecSmrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
1905b261ecSmrg * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
2005b261ecSmrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
2105b261ecSmrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
2205b261ecSmrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
2305b261ecSmrg * OF THIS SOFTWARE.
2405b261ecSmrg *
2505b261ecSmrg * Author:  Jim Gettys, Hewlett-Packard Company, Inc.
2605b261ecSmrg *	    Keith Packard, Intel Corporation
2705b261ecSmrg */
2805b261ecSmrg
2905b261ecSmrg#ifdef HAVE_DIX_CONFIG_H
3005b261ecSmrg#include <dix-config.h>
3105b261ecSmrg#endif
3205b261ecSmrg
3305b261ecSmrg#ifndef _RANDRSTR_H_
3405b261ecSmrg#define _RANDRSTR_H_
3505b261ecSmrg
3605b261ecSmrg#include <X11/X.h>
3705b261ecSmrg#include <X11/Xproto.h>
3805b261ecSmrg#include "misc.h"
3905b261ecSmrg#include "os.h"
4005b261ecSmrg#include "dixstruct.h"
4105b261ecSmrg#include "resource.h"
4205b261ecSmrg#include "scrnintstr.h"
4305b261ecSmrg#include "windowstr.h"
4405b261ecSmrg#include "pixmapstr.h"
4505b261ecSmrg#include "extnsionst.h"
4605b261ecSmrg#include "servermd.h"
474642e01fSmrg#include "rrtransform.h"
4805b261ecSmrg#include <X11/extensions/randr.h>
4905b261ecSmrg#include <X11/extensions/randrproto.h>
50f7df2e56Smrg#include <X11/extensions/render.h>      /* we share subpixel order information */
5105b261ecSmrg#include "picturestr.h"
5205b261ecSmrg#include <X11/Xfuncproto.h>
5305b261ecSmrg
5405b261ecSmrg/* required for ABI compatibility for now */
5505b261ecSmrg#define RANDR_10_INTERFACE 1
5605b261ecSmrg#define RANDR_12_INTERFACE 1
57f7df2e56Smrg#define RANDR_13_INTERFACE 1    /* requires RANDR_12_INTERFACE */
584642e01fSmrg#define RANDR_GET_CRTC_INTERFACE 1
594642e01fSmrg
60f7df2e56Smrg#define RANDR_INTERFACE_VERSION 0x0104
6105b261ecSmrg
62f7df2e56Smrgtypedef XID RRMode;
63f7df2e56Smrgtypedef XID RROutput;
64f7df2e56Smrgtypedef XID RRCrtc;
65f7df2e56Smrgtypedef XID RRProvider;
6605b261ecSmrg
67f7df2e56Smrgextern int RREventBase, RRErrorBase;
68f7df2e56Smrg
69f7df2e56Smrgextern int (*ProcRandrVector[RRNumberRequests]) (ClientPtr);
70f7df2e56Smrgextern int (*SProcRandrVector[RRNumberRequests]) (ClientPtr);
7105b261ecSmrg
7205b261ecSmrg/*
7305b261ecSmrg * Modeline for a monitor. Name follows directly after this struct
7405b261ecSmrg */
7505b261ecSmrg
7605b261ecSmrg#define RRModeName(pMode) ((char *) (pMode + 1))
77f7df2e56Smrgtypedef struct _rrMode RRModeRec, *RRModePtr;
78f7df2e56Smrgtypedef struct _rrPropertyValue RRPropertyValueRec, *RRPropertyValuePtr;
79f7df2e56Smrgtypedef struct _rrProperty RRPropertyRec, *RRPropertyPtr;
80f7df2e56Smrgtypedef struct _rrCrtc RRCrtcRec, *RRCrtcPtr;
81f7df2e56Smrgtypedef struct _rrOutput RROutputRec, *RROutputPtr;
82f7df2e56Smrgtypedef struct _rrProvider RRProviderRec, *RRProviderPtr;
83f7df2e56Smrgtypedef struct _rrMonitor RRMonitorRec, *RRMonitorPtr;
8405b261ecSmrg
8505b261ecSmrgstruct _rrMode {
86f7df2e56Smrg    int refcnt;
87f7df2e56Smrg    xRRModeInfo mode;
88f7df2e56Smrg    char *name;
89f7df2e56Smrg    ScreenPtr userScreen;
9005b261ecSmrg};
9105b261ecSmrg
9205b261ecSmrgstruct _rrPropertyValue {
93f7df2e56Smrg    Atom type;                  /* ignored by server */
94f7df2e56Smrg    short format;               /* format of data for swapping - 8,16,32 */
95f7df2e56Smrg    long size;                  /* size of data in (format/8) bytes */
96f7df2e56Smrg    void *data;                 /* private to client */
9705b261ecSmrg};
9805b261ecSmrg
9905b261ecSmrgstruct _rrProperty {
100f7df2e56Smrg    RRPropertyPtr next;
101f7df2e56Smrg    ATOM propertyName;
102f7df2e56Smrg    Bool is_pending;
103f7df2e56Smrg    Bool range;
104f7df2e56Smrg    Bool immutable;
105f7df2e56Smrg    int num_valid;
106f7df2e56Smrg    INT32 *valid_values;
107f7df2e56Smrg    RRPropertyValueRec current, pending;
10805b261ecSmrg};
10905b261ecSmrg
11005b261ecSmrgstruct _rrCrtc {
111f7df2e56Smrg    RRCrtc id;
112f7df2e56Smrg    ScreenPtr pScreen;
113f7df2e56Smrg    RRModePtr mode;
114f7df2e56Smrg    int x, y;
115f7df2e56Smrg    Rotation rotation;
116f7df2e56Smrg    Rotation rotations;
117f7df2e56Smrg    Bool changed;
118f7df2e56Smrg    int numOutputs;
119f7df2e56Smrg    RROutputPtr *outputs;
120f7df2e56Smrg    int gammaSize;
121f7df2e56Smrg    CARD16 *gammaRed;
122f7df2e56Smrg    CARD16 *gammaBlue;
123f7df2e56Smrg    CARD16 *gammaGreen;
124f7df2e56Smrg    void *devPrivate;
125f7df2e56Smrg    Bool transforms;
126f7df2e56Smrg    RRTransformRec client_pending_transform;
127f7df2e56Smrg    RRTransformRec client_current_transform;
128f7df2e56Smrg    PictTransform transform;
1294642e01fSmrg    struct pict_f_transform f_transform;
1304642e01fSmrg    struct pict_f_transform f_inverse;
131f7df2e56Smrg
132f7df2e56Smrg    PixmapPtr scanout_pixmap;
13305b261ecSmrg};
13405b261ecSmrg
13505b261ecSmrgstruct _rrOutput {
136f7df2e56Smrg    RROutput id;
137f7df2e56Smrg    ScreenPtr pScreen;
138f7df2e56Smrg    char *name;
139f7df2e56Smrg    int nameLength;
140f7df2e56Smrg    CARD8 connection;
141f7df2e56Smrg    CARD8 subpixelOrder;
142f7df2e56Smrg    int mmWidth;
143f7df2e56Smrg    int mmHeight;
144f7df2e56Smrg    RRCrtcPtr crtc;
145f7df2e56Smrg    int numCrtcs;
146f7df2e56Smrg    RRCrtcPtr *crtcs;
147f7df2e56Smrg    int numClones;
148f7df2e56Smrg    RROutputPtr *clones;
149f7df2e56Smrg    int numModes;
150f7df2e56Smrg    int numPreferred;
151f7df2e56Smrg    RRModePtr *modes;
152f7df2e56Smrg    int numUserModes;
153f7df2e56Smrg    RRModePtr *userModes;
154f7df2e56Smrg    Bool changed;
155f7df2e56Smrg    RRPropertyPtr properties;
156f7df2e56Smrg    Bool pendingProperties;
157f7df2e56Smrg    void *devPrivate;
158f7df2e56Smrg};
159f7df2e56Smrg
160f7df2e56Smrgstruct _rrProvider {
161f7df2e56Smrg    RRProvider id;
162f7df2e56Smrg    ScreenPtr pScreen;
163f7df2e56Smrg    uint32_t capabilities;
164f7df2e56Smrg    char *name;
165f7df2e56Smrg    int nameLength;
166f7df2e56Smrg    RRPropertyPtr properties;
167f7df2e56Smrg    Bool pendingProperties;
168f7df2e56Smrg    Bool changed;
169f7df2e56Smrg    struct _rrProvider *offload_sink;
170f7df2e56Smrg    struct _rrProvider *output_source;
171f7df2e56Smrg};
172f7df2e56Smrg
173f7df2e56Smrgtypedef struct _rrMonitorGeometry {
174f7df2e56Smrg    BoxRec box;
175f7df2e56Smrg    CARD32 mmWidth;
176f7df2e56Smrg    CARD32 mmHeight;
177f7df2e56Smrg} RRMonitorGeometryRec, *RRMonitorGeometryPtr;
178f7df2e56Smrg
179f7df2e56Smrgstruct _rrMonitor {
180f7df2e56Smrg    Atom name;
181f7df2e56Smrg    ScreenPtr pScreen;
182f7df2e56Smrg    int numOutputs;
183f7df2e56Smrg    RROutput *outputs;
184f7df2e56Smrg    Bool primary;
185f7df2e56Smrg    Bool automatic;
186f7df2e56Smrg    RRMonitorGeometryRec geometry;
18705b261ecSmrg};
18805b261ecSmrg
18905b261ecSmrg#if RANDR_12_INTERFACE
190f7df2e56Smrgtypedef Bool (*RRScreenSetSizeProcPtr) (ScreenPtr pScreen,
191f7df2e56Smrg                                        CARD16 width,
192f7df2e56Smrg                                        CARD16 height,
193f7df2e56Smrg                                        CARD32 mmWidth, CARD32 mmHeight);
194f7df2e56Smrg
195f7df2e56Smrgtypedef Bool (*RRCrtcSetProcPtr) (ScreenPtr pScreen,
196f7df2e56Smrg                                  RRCrtcPtr crtc,
197f7df2e56Smrg                                  RRModePtr mode,
198f7df2e56Smrg                                  int x,
199f7df2e56Smrg                                  int y,
200f7df2e56Smrg                                  Rotation rotation,
201f7df2e56Smrg                                  int numOutputs, RROutputPtr * outputs);
202f7df2e56Smrg
203f7df2e56Smrgtypedef Bool (*RRCrtcSetGammaProcPtr) (ScreenPtr pScreen, RRCrtcPtr crtc);
204f7df2e56Smrg
205f7df2e56Smrgtypedef Bool (*RRCrtcGetGammaProcPtr) (ScreenPtr pScreen, RRCrtcPtr crtc);
206f7df2e56Smrg
207f7df2e56Smrgtypedef Bool (*RROutputSetPropertyProcPtr) (ScreenPtr pScreen,
208f7df2e56Smrg                                            RROutputPtr output,
209f7df2e56Smrg                                            Atom property,
210f7df2e56Smrg                                            RRPropertyValuePtr value);
211f7df2e56Smrg
212f7df2e56Smrgtypedef Bool (*RROutputValidateModeProcPtr) (ScreenPtr pScreen,
213f7df2e56Smrg                                             RROutputPtr output,
214f7df2e56Smrg                                             RRModePtr mode);
215f7df2e56Smrg
216f7df2e56Smrgtypedef void (*RRModeDestroyProcPtr) (ScreenPtr pScreen, RRModePtr mode);
21705b261ecSmrg
21805b261ecSmrg#endif
21905b261ecSmrg
2204642e01fSmrg#if RANDR_13_INTERFACE
221f7df2e56Smrgtypedef Bool (*RROutputGetPropertyProcPtr) (ScreenPtr pScreen,
222f7df2e56Smrg                                            RROutputPtr output, Atom property);
223f7df2e56Smrgtypedef Bool (*RRGetPanningProcPtr) (ScreenPtr pScrn,
224f7df2e56Smrg                                     RRCrtcPtr crtc,
225f7df2e56Smrg                                     BoxPtr totalArea,
226f7df2e56Smrg                                     BoxPtr trackingArea, INT16 *border);
227f7df2e56Smrgtypedef Bool (*RRSetPanningProcPtr) (ScreenPtr pScrn,
228f7df2e56Smrg                                     RRCrtcPtr crtc,
229f7df2e56Smrg                                     BoxPtr totalArea,
230f7df2e56Smrg                                     BoxPtr trackingArea, INT16 *border);
231f7df2e56Smrg
232f7df2e56Smrg#endif                          /* RANDR_13_INTERFACE */
233f7df2e56Smrg
234f7df2e56Smrgtypedef Bool (*RRProviderGetPropertyProcPtr) (ScreenPtr pScreen,
235f7df2e56Smrg                                            RRProviderPtr provider, Atom property);
236f7df2e56Smrgtypedef Bool (*RRProviderSetPropertyProcPtr) (ScreenPtr pScreen,
237f7df2e56Smrg                                              RRProviderPtr provider,
238f7df2e56Smrg                                              Atom property,
239f7df2e56Smrg                                              RRPropertyValuePtr value);
240f7df2e56Smrg
241f7df2e56Smrgtypedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation * rotations);
242f7df2e56Smrgtypedef Bool (*RRCloseScreenProcPtr) (ScreenPtr pscreen);
243f7df2e56Smrg
244f7df2e56Smrgtypedef Bool (*RRProviderSetOutputSourceProcPtr)(ScreenPtr pScreen,
245f7df2e56Smrg                                          RRProviderPtr provider,
246f7df2e56Smrg                                          RRProviderPtr output_source);
247f7df2e56Smrg
248f7df2e56Smrgtypedef Bool (*RRProviderSetOffloadSinkProcPtr)(ScreenPtr pScreen,
249f7df2e56Smrg                                         RRProviderPtr provider,
250f7df2e56Smrg                                         RRProviderPtr offload_sink);
251f7df2e56Smrg
252f7df2e56Smrg
253f7df2e56Smrgtypedef void (*RRProviderDestroyProcPtr)(ScreenPtr pScreen,
254f7df2e56Smrg                                         RRProviderPtr provider);
25505b261ecSmrg
25605b261ecSmrg/* These are for 1.0 compatibility */
257f7df2e56Smrg
25805b261ecSmrgtypedef struct _rrRefresh {
259f7df2e56Smrg    CARD16 rate;
260f7df2e56Smrg    RRModePtr mode;
26105b261ecSmrg} RRScreenRate, *RRScreenRatePtr;
26205b261ecSmrg
26305b261ecSmrgtypedef struct _rrScreenSize {
264f7df2e56Smrg    int id;
265f7df2e56Smrg    short width, height;
266f7df2e56Smrg    short mmWidth, mmHeight;
267f7df2e56Smrg    int nRates;
26805b261ecSmrg    RRScreenRatePtr pRates;
26905b261ecSmrg} RRScreenSize, *RRScreenSizePtr;
27005b261ecSmrg
27105b261ecSmrg#ifdef RANDR_10_INTERFACE
27205b261ecSmrg
273f7df2e56Smrgtypedef Bool (*RRSetConfigProcPtr) (ScreenPtr pScreen,
274f7df2e56Smrg                                    Rotation rotation,
275f7df2e56Smrg                                    int rate, RRScreenSizePtr pSize);
27605b261ecSmrg
27705b261ecSmrg#endif
278f7df2e56Smrg
279f7df2e56Smrgtypedef Bool (*RRCrtcSetScanoutPixmapProcPtr)(RRCrtcPtr crtc, PixmapPtr pixmap);
28005b261ecSmrg
28105b261ecSmrgtypedef struct _rrScrPriv {
28205b261ecSmrg    /*
28305b261ecSmrg     * 'public' part of the structure; DDXen fill this in
28405b261ecSmrg     * as they initialize
28505b261ecSmrg     */
28605b261ecSmrg#if RANDR_10_INTERFACE
287f7df2e56Smrg    RRSetConfigProcPtr rrSetConfig;
28805b261ecSmrg#endif
289f7df2e56Smrg    RRGetInfoProcPtr rrGetInfo;
29005b261ecSmrg#if RANDR_12_INTERFACE
291f7df2e56Smrg    RRScreenSetSizeProcPtr rrScreenSetSize;
292f7df2e56Smrg    RRCrtcSetProcPtr rrCrtcSet;
293f7df2e56Smrg    RRCrtcSetGammaProcPtr rrCrtcSetGamma;
294f7df2e56Smrg    RRCrtcGetGammaProcPtr rrCrtcGetGamma;
295f7df2e56Smrg    RROutputSetPropertyProcPtr rrOutputSetProperty;
296f7df2e56Smrg    RROutputValidateModeProcPtr rrOutputValidateMode;
297f7df2e56Smrg    RRModeDestroyProcPtr rrModeDestroy;
29805b261ecSmrg#endif
2994642e01fSmrg#if RANDR_13_INTERFACE
300f7df2e56Smrg    RROutputGetPropertyProcPtr rrOutputGetProperty;
301f7df2e56Smrg    RRGetPanningProcPtr rrGetPanning;
302f7df2e56Smrg    RRSetPanningProcPtr rrSetPanning;
3034642e01fSmrg#endif
304f7df2e56Smrg    /* TODO #if RANDR_15_INTERFACE */
305f7df2e56Smrg    RRCrtcSetScanoutPixmapProcPtr rrCrtcSetScanoutPixmap;
306f7df2e56Smrg
307f7df2e56Smrg    RRProviderSetOutputSourceProcPtr rrProviderSetOutputSource;
308f7df2e56Smrg    RRProviderSetOffloadSinkProcPtr rrProviderSetOffloadSink;
309f7df2e56Smrg    RRProviderGetPropertyProcPtr rrProviderGetProperty;
310f7df2e56Smrg    RRProviderSetPropertyProcPtr rrProviderSetProperty;
31105b261ecSmrg    /*
31205b261ecSmrg     * Private part of the structure; not considered part of the ABI
31305b261ecSmrg     */
314f7df2e56Smrg    TimeStamp lastSetTime;      /* last changed by client */
315f7df2e56Smrg    TimeStamp lastConfigTime;   /* possible configs changed */
316f7df2e56Smrg    RRCloseScreenProcPtr CloseScreen;
31705b261ecSmrg
318f7df2e56Smrg    Bool changed;               /* some config changed */
319f7df2e56Smrg    Bool configChanged;         /* configuration changed */
320f7df2e56Smrg    Bool layoutChanged;         /* screen layout changed */
321f7df2e56Smrg    Bool resourcesChanged;      /* screen resources change */
32205b261ecSmrg
323f7df2e56Smrg    CARD16 minWidth, minHeight;
324f7df2e56Smrg    CARD16 maxWidth, maxHeight;
325f7df2e56Smrg    CARD16 width, height;       /* last known screen size */
326f7df2e56Smrg    CARD16 mmWidth, mmHeight;   /* last known screen size */
32705b261ecSmrg
328f7df2e56Smrg    int numOutputs;
329f7df2e56Smrg    RROutputPtr *outputs;
330f7df2e56Smrg    RROutputPtr primaryOutput;
33105b261ecSmrg
332f7df2e56Smrg    int numCrtcs;
333f7df2e56Smrg    RRCrtcPtr *crtcs;
33405b261ecSmrg
33505b261ecSmrg    /* Last known pointer position */
336f7df2e56Smrg    RRCrtcPtr pointerCrtc;
33705b261ecSmrg
33805b261ecSmrg#ifdef RANDR_10_INTERFACE
33905b261ecSmrg    /*
34005b261ecSmrg     * Configuration information
34105b261ecSmrg     */
342f7df2e56Smrg    Rotation rotations;
343f7df2e56Smrg    CARD16 reqWidth, reqHeight;
344f7df2e56Smrg
345f7df2e56Smrg    int nSizes;
346f7df2e56Smrg    RRScreenSizePtr pSizes;
347f7df2e56Smrg
348f7df2e56Smrg    Rotation rotation;
349f7df2e56Smrg    int rate;
350f7df2e56Smrg    int size;
35105b261ecSmrg#endif
352f7df2e56Smrg    Bool discontiguous;
353f7df2e56Smrg
354f7df2e56Smrg    RRProviderPtr provider;
355f7df2e56Smrg
356f7df2e56Smrg    RRProviderDestroyProcPtr rrProviderDestroy;
357f7df2e56Smrg
358f7df2e56Smrg    int numMonitors;
359f7df2e56Smrg    RRMonitorPtr *monitors;
360f7df2e56Smrg
36105b261ecSmrg} rrScrPrivRec, *rrScrPrivPtr;
36205b261ecSmrg
3636747b715Smrgextern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec;
364f7df2e56Smrg
3656747b715Smrg#define rrPrivKey (&rrPrivKeyRec)
36605b261ecSmrg
3674642e01fSmrg#define rrGetScrPriv(pScr)  ((rrScrPrivPtr)dixLookupPrivate(&(pScr)->devPrivates, rrPrivKey))
36805b261ecSmrg#define rrScrPriv(pScr)	rrScrPrivPtr    pScrPriv = rrGetScrPriv(pScr)
3694642e01fSmrg#define SetRRScreen(s,p) dixSetPrivate(&(s)->devPrivates, rrPrivKey, p)
37005b261ecSmrg
37105b261ecSmrg/*
37205b261ecSmrg * each window has a list of clients requesting
37305b261ecSmrg * RRNotify events.  Each client has a resource
37405b261ecSmrg * for each window it selects RRNotify input for,
37505b261ecSmrg * this resource is used to delete the RRNotifyRec
37605b261ecSmrg * entry from the per-window queue.
37705b261ecSmrg */
37805b261ecSmrg
37905b261ecSmrgtypedef struct _RREvent *RREventPtr;
38005b261ecSmrg
38105b261ecSmrgtypedef struct _RREvent {
382f7df2e56Smrg    RREventPtr next;
383f7df2e56Smrg    ClientPtr client;
384f7df2e56Smrg    WindowPtr window;
385f7df2e56Smrg    XID clientResource;
386f7df2e56Smrg    int mask;
38705b261ecSmrg} RREventRec;
38805b261ecSmrg
38905b261ecSmrgtypedef struct _RRTimes {
390f7df2e56Smrg    TimeStamp setTime;
391f7df2e56Smrg    TimeStamp configTime;
39205b261ecSmrg} RRTimesRec, *RRTimesPtr;
39305b261ecSmrg
39405b261ecSmrgtypedef struct _RRClient {
395f7df2e56Smrg    int major_version;
396f7df2e56Smrg    int minor_version;
39705b261ecSmrg/*  RRTimesRec	times[0]; */
39805b261ecSmrg} RRClientRec, *RRClientPtr;
39905b261ecSmrg
400f7df2e56Smrgextern RESTYPE RRClientType, RREventType;     /* resource types for event masks */
401f7df2e56Smrgextern DevPrivateKeyRec RRClientPrivateKeyRec;
402f7df2e56Smrg
4036747b715Smrg#define RRClientPrivateKey (&RRClientPrivateKeyRec)
404f7df2e56Smrgextern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType, RRProviderType;
4056747b715Smrg
4066747b715Smrg#define VERIFY_RR_OUTPUT(id, ptr, a)\
4076747b715Smrg    {\
408f7df2e56Smrg	int rc = dixLookupResourceByType((void **)&(ptr), id,\
4096747b715Smrg	                                 RROutputType, client, a);\
4106747b715Smrg	if (rc != Success) {\
4116747b715Smrg	    client->errorValue = id;\
4126747b715Smrg	    return rc;\
4136747b715Smrg	}\
4146747b715Smrg    }
4156747b715Smrg
4166747b715Smrg#define VERIFY_RR_CRTC(id, ptr, a)\
4176747b715Smrg    {\
418f7df2e56Smrg	int rc = dixLookupResourceByType((void **)&(ptr), id,\
4196747b715Smrg	                                 RRCrtcType, client, a);\
4206747b715Smrg	if (rc != Success) {\
4216747b715Smrg	    client->errorValue = id;\
4226747b715Smrg	    return rc;\
4236747b715Smrg	}\
4246747b715Smrg    }
4256747b715Smrg
4266747b715Smrg#define VERIFY_RR_MODE(id, ptr, a)\
4276747b715Smrg    {\
428f7df2e56Smrg	int rc = dixLookupResourceByType((void **)&(ptr), id,\
4296747b715Smrg	                                 RRModeType, client, a);\
4306747b715Smrg	if (rc != Success) {\
4316747b715Smrg	    client->errorValue = id;\
4326747b715Smrg	    return rc;\
4336747b715Smrg	}\
4346747b715Smrg    }
43505b261ecSmrg
436f7df2e56Smrg#define VERIFY_RR_PROVIDER(id, ptr, a)\
437f7df2e56Smrg    {\
438f7df2e56Smrg        int rc = dixLookupResourceByType((void **)&(ptr), id,\
439f7df2e56Smrg                                         RRProviderType, client, a);\
440f7df2e56Smrg        if (rc != Success) {\
441f7df2e56Smrg            client->errorValue = id;\
442f7df2e56Smrg            return rc;\
443f7df2e56Smrg        }\
444f7df2e56Smrg    }
445f7df2e56Smrg
4464642e01fSmrg#define GetRRClient(pClient)    ((RRClientPtr)dixLookupPrivate(&(pClient)->devPrivates, RRClientPrivateKey))
44705b261ecSmrg#define rrClientPriv(pClient)	RRClientPtr pRRClient = GetRRClient(pClient)
44805b261ecSmrg
44905b261ecSmrg#ifdef RANDR_12_INTERFACE
45005b261ecSmrg/*
45105b261ecSmrg * Set the range of sizes for the screen
45205b261ecSmrg */
4536747b715Smrgextern _X_EXPORT void
454f7df2e56Smrg
455f7df2e56SmrgRRScreenSetSizeRange(ScreenPtr pScreen,
456f7df2e56Smrg                     CARD16 minWidth,
457f7df2e56Smrg                     CARD16 minHeight, CARD16 maxWidth, CARD16 maxHeight);
45805b261ecSmrg#endif
45905b261ecSmrg
46005b261ecSmrg/* rrscreen.c */
46105b261ecSmrg/*
46205b261ecSmrg * Notify the extension that the screen size has been changed.
46305b261ecSmrg * The driver is responsible for calling this whenever it has changed
46405b261ecSmrg * the size of the screen
46505b261ecSmrg */
4666747b715Smrgextern _X_EXPORT void
467f7df2e56Smrg RRScreenSizeNotify(ScreenPtr pScreen);
46805b261ecSmrg
46905b261ecSmrg/*
47005b261ecSmrg * Request that the screen be resized
47105b261ecSmrg */
4726747b715Smrgextern _X_EXPORT Bool
473f7df2e56Smrg
474f7df2e56SmrgRRScreenSizeSet(ScreenPtr pScreen,
475f7df2e56Smrg                CARD16 width, CARD16 height, CARD32 mmWidth, CARD32 mmHeight);
47605b261ecSmrg
47705b261ecSmrg/*
47805b261ecSmrg * Send ConfigureNotify event to root window when 'something' happens
47905b261ecSmrg */
4806747b715Smrgextern _X_EXPORT void
481f7df2e56Smrg RRSendConfigNotify(ScreenPtr pScreen);
482f7df2e56Smrg
48305b261ecSmrg/*
48405b261ecSmrg * screen dispatch
48505b261ecSmrg */
4866747b715Smrgextern _X_EXPORT int
487f7df2e56Smrg ProcRRGetScreenSizeRange(ClientPtr client);
48805b261ecSmrg
4896747b715Smrgextern _X_EXPORT int
490f7df2e56Smrg ProcRRSetScreenSize(ClientPtr client);
49105b261ecSmrg
4926747b715Smrgextern _X_EXPORT int
493f7df2e56Smrg ProcRRGetScreenResources(ClientPtr client);
49405b261ecSmrg
4956747b715Smrgextern _X_EXPORT int
496f7df2e56Smrg ProcRRGetScreenResourcesCurrent(ClientPtr client);
4974642e01fSmrg
4986747b715Smrgextern _X_EXPORT int
499f7df2e56Smrg ProcRRSetScreenConfig(ClientPtr client);
50005b261ecSmrg
5016747b715Smrgextern _X_EXPORT int
502f7df2e56Smrg ProcRRGetScreenInfo(ClientPtr client);
50305b261ecSmrg
50405b261ecSmrg/*
50505b261ecSmrg * Deliver a ScreenNotify event
50605b261ecSmrg */
5076747b715Smrgextern _X_EXPORT void
508f7df2e56Smrg RRDeliverScreenEvent(ClientPtr client, WindowPtr pWin, ScreenPtr pScreen);
509f7df2e56Smrg
510f7df2e56Smrgextern _X_EXPORT void
511f7df2e56Smrg RRResourcesChanged(ScreenPtr pScreen);
512f7df2e56Smrg
51305b261ecSmrg/* randr.c */
514f7df2e56Smrg/* set a screen change on the primary screen */
515f7df2e56Smrgextern _X_EXPORT void
516f7df2e56SmrgRRSetChanged(ScreenPtr pScreen);
517f7df2e56Smrg
51805b261ecSmrg/*
51905b261ecSmrg * Send all pending events
52005b261ecSmrg */
5216747b715Smrgextern _X_EXPORT void
522f7df2e56Smrg RRTellChanged(ScreenPtr pScreen);
52305b261ecSmrg
524051b6151Schristosextern _X_EXPORT void
525051b6151SchristosRRSetChanged (ScreenPtr pScreen);
526051b6151Schristos
52705b261ecSmrg/*
52805b261ecSmrg * Poll the driver for changed information
52905b261ecSmrg */
5306747b715Smrgextern _X_EXPORT Bool
531f7df2e56Smrg RRGetInfo(ScreenPtr pScreen, Bool force_query);
53205b261ecSmrg
533f7df2e56Smrgextern _X_EXPORT Bool RRInit(void);
53405b261ecSmrg
5356747b715Smrgextern _X_EXPORT Bool RRScreenInit(ScreenPtr pScreen);
53605b261ecSmrg
537f7df2e56Smrgextern _X_EXPORT RROutputPtr RRFirstOutput(ScreenPtr pScreen);
53805b261ecSmrg
5396747b715Smrgextern _X_EXPORT CARD16
540f7df2e56Smrg RRVerticalRefresh(xRRModeInfo * mode);
54105b261ecSmrg
542f7df2e56Smrg#ifdef RANDR_10_INTERFACE
54305b261ecSmrg/*
54405b261ecSmrg * This is the old interface, deprecated but left
54505b261ecSmrg * around for compatibility
54605b261ecSmrg */
54705b261ecSmrg
54805b261ecSmrg/*
54905b261ecSmrg * Then, register the specific size with the screen
55005b261ecSmrg */
55105b261ecSmrg
5526747b715Smrgextern _X_EXPORT RRScreenSizePtr
553f7df2e56SmrgRRRegisterSize(ScreenPtr pScreen,
554f7df2e56Smrg               short width, short height, short mmWidth, short mmHeight);
55505b261ecSmrg
5566747b715Smrgextern _X_EXPORT Bool
557f7df2e56Smrg RRRegisterRate(ScreenPtr pScreen, RRScreenSizePtr pSize, int rate);
55805b261ecSmrg
55905b261ecSmrg/*
56005b261ecSmrg * Finally, set the current configuration of the screen
56105b261ecSmrg */
56205b261ecSmrg
5636747b715Smrgextern _X_EXPORT void
56405b261ecSmrg
565f7df2e56SmrgRRSetCurrentConfig(ScreenPtr pScreen,
566f7df2e56Smrg                   Rotation rotation, int rate, RRScreenSizePtr pSize);
56705b261ecSmrg
568f7df2e56Smrgextern _X_EXPORT Rotation RRGetRotation(ScreenPtr pScreen);
569f7df2e56Smrg
570f7df2e56Smrg#endif
57105b261ecSmrg
57205b261ecSmrg/* rrcrtc.c */
57305b261ecSmrg
57405b261ecSmrg/*
57505b261ecSmrg * Notify the CRTC of some change; layoutChanged indicates that
57605b261ecSmrg * some position or size element changed
57705b261ecSmrg */
5786747b715Smrgextern _X_EXPORT void
579f7df2e56Smrg RRCrtcChanged(RRCrtcPtr crtc, Bool layoutChanged);
58005b261ecSmrg
58105b261ecSmrg/*
58205b261ecSmrg * Create a CRTC
58305b261ecSmrg */
584f7df2e56Smrgextern _X_EXPORT RRCrtcPtr RRCrtcCreate(ScreenPtr pScreen, void *devPrivate);
58505b261ecSmrg
58605b261ecSmrg/*
58705b261ecSmrg * Set the allowed rotations on a CRTC
58805b261ecSmrg */
5896747b715Smrgextern _X_EXPORT void
590f7df2e56Smrg RRCrtcSetRotations(RRCrtcPtr crtc, Rotation rotations);
59105b261ecSmrg
5924642e01fSmrg/*
5934642e01fSmrg * Set whether transforms are allowed on a CRTC
5944642e01fSmrg */
5956747b715Smrgextern _X_EXPORT void
596f7df2e56Smrg RRCrtcSetTransformSupport(RRCrtcPtr crtc, Bool transforms);
5974642e01fSmrg
59805b261ecSmrg/*
59905b261ecSmrg * Notify the extension that the Crtc has been reconfigured,
60005b261ecSmrg * the driver calls this whenever it has updated the mode
60105b261ecSmrg */
6026747b715Smrgextern _X_EXPORT Bool
603f7df2e56Smrg
604f7df2e56SmrgRRCrtcNotify(RRCrtcPtr crtc,
605f7df2e56Smrg             RRModePtr mode,
606f7df2e56Smrg             int x,
607f7df2e56Smrg             int y,
608f7df2e56Smrg             Rotation rotation,
609f7df2e56Smrg             RRTransformPtr transform, int numOutputs, RROutputPtr * outputs);
61005b261ecSmrg
6116747b715Smrgextern _X_EXPORT void
612f7df2e56Smrg RRDeliverCrtcEvent(ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc);
613f7df2e56Smrg
61405b261ecSmrg/*
61505b261ecSmrg * Request that the Crtc be reconfigured
61605b261ecSmrg */
6176747b715Smrgextern _X_EXPORT Bool
618f7df2e56Smrg
619f7df2e56SmrgRRCrtcSet(RRCrtcPtr crtc,
620f7df2e56Smrg          RRModePtr mode,
621f7df2e56Smrg          int x,
622f7df2e56Smrg          int y, Rotation rotation, int numOutput, RROutputPtr * outputs);
62305b261ecSmrg
62405b261ecSmrg/*
62505b261ecSmrg * Request that the Crtc gamma be changed
62605b261ecSmrg */
62705b261ecSmrg
6286747b715Smrgextern _X_EXPORT Bool
629f7df2e56Smrg RRCrtcGammaSet(RRCrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue);
63005b261ecSmrg
6316747b715Smrg/*
6326747b715Smrg * Request current gamma back from the DDX (if possible).
6336747b715Smrg * This includes gamma size.
6346747b715Smrg */
635f7df2e56Smrg
6366747b715Smrgextern _X_EXPORT Bool
637f7df2e56Smrg RRCrtcGammaGet(RRCrtcPtr crtc);
6386747b715Smrg
63905b261ecSmrg/*
64005b261ecSmrg * Notify the extension that the Crtc gamma has been changed
64105b261ecSmrg * The driver calls this whenever it has changed the gamma values
64205b261ecSmrg * in the RRCrtcRec
64305b261ecSmrg */
64405b261ecSmrg
6456747b715Smrgextern _X_EXPORT Bool
646f7df2e56Smrg RRCrtcGammaNotify(RRCrtcPtr crtc);
64705b261ecSmrg
64805b261ecSmrg/*
64905b261ecSmrg * Set the size of the gamma table at server startup time
65005b261ecSmrg */
65105b261ecSmrg
6526747b715Smrgextern _X_EXPORT Bool
653f7df2e56Smrg RRCrtcGammaSetSize(RRCrtcPtr crtc, int size);
65405b261ecSmrg
65505b261ecSmrg/*
65605b261ecSmrg * Return the area of the frame buffer scanned out by the crtc,
65705b261ecSmrg * taking into account the current mode and rotation
65805b261ecSmrg */
65905b261ecSmrg
6606747b715Smrgextern _X_EXPORT void
661f7df2e56Smrg RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height);
66205b261ecSmrg
6634642e01fSmrg/*
6644642e01fSmrg * Return crtc transform
6654642e01fSmrg */
666f7df2e56Smrgextern _X_EXPORT RRTransformPtr RRCrtcGetTransform(RRCrtcPtr crtc);
6674642e01fSmrg
6684642e01fSmrg/*
6694642e01fSmrg * Check whether the pending and current transforms are the same
6704642e01fSmrg */
6716747b715Smrgextern _X_EXPORT Bool
672f7df2e56Smrg RRCrtcPendingTransform(RRCrtcPtr crtc);
6734642e01fSmrg
67405b261ecSmrg/*
67505b261ecSmrg * Destroy a Crtc at shutdown
67605b261ecSmrg */
6776747b715Smrgextern _X_EXPORT void
678f7df2e56Smrg RRCrtcDestroy(RRCrtcPtr crtc);
6794642e01fSmrg
6804642e01fSmrg/*
6814642e01fSmrg * Set the pending CRTC transformation
6824642e01fSmrg */
6834642e01fSmrg
6846747b715Smrgextern _X_EXPORT int
685f7df2e56Smrg
686f7df2e56SmrgRRCrtcTransformSet(RRCrtcPtr crtc,
687f7df2e56Smrg                   PictTransformPtr transform,
688f7df2e56Smrg                   struct pict_f_transform *f_transform,
689f7df2e56Smrg                   struct pict_f_transform *f_inverse,
690f7df2e56Smrg                   char *filter, int filter_len, xFixed * params, int nparams);
6914642e01fSmrg
69205b261ecSmrg/*
69305b261ecSmrg * Initialize crtc type
69405b261ecSmrg */
6956747b715Smrgextern _X_EXPORT Bool
696f7df2e56Smrg RRCrtcInit(void);
69705b261ecSmrg
6986747b715Smrg/*
6996747b715Smrg * Initialize crtc type error value
7006747b715Smrg */
7016747b715Smrgextern _X_EXPORT void
702f7df2e56Smrg RRCrtcInitErrorValue(void);
703f7df2e56Smrg
704f7df2e56Smrg/*
705f7df2e56Smrg * Detach and free a scanout pixmap
706f7df2e56Smrg */
707f7df2e56Smrgextern _X_EXPORT void
708f7df2e56Smrg RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc);
709f7df2e56Smrg
710f7df2e56Smrgextern _X_EXPORT Bool
711f7df2e56Smrg RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable);
7126747b715Smrg
71305b261ecSmrg/*
71405b261ecSmrg * Crtc dispatch
71505b261ecSmrg */
71605b261ecSmrg
7176747b715Smrgextern _X_EXPORT int
718f7df2e56Smrg ProcRRGetCrtcInfo(ClientPtr client);
71905b261ecSmrg
7206747b715Smrgextern _X_EXPORT int
721f7df2e56Smrg ProcRRSetCrtcConfig(ClientPtr client);
72205b261ecSmrg
7236747b715Smrgextern _X_EXPORT int
724f7df2e56Smrg ProcRRGetCrtcGammaSize(ClientPtr client);
72505b261ecSmrg
7266747b715Smrgextern _X_EXPORT int
727f7df2e56Smrg ProcRRGetCrtcGamma(ClientPtr client);
72805b261ecSmrg
7296747b715Smrgextern _X_EXPORT int
730f7df2e56Smrg ProcRRSetCrtcGamma(ClientPtr client);
73105b261ecSmrg
7326747b715Smrgextern _X_EXPORT int
733f7df2e56Smrg ProcRRSetCrtcTransform(ClientPtr client);
7344642e01fSmrg
7356747b715Smrgextern _X_EXPORT int
736f7df2e56Smrg ProcRRGetCrtcTransform(ClientPtr client);
7374642e01fSmrg
7384642e01fSmrgint
739f7df2e56Smrg ProcRRGetPanning(ClientPtr client);
7404642e01fSmrg
7414642e01fSmrgint
742f7df2e56Smrg ProcRRSetPanning(ClientPtr client);
743f7df2e56Smrg
744f7df2e56Smrgvoid
745f7df2e56Smrg RRConstrainCursorHarder(DeviceIntPtr, ScreenPtr, int, int *, int *);
7464642e01fSmrg
74705b261ecSmrg/* rrdispatch.c */
7486747b715Smrgextern _X_EXPORT Bool
749f7df2e56Smrg RRClientKnowsRates(ClientPtr pClient);
75005b261ecSmrg
75105b261ecSmrg/* rrmode.c */
75205b261ecSmrg/*
75305b261ecSmrg * Find, and if necessary, create a mode
75405b261ecSmrg */
75505b261ecSmrg
756f7df2e56Smrgextern _X_EXPORT RRModePtr RRModeGet(xRRModeInfo * modeInfo, const char *name);
75705b261ecSmrg
75805b261ecSmrg/*
75905b261ecSmrg * Destroy a mode.
76005b261ecSmrg */
76105b261ecSmrg
7626747b715Smrgextern _X_EXPORT void
763f7df2e56Smrg RRModeDestroy(RRModePtr mode);
76405b261ecSmrg
76505b261ecSmrg/*
76605b261ecSmrg * Return a list of modes that are valid for some output in pScreen
76705b261ecSmrg */
768f7df2e56Smrgextern _X_EXPORT RRModePtr *RRModesForScreen(ScreenPtr pScreen, int *num_ret);
769f7df2e56Smrg
77005b261ecSmrg/*
77105b261ecSmrg * Initialize mode type
77205b261ecSmrg */
7736747b715Smrgextern _X_EXPORT Bool
774f7df2e56Smrg RRModeInit(void);
7756747b715Smrg
7766747b715Smrg/*
7776747b715Smrg * Initialize mode type error value
7786747b715Smrg */
7796747b715Smrgextern _X_EXPORT void
780f7df2e56Smrg RRModeInitErrorValue(void);
781f7df2e56Smrg
7826747b715Smrgextern _X_EXPORT int
783f7df2e56Smrg ProcRRCreateMode(ClientPtr client);
78405b261ecSmrg
7856747b715Smrgextern _X_EXPORT int
786f7df2e56Smrg ProcRRDestroyMode(ClientPtr client);
78705b261ecSmrg
7886747b715Smrgextern _X_EXPORT int
789f7df2e56Smrg ProcRRAddOutputMode(ClientPtr client);
79005b261ecSmrg
7916747b715Smrgextern _X_EXPORT int
792f7df2e56Smrg ProcRRDeleteOutputMode(ClientPtr client);
79305b261ecSmrg
79405b261ecSmrg/* rroutput.c */
79505b261ecSmrg
79605b261ecSmrg/*
79705b261ecSmrg * Notify the output of some change. configChanged indicates whether
79805b261ecSmrg * any external configuration (mode list, clones, connected status)
79905b261ecSmrg * has changed, or whether the change was strictly internal
80005b261ecSmrg * (which crtc is in use)
80105b261ecSmrg */
8026747b715Smrgextern _X_EXPORT void
803f7df2e56Smrg RROutputChanged(RROutputPtr output, Bool configChanged);
80405b261ecSmrg
80505b261ecSmrg/*
80605b261ecSmrg * Create an output
80705b261ecSmrg */
80805b261ecSmrg
8096747b715Smrgextern _X_EXPORT RROutputPtr
810f7df2e56SmrgRROutputCreate(ScreenPtr pScreen,
811f7df2e56Smrg               const char *name, int nameLength, void *devPrivate);
81205b261ecSmrg
81305b261ecSmrg/*
81405b261ecSmrg * Notify extension that output parameters have been changed
81505b261ecSmrg */
8166747b715Smrgextern _X_EXPORT Bool
817f7df2e56Smrg RROutputSetClones(RROutputPtr output, RROutputPtr * clones, int numClones);
81805b261ecSmrg
8196747b715Smrgextern _X_EXPORT Bool
820f7df2e56Smrg
821f7df2e56SmrgRROutputSetModes(RROutputPtr output,
822f7df2e56Smrg                 RRModePtr * modes, int numModes, int numPreferred);
82305b261ecSmrg
8246747b715Smrgextern _X_EXPORT int
825f7df2e56Smrg RROutputAddUserMode(RROutputPtr output, RRModePtr mode);
82605b261ecSmrg
8276747b715Smrgextern _X_EXPORT int
828f7df2e56Smrg RROutputDeleteUserMode(RROutputPtr output, RRModePtr mode);
82905b261ecSmrg
8306747b715Smrgextern _X_EXPORT Bool
831f7df2e56Smrg RROutputSetCrtcs(RROutputPtr output, RRCrtcPtr * crtcs, int numCrtcs);
83205b261ecSmrg
8336747b715Smrgextern _X_EXPORT Bool
834f7df2e56Smrg RROutputSetConnection(RROutputPtr output, CARD8 connection);
83505b261ecSmrg
8366747b715Smrgextern _X_EXPORT Bool
837f7df2e56Smrg RROutputSetSubpixelOrder(RROutputPtr output, int subpixelOrder);
83805b261ecSmrg
8396747b715Smrgextern _X_EXPORT Bool
840f7df2e56Smrg RROutputSetPhysicalSize(RROutputPtr output, int mmWidth, int mmHeight);
84105b261ecSmrg
8426747b715Smrgextern _X_EXPORT void
843f7df2e56Smrg RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output);
84405b261ecSmrg
8456747b715Smrgextern _X_EXPORT void
846f7df2e56Smrg RROutputDestroy(RROutputPtr output);
84705b261ecSmrg
8486747b715Smrgextern _X_EXPORT int
849f7df2e56Smrg ProcRRGetOutputInfo(ClientPtr client);
85005b261ecSmrg
8516747b715Smrgextern _X_EXPORT int
852f7df2e56Smrg ProcRRSetOutputPrimary(ClientPtr client);
8534642e01fSmrg
8546747b715Smrgextern _X_EXPORT int
855f7df2e56Smrg ProcRRGetOutputPrimary(ClientPtr client);
8564642e01fSmrg
85705b261ecSmrg/*
85805b261ecSmrg * Initialize output type
85905b261ecSmrg */
8606747b715Smrgextern _X_EXPORT Bool
861f7df2e56Smrg RROutputInit(void);
8626747b715Smrg
8636747b715Smrg/*
8646747b715Smrg * Initialize output type error value
8656747b715Smrg */
8666747b715Smrgextern _X_EXPORT void
867f7df2e56Smrg RROutputInitErrorValue(void);
868f7df2e56Smrg
86905b261ecSmrg/* rrpointer.c */
8706747b715Smrgextern _X_EXPORT void
871f7df2e56Smrg RRPointerMoved(ScreenPtr pScreen, int x, int y);
87205b261ecSmrg
8736747b715Smrgextern _X_EXPORT void
874f7df2e56Smrg RRPointerScreenConfigured(ScreenPtr pScreen);
87505b261ecSmrg
87605b261ecSmrg/* rrproperty.c */
87705b261ecSmrg
8786747b715Smrgextern _X_EXPORT void
879f7df2e56Smrg RRDeleteAllOutputProperties(RROutputPtr output);
88005b261ecSmrg
8816747b715Smrgextern _X_EXPORT RRPropertyValuePtr
882f7df2e56SmrgRRGetOutputProperty(RROutputPtr output, Atom property, Bool pending);
88305b261ecSmrg
8846747b715Smrgextern _X_EXPORT RRPropertyPtr
885f7df2e56SmrgRRQueryOutputProperty(RROutputPtr output, Atom property);
886f7df2e56Smrg
8876747b715Smrgextern _X_EXPORT void
888f7df2e56Smrg RRDeleteOutputProperty(RROutputPtr output, Atom property);
88905b261ecSmrg
8906747b715Smrgextern _X_EXPORT Bool
891f7df2e56Smrg RRPostPendingProperties(RROutputPtr output);
892f7df2e56Smrg
8936747b715Smrgextern _X_EXPORT int
894f7df2e56Smrg
895f7df2e56SmrgRRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
896f7df2e56Smrg                       int format, int mode, unsigned long len,
897f7df2e56Smrg                       void *value, Bool sendevent, Bool pending);
89805b261ecSmrg
8996747b715Smrgextern _X_EXPORT int
900f7df2e56Smrg
901f7df2e56SmrgRRConfigureOutputProperty(RROutputPtr output, Atom property,
902f7df2e56Smrg                          Bool pending, Bool range, Bool immutable,
903f7df2e56Smrg                          int num_values, INT32 *values);
9046747b715Smrgextern _X_EXPORT int
905f7df2e56Smrg ProcRRChangeOutputProperty(ClientPtr client);
90605b261ecSmrg
9076747b715Smrgextern _X_EXPORT int
908f7df2e56Smrg ProcRRGetOutputProperty(ClientPtr client);
90905b261ecSmrg
9106747b715Smrgextern _X_EXPORT int
911f7df2e56Smrg ProcRRListOutputProperties(ClientPtr client);
91205b261ecSmrg
9136747b715Smrgextern _X_EXPORT int
914f7df2e56Smrg ProcRRQueryOutputProperty(ClientPtr client);
91505b261ecSmrg
9166747b715Smrgextern _X_EXPORT int
917f7df2e56Smrg ProcRRConfigureOutputProperty(ClientPtr client);
91805b261ecSmrg
9196747b715Smrgextern _X_EXPORT int
920f7df2e56Smrg ProcRRDeleteOutputProperty(ClientPtr client);
921f7df2e56Smrg
922f7df2e56Smrg/* rrprovider.c */
923f7df2e56Smrgextern _X_EXPORT void
924f7df2e56SmrgRRProviderInitErrorValue(void);
92505b261ecSmrg
926f7df2e56Smrgextern _X_EXPORT int
927f7df2e56SmrgProcRRGetProviders(ClientPtr client);
928f7df2e56Smrg
929f7df2e56Smrgextern _X_EXPORT int
930f7df2e56SmrgProcRRGetProviderInfo(ClientPtr client);
931f7df2e56Smrg
932f7df2e56Smrgextern _X_EXPORT int
933f7df2e56SmrgProcRRSetProviderOutputSource(ClientPtr client);
934f7df2e56Smrg
935f7df2e56Smrgextern _X_EXPORT int
936f7df2e56SmrgProcRRSetProviderOffloadSink(ClientPtr client);
937f7df2e56Smrg
938f7df2e56Smrgextern _X_EXPORT Bool
939f7df2e56SmrgRRProviderInit(void);
940f7df2e56Smrg
941f7df2e56Smrgextern _X_EXPORT RRProviderPtr
942f7df2e56SmrgRRProviderCreate(ScreenPtr pScreen, const char *name,
943f7df2e56Smrg                 int nameLength);
944f7df2e56Smrg
945f7df2e56Smrgextern _X_EXPORT void
946f7df2e56SmrgRRProviderDestroy (RRProviderPtr provider);
947f7df2e56Smrg
948f7df2e56Smrgextern _X_EXPORT void
949f7df2e56SmrgRRProviderSetCapabilities(RRProviderPtr provider, uint32_t capabilities);
950f7df2e56Smrg
951f7df2e56Smrgextern _X_EXPORT Bool
952f7df2e56SmrgRRProviderLookup(XID id, RRProviderPtr *provider_p);
953f7df2e56Smrg
954f7df2e56Smrgextern _X_EXPORT void
955f7df2e56SmrgRRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider);
956f7df2e56Smrg
957f7df2e56Smrg/* rrproviderproperty.c */
958f7df2e56Smrg
959f7df2e56Smrgextern _X_EXPORT void
960f7df2e56Smrg RRDeleteAllProviderProperties(RRProviderPtr provider);
961f7df2e56Smrg
962f7df2e56Smrgextern _X_EXPORT RRPropertyValuePtr
963f7df2e56Smrg RRGetProviderProperty(RRProviderPtr provider, Atom property, Bool pending);
964f7df2e56Smrg
965f7df2e56Smrgextern _X_EXPORT RRPropertyPtr
966f7df2e56Smrg RRQueryProviderProperty(RRProviderPtr provider, Atom property);
967f7df2e56Smrg
968f7df2e56Smrgextern _X_EXPORT void
969f7df2e56Smrg RRDeleteProviderProperty(RRProviderPtr provider, Atom property);
970f7df2e56Smrg
971f7df2e56Smrgextern _X_EXPORT int
972f7df2e56SmrgRRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type,
973f7df2e56Smrg                       int format, int mode, unsigned long len,
974f7df2e56Smrg                       void *value, Bool sendevent, Bool pending);
975f7df2e56Smrg
976f7df2e56Smrgextern _X_EXPORT int
977f7df2e56Smrg RRConfigureProviderProperty(RRProviderPtr provider, Atom property,
978f7df2e56Smrg                             Bool pending, Bool range, Bool immutable,
979f7df2e56Smrg                             int num_values, INT32 *values);
980f7df2e56Smrg
981f7df2e56Smrgextern _X_EXPORT Bool
982f7df2e56Smrg RRPostProviderPendingProperties(RRProviderPtr provider);
983f7df2e56Smrg
984f7df2e56Smrgextern _X_EXPORT int
985f7df2e56Smrg ProcRRGetProviderProperty(ClientPtr client);
986f7df2e56Smrg
987f7df2e56Smrgextern _X_EXPORT int
988f7df2e56Smrg ProcRRListProviderProperties(ClientPtr client);
989f7df2e56Smrg
990f7df2e56Smrgextern _X_EXPORT int
991f7df2e56Smrg ProcRRQueryProviderProperty(ClientPtr client);
992f7df2e56Smrg
993f7df2e56Smrgextern _X_EXPORT int
994f7df2e56SmrgProcRRConfigureProviderProperty(ClientPtr client);
995f7df2e56Smrg
996f7df2e56Smrgextern _X_EXPORT int
997f7df2e56SmrgProcRRChangeProviderProperty(ClientPtr client);
998f7df2e56Smrg
999f7df2e56Smrgextern _X_EXPORT int
1000f7df2e56Smrg ProcRRDeleteProviderProperty(ClientPtr client);
100105b261ecSmrg/* rrxinerama.c */
10026747b715Smrg#ifdef XINERAMA
10036747b715Smrgextern _X_EXPORT void
1004f7df2e56Smrg RRXineramaExtensionInit(void);
10056747b715Smrg#endif
100605b261ecSmrg
1007f7df2e56Smrgvoid
1008f7df2e56SmrgRRMonitorInit(ScreenPtr screen);
1009f7df2e56Smrg
1010f7df2e56SmrgBool
1011f7df2e56SmrgRRMonitorMakeList(ScreenPtr screen, Bool get_active, RRMonitorPtr *monitors_ret, int *nmon_ret);
1012f7df2e56Smrg
1013f7df2e56Smrgint
1014f7df2e56SmrgRRMonitorCountList(ScreenPtr screen);
1015f7df2e56Smrg
1016f7df2e56Smrgvoid
1017f7df2e56SmrgRRMonitorFreeList(RRMonitorPtr monitors, int nmon);
1018f7df2e56Smrg
1019f7df2e56Smrgvoid
1020f7df2e56SmrgRRMonitorClose(ScreenPtr screen);
1021f7df2e56Smrg
1022f7df2e56SmrgRRMonitorPtr
1023f7df2e56SmrgRRMonitorAlloc(int noutput);
1024f7df2e56Smrg
1025f7df2e56Smrgint
1026f7df2e56SmrgRRMonitorAdd(ClientPtr client, ScreenPtr screen, RRMonitorPtr monitor);
1027f7df2e56Smrg
1028f7df2e56Smrgvoid
1029f7df2e56SmrgRRMonitorFree(RRMonitorPtr monitor);
1030f7df2e56Smrg
1031f7df2e56Smrgint
1032f7df2e56SmrgProcRRGetMonitors(ClientPtr client);
1033f7df2e56Smrg
1034f7df2e56Smrgint
1035f7df2e56SmrgProcRRSetMonitor(ClientPtr client);
1036f7df2e56Smrg
1037f7df2e56Smrgint
1038f7df2e56SmrgProcRRDeleteMonitor(ClientPtr client);
1039f7df2e56Smrg
1040f7df2e56Smrg#endif                          /* _RANDRSTR_H_ */
104105b261ecSmrg
104205b261ecSmrg/*
1043f7df2e56Smrg
104405b261ecSmrgrandr extension implementation structure
104505b261ecSmrg
104605b261ecSmrgQuery state:
104705b261ecSmrg    ProcRRGetScreenInfo/ProcRRGetScreenResources
104805b261ecSmrg	RRGetInfo
1049f7df2e56Smrg
105005b261ecSmrg	    • Request configuration from driver, either 1.0 or 1.2 style
105105b261ecSmrg	    • These functions only record state changes, all
105205b261ecSmrg	      other actions are pended until RRTellChanged is called
1053f7df2e56Smrg
105405b261ecSmrg	    ->rrGetInfo
105505b261ecSmrg	    1.0:
105605b261ecSmrg		RRRegisterSize
105705b261ecSmrg		RRRegisterRate
105805b261ecSmrg		RRSetCurrentConfig
105905b261ecSmrg	    1.2:
106005b261ecSmrg		RRScreenSetSizeRange
106105b261ecSmrg		RROutputSetCrtcs
106205b261ecSmrg		RRModeGet
106305b261ecSmrg		RROutputSetModes
106405b261ecSmrg		RROutputSetConnection
106505b261ecSmrg		RROutputSetSubpixelOrder
106605b261ecSmrg		RROutputSetClones
106705b261ecSmrg		RRCrtcNotify
1068f7df2e56Smrg
106905b261ecSmrg	• Must delay scanning configuration until after ->rrGetInfo returns
107005b261ecSmrg	  because some drivers will call SetCurrentConfig in the middle
107105b261ecSmrg	  of the ->rrGetInfo operation.
1072f7df2e56Smrg
107305b261ecSmrg	1.0:
107405b261ecSmrg
107505b261ecSmrg	    • Scan old configuration, mirror to new structures
1076f7df2e56Smrg
107705b261ecSmrg	    RRScanOldConfig
107805b261ecSmrg		RRCrtcCreate
107905b261ecSmrg		RROutputCreate
108005b261ecSmrg		RROutputSetCrtcs
108105b261ecSmrg		RROutputSetConnection
108205b261ecSmrg		RROutputSetSubpixelOrder
108305b261ecSmrg		RROldModeAdd	• This adds modes one-at-a-time
108405b261ecSmrg		    RRModeGet
108505b261ecSmrg		RRCrtcNotify
1086f7df2e56Smrg
108705b261ecSmrg	• send events, reset pointer if necessary
1088f7df2e56Smrg
108905b261ecSmrg	RRTellChanged
109005b261ecSmrg	    WalkTree (sending events)
1091f7df2e56Smrg
109205b261ecSmrg	    • when layout has changed:
109305b261ecSmrg		RRPointerScreenConfigured
109405b261ecSmrg		RRSendConfigNotify
1095f7df2e56Smrg
109605b261ecSmrgAsynchronous state setting (1.2 only)
109705b261ecSmrg    When setting state asynchronously, the driver invokes the
109805b261ecSmrg    ->rrGetInfo function and then calls RRTellChanged to flush
109905b261ecSmrg    the changes to the clients and reset pointer if necessary
110005b261ecSmrg
110105b261ecSmrgSet state
110205b261ecSmrg
110305b261ecSmrg    ProcRRSetScreenConfig
110405b261ecSmrg	RRCrtcSet
110505b261ecSmrg	    1.2:
110605b261ecSmrg		->rrCrtcSet
110705b261ecSmrg		    RRCrtcNotify
110805b261ecSmrg	    1.0:
110905b261ecSmrg		->rrSetConfig
111005b261ecSmrg		RRCrtcNotify
111105b261ecSmrg	    RRTellChanged
111205b261ecSmrg */
1113