VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.6.99-20090831/randrstr.h@ 23298

Last change on this file since 23298 was 22658, checked in by vboxsync, 15 years ago

export Xorg 1.6.99 headers to OSE

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette