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, HP Labs, Hewlett-Packard, Inc.
26 * Keith Packard, Intel Corporation
27 */
28
29#ifndef _RANDR_H_
30#define _RANDR_H_
31
32typedef unsigned short Rotation;
33typedef unsigned short SizeID;
34typedef unsigned short SubpixelOrder;
35typedef unsigned short Connection;
36typedef unsigned short XRandrRotation;
37typedef unsigned short XRandrSizeID;
38typedef unsigned short XRandrSubpixelOrder;
39typedef unsigned long XRandrModeFlags;
40
41#define RANDR_NAME "RANDR"
42#define RANDR_MAJOR 1
43#define RANDR_MINOR 5
44
45#define RRNumberErrors 4
46#define RRNumberEvents 2
47#define RRNumberRequests 45
48
49#define X_RRQueryVersion 0
50/* we skip 1 to make old clients fail pretty immediately */
51#define X_RROldGetScreenInfo 1
52#define X_RR1_0SetScreenConfig 2
53/* V1.0 apps share the same set screen config request id */
54#define X_RRSetScreenConfig 2
55#define X_RROldScreenChangeSelectInput 3
56/* 3 used to be ScreenChangeSelectInput; deprecated */
57#define X_RRSelectInput 4
58#define X_RRGetScreenInfo 5
59
60/* V1.2 additions */
61#define X_RRGetScreenSizeRange 6
62#define X_RRSetScreenSize 7
63#define X_RRGetScreenResources 8
64#define X_RRGetOutputInfo 9
65#define X_RRListOutputProperties 10
66#define X_RRQueryOutputProperty 11
67#define X_RRConfigureOutputProperty 12
68#define X_RRChangeOutputProperty 13
69#define X_RRDeleteOutputProperty 14
70#define X_RRGetOutputProperty 15
71#define X_RRCreateMode 16
72#define X_RRDestroyMode 17
73#define X_RRAddOutputMode 18
74#define X_RRDeleteOutputMode 19
75#define X_RRGetCrtcInfo 20
76#define X_RRSetCrtcConfig 21
77#define X_RRGetCrtcGammaSize 22
78#define X_RRGetCrtcGamma 23
79#define X_RRSetCrtcGamma 24
80
81/* V1.3 additions */
82#define X_RRGetScreenResourcesCurrent 25
83#define X_RRSetCrtcTransform 26
84#define X_RRGetCrtcTransform 27
85#define X_RRGetPanning 28
86#define X_RRSetPanning 29
87#define X_RRSetOutputPrimary 30
88#define X_RRGetOutputPrimary 31
89
90#define RRTransformUnit (1L << 0)
91#define RRTransformScaleUp (1L << 1)
92#define RRTransformScaleDown (1L << 2)
93#define RRTransformProjective (1L << 3)
94
95/* v1.4 */
96#define X_RRGetProviders 32
97#define X_RRGetProviderInfo 33
98#define X_RRSetProviderOffloadSink 34
99#define X_RRSetProviderOutputSource 35
100#define X_RRListProviderProperties 36
101#define X_RRQueryProviderProperty 37
102#define X_RRConfigureProviderProperty 38
103#define X_RRChangeProviderProperty 39
104#define X_RRDeleteProviderProperty 40
105#define X_RRGetProviderProperty 41
106
107/* v1.5 */
108#define X_RRGetMonitors 42
109#define X_RRSetMonitor 43
110#define X_RRDeleteMonitor 44
111
112/* Event selection bits */
113#define RRScreenChangeNotifyMask (1L << 0)
114/* V1.2 additions */
115#define RRCrtcChangeNotifyMask (1L << 1)
116#define RROutputChangeNotifyMask (1L << 2)
117#define RROutputPropertyNotifyMask (1L << 3)
118/* V1.4 additions */
119#define RRProviderChangeNotifyMask (1L << 4)
120#define RRProviderPropertyNotifyMask (1L << 5)
121#define RRResourceChangeNotifyMask (1L << 6)
122
123/* Event codes */
124#define RRScreenChangeNotify 0
125/* V1.2 additions */
126#define RRNotify 1
127/* RRNotify Subcodes */
128#define RRNotify_CrtcChange 0
129#define RRNotify_OutputChange 1
130#define RRNotify_OutputProperty 2
131#define RRNotify_ProviderChange 3
132#define RRNotify_ProviderProperty 4
133#define RRNotify_ResourceChange 5
134/* used in the rotation field; rotation and reflection in 0.1 proto. */
135#define RR_Rotate_0 1
136#define RR_Rotate_90 2
137#define RR_Rotate_180 4
138#define RR_Rotate_270 8
139
140/* new in 1.0 protocol, to allow reflection of screen */
141
142#define RR_Reflect_X 16
143#define RR_Reflect_Y 32
144
145#define RRSetConfigSuccess 0
146#define RRSetConfigInvalidConfigTime 1
147#define RRSetConfigInvalidTime 2
148#define RRSetConfigFailed 3
149
150/* new in 1.2 protocol */
151
152#define RR_HSyncPositive 0x00000001
153#define RR_HSyncNegative 0x00000002
154#define RR_VSyncPositive 0x00000004
155#define RR_VSyncNegative 0x00000008
156#define RR_Interlace 0x00000010
157#define RR_DoubleScan 0x00000020
158#define RR_CSync 0x00000040
159#define RR_CSyncPositive 0x00000080
160#define RR_CSyncNegative 0x00000100
161#define RR_HSkewPresent 0x00000200
162#define RR_BCast 0x00000400
163#define RR_PixelMultiplex 0x00000800
164#define RR_DoubleClock 0x00001000
165#define RR_ClockDivideBy2 0x00002000
166
167#define RR_Connected 0
168#define RR_Disconnected 1
169#define RR_UnknownConnection 2
170
171#define BadRROutput 0
172#define BadRRCrtc 1
173#define BadRRMode 2
174#define BadRRProvider 3
175
176/* Conventional RandR output properties */
177
178#define RR_PROPERTY_BACKLIGHT "Backlight"
179#define RR_PROPERTY_RANDR_EDID "EDID"
180#define RR_PROPERTY_SIGNAL_FORMAT "SignalFormat"
181#define RR_PROPERTY_SIGNAL_PROPERTIES "SignalProperties"
182#define RR_PROPERTY_CONNECTOR_TYPE "ConnectorType"
183#define RR_PROPERTY_CONNECTOR_NUMBER "ConnectorNumber"
184#define RR_PROPERTY_COMPATIBILITY_LIST "CompatibilityList"
185#define RR_PROPERTY_CLONE_LIST "CloneList"
186#define RR_PROPERTY_BORDER "Border"
187#define RR_PROPERTY_BORDER_DIMENSIONS "BorderDimensions"
188#define RR_PROPERTY_GUID "GUID"
189#define RR_PROPERTY_RANDR_TILE "TILE"
190
191/* roles this device can carry out */
192#define RR_Capability_None 0
193#define RR_Capability_SourceOutput 1
194#define RR_Capability_SinkOutput 2
195#define RR_Capability_SourceOffload 4
196#define RR_Capability_SinkOffload 8
197
198#endif /* _RANDR_H_ */
199