117ca54c3Smrg	       The X Resize, Rotate and Reflect Extension
217ca54c3Smrg			     Version 1.6.0
317ca54c3Smrg			       2017-04-01
417ca54c3Smrg
517ca54c3Smrg			      Jim Gettys
617ca54c3Smrg			   Jim.Gettys@hp.com
717ca54c3Smrg		     Cambridge Research Laboratory
817ca54c3Smrg				HP Labs
917ca54c3Smrg			Hewlett Packard Company
1017ca54c3Smrg
1117ca54c3Smrg			     Keith Packard
1217ca54c3Smrg			  keithp@keithp.com
1317ca54c3Smrg
1417ca54c3Smrg1. Introduction
1517ca54c3Smrg
1617ca54c3SmrgThe X Resize, Rotate and Reflect Extension, called RandR for short,
1717ca54c3Smrgbrings the ability to resize, rotate and reflect the root window of a
1817ca54c3Smrgscreen. It is based on the X Resize and Rotate Extension as specified
1917ca54c3Smrgin the Proceedings of the 2001 Usenix Technical Conference [RANDR].
2017ca54c3Smrg
2117ca54c3SmrgRandR as implemented and integrated into the X server differs in
2217ca54c3Smrgone substantial fashion from the design discussed in that paper: that
2317ca54c3Smrgis, RandR 1.0 does not implement the depth switching described in that
2417ca54c3Smrgdocument, and the support described for that in the protocol in that
2517ca54c3Smrgdocument and in the implementation has been removed from the
2617ca54c3Smrgprotocol described here, as it has been overtaken by events.
2717ca54c3Smrg
2817ca54c3SmrgThese events include:
2917ca54c3Smrg      ► Modern toolkits (in this case, GTK+ 2.x) have progressed to the point
3017ca54c3Smrg	of implementing migration between screens of arbitrary depths
3117ca54c3Smrg      ► The continued advance of Moore's law has made limited amounts of VRAM
3217ca54c3Smrg	less of an issue, reducing the pressure to implement depth switching
3317ca54c3Smrg	on laptops or desktop systems
3417ca54c3Smrg      ► The continued decline of legacy toolkits whose design would have
3517ca54c3Smrg	required depth switching to support migration
3617ca54c3Smrg      ► The lack of depth switching implementation experience in the
3717ca54c3Smrg	intervening time, due to events beyond our control
3817ca54c3Smrg
3917ca54c3SmrgAdditionally, the requirement to support depth switching might
4017ca54c3Smrgcomplicate other re-engineering of the device independent part of the
4117ca54c3SmrgX server that is currently being contemplated.
4217ca54c3Smrg
4317ca54c3SmrgRather than further delaying RandR's widespread deployment for a feature
4417ca54c3Smrglong wanted by the community (resizing of screens, particularly on laptops),
4517ca54c3Smrgor the deployment of a protocol design that might be flawed due to lack of
4617ca54c3Smrgimplementation experience, we decided to remove depth switching from the
4717ca54c3Smrgprotocol. It may be implemented at a later time if resources and
4817ca54c3Smrginterests permit as a revision to the protocol described here, which will
4917ca54c3Smrgremain a stable base for applications. The protocol described here has been
5017ca54c3Smrgimplemented in the main X.org server, and more fully in the hw/kdrive
5117ca54c3Smrgimplementation in the distribution, which fully implements resizing,
5217ca54c3Smrgrotation and reflection.
5317ca54c3Smrg
5417ca54c3Smrg1.2 Introduction to version 1.2 of the extension
5517ca54c3Smrg
5617ca54c3SmrgOne of the significant limitations found in version 1.1 of the RandR
5717ca54c3Smrgprotocol was the inability to deal with the Xinerama model where multiple
5817ca54c3Smrgmonitors display portions of a common underlying screen. In this environment,
5917ca54c3Smrgzero or more video outputs are associated with each CRT controller which
6017ca54c3Smrgdefines both a set of video timings and a 'viewport' within the larger
6117ca54c3Smrgscreen. This viewport is independent of the overall size of the screen, and
6217ca54c3Smrgmay be located anywhere within the screen.
6317ca54c3Smrg
6417ca54c3SmrgThe effect is to decouple the reported size of the screen from the size
6517ca54c3Smrgpresented by each video output, and to permit multiple outputs to present
6617ca54c3Smrginformation for a single screen.
6717ca54c3Smrg
6817ca54c3SmrgTo extend RandR for this model, we separate out the output, CRTC and screen
6917ca54c3Smrgconfiguration information and permit them to be configured separately. For
7017ca54c3Smrgcompatibility with the 1.1 version of the protocol, we make the 1.1 requests
7117ca54c3Smrgsimultaneously affect both the screen and the (presumably sole) CRTC and
7217ca54c3Smrgoutput. The set of available outputs are presented with UTF-8 encoded names
7317ca54c3Smrgand may be connected to CRTCs as permitted by the underlying hardware. CRTC
7417ca54c3Smrgconfiguration is now done with full mode information instead of just size
7517ca54c3Smrgand refresh rate, and these modes have names. These names also use UTF-8
7617ca54c3Smrgencoding. New modes may also be added by the user.
7717ca54c3Smrg
7817ca54c3SmrgAdditional requests and events are provided for this new functionality.
7917ca54c3Smrg
8017ca54c3Smrg       ┌────────────────────────────────┬──────────┐
8117ca54c3Smrg    ┏━━━━━━━┳───────────────┐       ╔════════╗ ╔════════╗
8217ca54c3Smrg    ┃   1   ┃               │       ║   A    ║ ║   B    ║
8317ca54c3Smrg    ┃   ┏━━━╋━━━━━━━━━━━━━━━┫       ║        ║ ║        ║
8417ca54c3Smrg    ┣━━━╋━━━┛               ┃       ╚════════╝ ╚════════╝
8517ca54c3Smrg    │   ┃         2         ┃─────────────────┐
8617ca54c3Smrg    │   ┃                   ┃        ╔═══════════════════╗
8717ca54c3Smrg    │   ┃                   ┃        ║                   ║
8817ca54c3Smrg    │   ┗━━━━━━━━━━━━━━━━━━━┫        ║        C          ║
8917ca54c3Smrg    └───────────────────────┘        ║                   ║
9017ca54c3Smrg    ┌──────┐  ┏━━━━┓  ╔══════╗       ║                   ║
9117ca54c3Smrg    │screen│  ┃CRTC┃  ║output║       ╚═══════════════════╝
9217ca54c3Smrg    └──────┘  ┗━━━━┛  ╚══════╝
9317ca54c3Smrg
9417ca54c3SmrgIn this picture, the screen is covered (incompletely) by two CRTCs. CRTC1
9517ca54c3Smrgis connected to two outputs, A and B. CRTC2 is connected to output C.
9617ca54c3SmrgOutputs A and B will present exactly the same region of the screen using
9717ca54c3Smrgthe same mode line. Output C will present a different (larger) region of
9817ca54c3Smrgthe screen using a different mode line.
9917ca54c3Smrg
10017ca54c3SmrgRandR provides information about each available CRTC and output; the
10117ca54c3Smrgconnection between CRTC and output is under application control, although
10217ca54c3Smrgthe hardware will probably impose restrictions on the possible
10317ca54c3Smrgconfigurations. The protocol doesn't try to describe these restrictions,
10417ca54c3Smrginstead it provides a mechanism to find out what combinations are supported.
10517ca54c3Smrg
10617ca54c3Smrg1.3 Introduction to version 1.3 of the extension
10717ca54c3Smrg
10817ca54c3SmrgVersion 1.3 builds on the changes made with version 1.2 and adds some new
10917ca54c3Smrgcapabilities without fundamentally changing the extension again. The
11017ca54c3Smrgfollowing features are added in this version:
11117ca54c3Smrg
11217ca54c3Smrg   • Projective Transforms. The implementation work for general rotation
11317ca54c3Smrg     support made it trivial to add full projective transformations. These
11417ca54c3Smrg     can be used to scale the screen up/down as well as perform projector
11517ca54c3Smrg     keystone correct or other effects.
11617ca54c3Smrg
11717ca54c3Smrg   • Panning. It was removed with RandR 1.2 because the old semantics didn't
11817ca54c3Smrg     fit any longer. With RandR 1.3 panning can be specified per crtc.
11917ca54c3Smrg
12017ca54c3Smrg1.4 Introduction to version 1.4 of the extension
12117ca54c3Smrg
12217ca54c3SmrgVersion 1.4 adds an optional Border property.
12317ca54c3Smrg
12417ca54c3Smrg   • An optional Border property. This property allows a client to
12517ca54c3Smrg     specify that the viewport of the CRTC is smaller than the active
12617ca54c3Smrg     display region described its mode.  This is useful, for example,
12717ca54c3Smrg     for compensating for the overscan behavior of certain
12817ca54c3Smrg     televisions.
12917ca54c3Smrg
13017ca54c3SmrgVersion 1.4 adds a new object called a provider object. A provider object
13117ca54c3Smrgrepresents a GPU or virtual device providing services to the X server.
13217ca54c3SmrgProviders have a set of abilities and a set of possible roles.
13317ca54c3Smrg
13417ca54c3SmrgProvider objects are used to control multi-GPU systems. Provider roles can
13517ca54c3Smrgbe dynamically configured to provide support for:
13617ca54c3Smrg
13717ca54c3Smrg 1) Output slaving: plug in a USB device, but have its output rendered
13817ca54c3Smrg using the main GPU. On some dual-GPU laptops, the second GPU isn't
13917ca54c3Smrg connected to the LVDS panel, so we need to use the first GPU as an output
14017ca54c3Smrg slave for the second GPU. 
14117ca54c3Smrg
14217ca54c3Smrg 2) offload - For dual-GPU laptops, allow direct rendered applications to be run
14317ca54c3Smrg on the second GPU and display on the first GPU.
14417ca54c3Smrg
14517ca54c3Smrg 3) GPU switching - Allow switching between two GPUs as the main screen
14617ca54c3Smrg renderer.
14717ca54c3Smrg
14817ca54c3Smrg 4) multiple GPU rendering - This replaces Xinerama.
14917ca54c3Smrg
15017ca54c3Smrg1.5. Introduction to version 1.5 of the extension
15117ca54c3Smrg
15217ca54c3SmrgVersion 1.5 adds an optional TILE property to outputs.
15317ca54c3Smrg
15417ca54c3Smrg   • An optional TILE property.
15517ca54c3Smrg     This property is used to denote individual tiles in a tiled monitor
15617ca54c3Smrg     configuration, as exposed via DisplayID v1.3.
15717ca54c3Smrg
15817ca54c3SmrgVersion 1.5 adds monitors
15917ca54c3Smrg
16017ca54c3Smrg • A 'Monitor' is a rectangular subset of the screen which represents
16117ca54c3Smrg   a coherent collection of pixels presented to the user.
16217ca54c3Smrg
16317ca54c3Smrg • Each Monitor is associated with a list of outputs (which may be
16417ca54c3Smrg   empty).
16517ca54c3Smrg
16617ca54c3Smrg • When clients define monitors, the associated outputs are removed from
16717ca54c3Smrg   existing Monitors. If removing the output causes the list for that
16817ca54c3Smrg   monitor to become empty, that monitor will be deleted.
16917ca54c3Smrg
17017ca54c3Smrg • For active CRTCs that have no output associated with any
17117ca54c3Smrg   client-defined Monitor, one server-defined monitor will
17217ca54c3Smrg   automatically be defined of the first Output associated with them.
17317ca54c3Smrg
17417ca54c3Smrg • When defining a monitor, setting the geometry to all zeros will
17517ca54c3Smrg   cause that monitor to dynamically track the bounding box of the
17617ca54c3Smrg   active outputs associated with them
17717ca54c3Smrg
17817ca54c3SmrgThis new object separates the physical configuration of the hardware
17917ca54c3Smrgfrom the logical subsets of the screen that applications should
18017ca54c3Smrgconsider as single viewable areas.
18117ca54c3Smrg
18217ca54c3Smrg1.5.1. Relationship between Monitors and Xinerama
18317ca54c3Smrg
18417ca54c3SmrgXinerama's information now comes from the Monitors instead of directly
18517ca54c3Smrgfrom the CRTCs. The Monitor marked as Primary will be listed first.
18617ca54c3Smrg
18717ca54c3Smrg1.5.2. Clarification of Output lifetimes
18817ca54c3Smrg
18917ca54c3SmrgWith dynamic connectors being a possibility with the introduction of
19017ca54c3SmrgDisplayPort multistream (MST), a lot of RandR clients can't handle the
19117ca54c3SmrgXID BadMatch when a RandR output disappears. This is to clarify that
19217ca54c3Smrggoing forward the X server will not remove outputs dynamically,
19317ca54c3Smrgjust mark them as disconnected.
19417ca54c3Smrg
19517ca54c3Smrg1.6. Introduction to version 1.6 of the extension
19617ca54c3Smrg
19717ca54c3SmrgVersion 1.6 adds resource leasing and non desktop output management.
19817ca54c3Smrg
19917ca54c3Smrg • A “Lease” is a collection of crtcs and outputs which are made
20017ca54c3Smrg   available to a client for direct access via kernel KMS and DRM
20117ca54c3Smrg   APIs. This is done by passing a suitable file descriptor back to
20217ca54c3Smrg   the client which has access to those resources. While leased, those
20317ca54c3Smrg   resources aren't used by the X server.
20417ca54c3Smrg
20517ca54c3Smrg • A “non-desktop” output is a device which should not normally be
20617ca54c3Smrg   considered as part of the desktop environment. Head-mounted
20717ca54c3Smrg   displays and the Apple "Touch Bar" are examples of such
20817ca54c3Smrg   devices. A desktop environment should be able to discover which
20917ca54c3Smrg   outputs are connected to such devices and, by default, not present
21017ca54c3Smrg   normal desktop applications on them. This is done by having
21117ca54c3Smrg   RRGetOutputInfo report such devices as Disconnected while reporting
21217ca54c3Smrg   all other information about the device correctly.
21317ca54c3Smrg
21417ca54c3Smrg1.99 Acknowledgments
21517ca54c3Smrg
21617ca54c3SmrgOur thanks to the contributors to the design found on the xpert mailing
21717ca54c3Smrglist, in particular:
21817ca54c3Smrg
21917ca54c3SmrgAlan Hourihane for work on the early implementation
22017ca54c3SmrgAndrew C. Aitchison for help with the XFree86 DDX implementation
22117ca54c3SmrgAndy Ritger for early questions about how mergefb/Xinerama work with RandR
22217ca54c3SmrgCarl Worth for editing the specification and Usenix paper
22317ca54c3SmrgDavid Dawes for XFree86 DDX integration work
22417ca54c3SmrgThomas Winischhofer for the hardware-accelerated SiS rotation implementation
22517ca54c3SmrgMatthew Tippett and Kevin Martin for splitting outputs and CRTCs to more
22617ca54c3Smrgfully expose what video hardware can do
22717ca54c3SmrgDave Airlie for the 1.4.0 protocol changes and for working through the
22817ca54c3Smrgimplications of MST monitors and encouraging the introduction of the
22917ca54c3Smrg'Monitor' concept.
23017ca54c3Smrg
23117ca54c3Smrg			      ❧❧❧❧❧❧❧❧❧❧❧
23217ca54c3Smrg
23317ca54c3Smrg2. Screen change model
23417ca54c3Smrg
23517ca54c3SmrgScreens may change dynamically, either under control of this extension, or
23617ca54c3Smrgdue to external events. Examples include: monitors being swapped, pressing a
23717ca54c3Smrgbutton to switch from internal display to an external monitor on a laptop,
23817ca54c3Smrgor, eventually, the hotplug of a display card entirely on buses such as
23917ca54c3SmrgCardbus or Express Card which permit hot-swap (which will require other work
24017ca54c3Smrgin addition to this extension).
24117ca54c3Smrg
24217ca54c3SmrgSince the screen configuration is dynamic and asynchronous to the client and
24317ca54c3Smrgmay change at any time RandR provides mechanisms to ensure that your clients
24417ca54c3Smrgview is up to date with the configuration possibilities of the moment and
24517ca54c3Smrgenforces applications that wish to control the configuration to prove that
24617ca54c3Smrgtheir information is up to date before honoring requests to change the
24717ca54c3Smrgscreen configuration (by requiring a timestamp on the request).
24817ca54c3Smrg
24917ca54c3SmrgInterested applications are notified whenever the screen configuration
25017ca54c3Smrgchanges, providing the current size of the screen and subpixel order (see
25117ca54c3Smrgthe Render extension [RENDER]), to enable proper rendering of subpixel
25217ca54c3Smrgdecimated client text to continue, along with a time stamp of the
25317ca54c3Smrgconfiguration change. A client must refresh its knowledge of the screen
25417ca54c3Smrgconfiguration before attempting to change the configuration after a
25517ca54c3Smrgnotification, or the request will fail.
25617ca54c3Smrg
25717ca54c3SmrgTo avoid multiplicative explosion between orientation, reflection and sizes,
25817ca54c3Smrgthe sizes are only those sizes in the normal (0) rotation.
25917ca54c3Smrg
26017ca54c3SmrgRotation and reflection and how they interact can be confusing. In Randr,
26117ca54c3Smrgthe coordinate system is rotated in a counter-clockwise direction relative
26217ca54c3Smrgto the normal orientation. Reflection is along the window system coordinate
26317ca54c3Smrgsystem, not the physical screen X and Y axis, so that rotation and
26417ca54c3Smrgreflection do not interact. The other way to consider reflection is to is
26517ca54c3Smrgspecified in the "normal" orientation, before rotation, if you find the
26617ca54c3Smrgother way confusing.
26717ca54c3Smrg
26817ca54c3SmrgWe expect that most clients and toolkits will be oblivious to changes to the
26917ca54c3Smrgscreen structure, as they generally use the values in the connections Display
27017ca54c3Smrgstructure directly. By toolkits updating the values on the fly, we believe
27117ca54c3Smrgpop-up menus and other pop up windows will position themselves correctly in
27217ca54c3Smrgthe face of screen configuration changes (the issue is ensuring that pop-ups
27317ca54c3Smrgare visible on the reconfigured screen).
27417ca54c3Smrg
27517ca54c3Smrg			      ❧❧❧❧❧❧❧❧❧❧❧
27617ca54c3Smrg
27717ca54c3Smrg3. Data Types
27817ca54c3Smrg
27917ca54c3SmrgThe subpixel order and transform data types are shared with the Render
28017ca54c3Smrgextension, and are documented there.
28117ca54c3Smrg
28217ca54c3SmrgThe only datatype defined in the original extension is the screen size,
28317ca54c3Smrgdefined in the normal (0 degree) orientation.  Several more are added
28417ca54c3Smrgin later revisions.
28517ca54c3Smrg
28617ca54c3Smrg			      ❧❧❧❧❧❧❧❧❧❧❧
28717ca54c3Smrg
28817ca54c3Smrg4. Errors
28917ca54c3Smrg
29017ca54c3SmrgErrors are sent using core X error reports.
29117ca54c3Smrg
29217ca54c3SmrgOutput
29317ca54c3Smrg	A value for an OUTPUT argument does not name a defined OUTPUT.
29417ca54c3SmrgCRTC
29517ca54c3Smrg	A value for a CRTC argument does not name a defined CRTC.
29617ca54c3SmrgMode
29717ca54c3Smrg	A value for a MODE argument does not name a defined MODE.
29817ca54c3SmrgProvider
29917ca54c3Smrg	A value for a PROVIDER argument does not name a defined PROVIDER.
30017ca54c3SmrgLease
30117ca54c3Smrg	A value for a LEASE argument does not name a defined LEASE
30217ca54c3Smrg
30317ca54c3Smrg			      ❧❧❧❧❧❧❧❧❧❧❧
30417ca54c3Smrg
30517ca54c3Smrg5. Protocol Types
30617ca54c3Smrg
30717ca54c3SmrgRRCONFIGSTATUS { Success
30817ca54c3Smrg		 InvalidConfigTime
30917ca54c3Smrg		 InvalidTime
31017ca54c3Smrg		 Failed }
31117ca54c3Smrg
31217ca54c3Smrg	A value of type RRCONFIGSTATUS returned when manipulating the output
31317ca54c3Smrg	configuration or querying information from the server that has some
31417ca54c3Smrg	time-dependency.
31517ca54c3Smrg
31617ca54c3Smrg	InvalidConfigTime indicates that the supplied configuration
31717ca54c3Smrg	timestamp does not match the current X server configuration
31817ca54c3Smrg	timestamp. Usually this means that the output configuration has
31917ca54c3Smrg	changed since the timestamp was received by the application.
32017ca54c3Smrg
32117ca54c3Smrg	InvalidTime indicates that the supplied output reconfiguration time
32217ca54c3Smrg	is earlier than the most recent output reconfiguration request.
32317ca54c3Smrg	Generally this indicates that another application has reconfigured
32417ca54c3Smrg	the output using a later timestamp.
32517ca54c3Smrg
32617ca54c3Smrg	Failed is returned whenever the operation is unsuccessful for some
32717ca54c3Smrg	other reason. This generally indicates that the requested output
32817ca54c3Smrg	configuration is unsupported by the hardware. The goal is to make
32917ca54c3Smrg	these limitations expressed by the protocol, but when that isn't
33017ca54c3Smrg	possible it is correct to return this error value. If, as a
33117ca54c3Smrg	implementer, you find this error code required, please submit the
33217ca54c3Smrg	hardware constraints that exist so that a future version of the
33317ca54c3Smrg	extension can correctly capture the configuration constraints in
33417ca54c3Smrg	your system.
33517ca54c3Smrg
33617ca54c3SmrgROTATION { Rotate_0
33717ca54c3Smrg	   Rotate_90
33817ca54c3Smrg	   Rotate_180
33917ca54c3Smrg	   Rotate_270
34017ca54c3Smrg	   Reflect_X
34117ca54c3Smrg	   Reflect_Y }
34217ca54c3Smrg
34317ca54c3Smrg	These values are used both to indicate a set of allowed rotations
34417ca54c3Smrg	and reflections as well as to indicate a specific rotation and
34517ca54c3Smrg	reflection combination.
34617ca54c3Smrg
34717ca54c3SmrgRRSELECTMASK { RRScreenChangeNotifyMask
34817ca54c3Smrg	       RRCrtcChangeNotifyMask (New in version 1.2)
34917ca54c3Smrg	       RROutputChangeNotifyMask (New in version 1.2)
35017ca54c3Smrg	       RROutputPropertyNotifyMask (New in version 1.2)
35117ca54c3Smrg	       RRProviderChangeNotifyMask (New in version 1.4)
35217ca54c3Smrg	       RRProviderPropertyNotifyMask (New in version 1.4)
35317ca54c3Smrg	       RRResourceChangeNotifyMask (New in version 1.4) }
35417ca54c3Smrg
35517ca54c3SmrgSIZEID { CARD16 }
35617ca54c3Smrg
35717ca54c3SmrgMODE { XID or None }
35817ca54c3Smrg
35917ca54c3SmrgCRTC { XID }
36017ca54c3Smrg
36117ca54c3SmrgOUTPUT { XID }
36217ca54c3Smrg
36317ca54c3SmrgCONNECTION { Connected, Disconnected, UnknownConnection }
36417ca54c3Smrg
36517ca54c3Smrg	This value provides an indication of whether an output is actually
36617ca54c3Smrg	connected to a monitor or other presentation device.
36717ca54c3Smrg
36817ca54c3Smrg
36917ca54c3SmrgSCREENSIZE [ widthInPixels, heightInPixels: CARD16
37017ca54c3Smrg	     widthInMillimeters, heightInMillimeters: CARD16 ]
37117ca54c3Smrg
37217ca54c3SmrgMODEFLAG { HSyncPositive
37317ca54c3Smrg	   HSyncNegative
37417ca54c3Smrg	   VSyncPositive
37517ca54c3Smrg	   VSyncNegative
37617ca54c3Smrg	   Interlace
37717ca54c3Smrg	   DoubleScan
37817ca54c3Smrg	   CSync
37917ca54c3Smrg	   CSyncPositive
38017ca54c3Smrg	   CSyncNegative
38117ca54c3Smrg	   HSkewPresent
38217ca54c3Smrg	   BCast
38317ca54c3Smrg	   PixelMultiplex
38417ca54c3Smrg	   DoubleClock
38517ca54c3Smrg	   ClockDivideBy2 }
38617ca54c3Smrg
38717ca54c3SmrgMODEINFO [ id: MODE
38817ca54c3Smrg	   name: STRING
38917ca54c3Smrg	   width, height: CARD16
39017ca54c3Smrg	   dotClock: CARD32
39117ca54c3Smrg	   hSyncStart, hSyncEnd, hTotal, hSkew: CARD16
39217ca54c3Smrg	   vSyncStart, vSyncEnd, vTotal: CARD16
39317ca54c3Smrg	   modeFlags: SETofMODEFLAG ]
39417ca54c3Smrg
39517ca54c3SmrgREFRESH [ rates: LISTofCARD16 ]
39617ca54c3Smrg
39717ca54c3Smrg			      ❧❧❧❧❧❧❧❧❧❧❧
39817ca54c3Smrg
39917ca54c3Smrg5.1 Data Types defined by the Render extension
40017ca54c3Smrg
40117ca54c3SmrgThese data types use the Render extension definitions; they are shown here
40217ca54c3Smrgonly for convenience:
40317ca54c3Smrg
40417ca54c3SmrgSUBPIXELORDER { SubPixelUnknown
40517ca54c3Smrg		SubPixelHorizontalRGB
40617ca54c3Smrg		SubPixelHorizontalBGR
40717ca54c3Smrg		SubPixelVerticalRGB
40817ca54c3Smrg		SubPixelVerticalBGR
40917ca54c3Smrg		SubPixelNone }
41017ca54c3Smrg
41117ca54c3SmrgFIXED         32-bit value (top 16 are integer portion, bottom 16 are fraction)
41217ca54c3Smrg
41317ca54c3SmrgTRANSFORM     [
41417ca54c3Smrg                        p11, p12, p13:  FIXED
41517ca54c3Smrg                        p21, p22, p23:  FIXED
41617ca54c3Smrg                        p31, p32, p33:  FIXED
41717ca54c3Smrg              ]
41817ca54c3Smrg
41917ca54c3Smrg			      ❧❧❧❧❧❧❧❧❧❧❧
42017ca54c3Smrg
42117ca54c3Smrg5.5. Protocol Types added in version 1.4 of the extension
42217ca54c3Smrg
42317ca54c3SmrgPROVIDER { XID }
42417ca54c3Smrg
42517ca54c3SmrgPROVIDER_CAPS { SourceOutput, SinkOutput, SourceOffload, SinkOffload }
42617ca54c3Smrg	Capabilities for this provider:
42717ca54c3Smrg	SourceOutput: This device can source output buffers.
42817ca54c3Smrg	SinkOutput: This device can sink output buffers.
42917ca54c3Smrg	SourceOffload: This device can source offload buffers.
43017ca54c3Smrg	SinkOffload: This device can sink offload buffers.
43117ca54c3Smrg
43217ca54c3Smrg			      ❧❧❧❧❧❧❧❧❧❧❧
43317ca54c3Smrg
43417ca54c3Smrg5.6. Protocol Types added in version 1.5 of the extension
43517ca54c3Smrg
43617ca54c3SmrgMONITORINFO { name: ATOM
43717ca54c3Smrg              primary: BOOL
43817ca54c3Smrg	      automatic: BOOL
43917ca54c3Smrg	      x: INT16
44017ca54c3Smrg	      y: INT16
44117ca54c3Smrg	      width: CARD16
44217ca54c3Smrg	      height: CARD16
44317ca54c3Smrg	      width-in-millimeters: CARD32
44417ca54c3Smrg	      height-in-millimeters: CARD32
44517ca54c3Smrg	      outputs: LISTofOUTPUT }
44617ca54c3Smrg
44717ca54c3Smrg			      ❧❧❧❧❧❧❧❧❧❧❧
44817ca54c3Smrg
44917ca54c3Smrg5.7. Protocol Types added in version 1.6 of the extension
45017ca54c3Smrg
45117ca54c3SmrgLEASE { XID }
45217ca54c3Smrg
45317ca54c3Smrg			      ❧❧❧❧❧❧❧❧❧❧❧
45417ca54c3Smrg
45517ca54c3Smrg6. Extension Initialization
45617ca54c3Smrg
45717ca54c3SmrgThe name of this extension is "RANDR".
45817ca54c3Smrg
45917ca54c3Smrg┌───
46017ca54c3Smrg    RRQueryVersion
46117ca54c3Smrg	client-major-version:	CARD32
46217ca54c3Smrg	client-minor-version:	CARD32
46317ca54c3Smrg46417ca54c3Smrg	major-version:		CARD32
46517ca54c3Smrg	minor-version:		CARD32
46617ca54c3Smrg└───
46717ca54c3Smrg
46817ca54c3Smrg	The client sends the highest supported version to the server
46917ca54c3Smrg	and the server sends the highest version it supports, but no
47017ca54c3Smrg	higher than the requested version. Major versions changes can
47117ca54c3Smrg	introduce incompatibilities in existing functionality, minor
47217ca54c3Smrg	version changes introduce only backward compatible changes.
47317ca54c3Smrg	It is the clients responsibility to ensure that the server
47417ca54c3Smrg	supports a version which is compatible with its expectations.
47517ca54c3Smrg
47617ca54c3Smrg			      ❧❧❧❧❧❧❧❧❧❧❧
47717ca54c3Smrg
47817ca54c3Smrg7. Extension Requests
47917ca54c3Smrg
48017ca54c3Smrg┌───
48117ca54c3Smrg    RRSelectInput
48217ca54c3Smrg	window: WINDOW
48317ca54c3Smrg	enable: SETofRRSELECTMASK
48417ca54c3Smrg└───
48517ca54c3Smrg	Errors: Window, Value
48617ca54c3Smrg
48717ca54c3Smrg	If 'enable' is RRScreenChangeNotifyMask, RRScreenChangeNotify events
48817ca54c3Smrg	will be sent when the screen configuration changes, either from
48917ca54c3Smrg	this protocol extension, or due to detected external screen
49017ca54c3Smrg	configuration changes. RRScreenChangeNotify may also be sent when
49117ca54c3Smrg	this request executes if the screen configuration has changed since
49217ca54c3Smrg	the client connected, to avoid race conditions.
49317ca54c3Smrg
49417ca54c3Smrg	New for version 1.2:
49517ca54c3Smrg
49617ca54c3Smrg	If 'enable' contains RRCrtcChangeNotifyMask, RRCrtcChangeNotify events
49717ca54c3Smrg	will be sent when the configuration for a CRTC associated with the
49817ca54c3Smrg	screen changes, either through this protocol extension or due to
49917ca54c3Smrg	detected external changes. RRCrtcChangeNotify may also be sent when
50017ca54c3Smrg	this request executes if the CRTC configuration has changed since
50117ca54c3Smrg	the client connected, to avoid race conditions.
50217ca54c3Smrg
50317ca54c3Smrg	If 'enable' contains RROutputChangeNotifyMask, RROutputChangeNotify
50417ca54c3Smrg	events will be sent when the configuration for an output associated with
50517ca54c3Smrg	the screen changes, either through this protocol extension or due to
50617ca54c3Smrg	detected external changes. RROutputChangeNotify may also be sent when
50717ca54c3Smrg	this request executes if the output configuration has changed since the
50817ca54c3Smrg	client connected, to avoid race conditions.
50917ca54c3Smrg
51017ca54c3Smrg	If 'enable' contains RROutputPropertyNotifyMask,
51117ca54c3Smrg	RROutputPropertyNotify events will be sent when properties change on
51217ca54c3Smrg	this output.
51317ca54c3Smrg
51417ca54c3Smrg	New for version 1.4:
51517ca54c3Smrg
51617ca54c3Smrg	If 'enable' contains RRProviderChangeNotifyMask,
51717ca54c3Smrg	RRProviderChangeNotify events will be sent whenever the role for a
51817ca54c3Smrg	provider object has changed.
51917ca54c3Smrg
52017ca54c3Smrg	If 'enable' contains RRProviderPropertyNotifyMask,
52117ca54c3Smrg	RRProviderPropertyNotify events will be sent when properties change
52217ca54c3Smrg	on a provider object.
52317ca54c3Smrg
52417ca54c3Smrg	If 'enable' contains RRResourceChangeNotifyMask,
52517ca54c3Smrg	RRResourceChangeNotify events will be sent whenever the set of
52617ca54c3Smrg	available RandR resources associated with the screen has changed.
52717ca54c3Smrg
52817ca54c3Smrg┌───
52917ca54c3Smrg    RRSetScreenConfig
53017ca54c3Smrg	window: WINDOW
53117ca54c3Smrg	timestamp: TIMESTAMP
53217ca54c3Smrg	config-timestamp: TIMESTAMP
53317ca54c3Smrg	size-id: SIZEID
53417ca54c3Smrg	rotation: ROTATION
53517ca54c3Smrg	rate: CARD16
53617ca54c3Smrg53717ca54c3Smrg	status: RRCONFIGSTATUS
53817ca54c3Smrg	new-timestamp: TIMESTAMP
53917ca54c3Smrg	config-timestamp: TIMESTAMP
54017ca54c3Smrg	root: WINDOW
54117ca54c3Smrg	subpixelOrder: SUBPIXELORDER
54217ca54c3Smrg└───
54317ca54c3Smrg	Errors: Value, Match
54417ca54c3Smrg
54517ca54c3Smrg	If 'timestamp' is less than the time when the configuration was last
54617ca54c3Smrg	successfully set, the request is ignored and InvalidTime returned in
54717ca54c3Smrg	status.
54817ca54c3Smrg
54917ca54c3Smrg	If 'config-timestamp' is not equal to when the server's screen
55017ca54c3Smrg	configurations last changed, the request is ignored and
55117ca54c3Smrg	InvalidConfigTime returned in status. This could occur if the
55217ca54c3Smrg	screen changed since you last made a RRGetScreenInfo request,
55317ca54c3Smrg	perhaps by a different piece of display hardware being installed.
55417ca54c3Smrg	Rather than allowing an incorrect call to be executed based on stale
55517ca54c3Smrg	data, the server will ignore the request.
55617ca54c3Smrg
55717ca54c3Smrg	'rate' contains the desired refresh rate. If it is zero, the server
55817ca54c3Smrg	selects an appropriate rate.
55917ca54c3Smrg
56017ca54c3Smrg	This request may fail for other indeterminate reasons, in which case
56117ca54c3Smrg	'status' will be set to Failed and no configuration change will be
56217ca54c3Smrg	made.
56317ca54c3Smrg
56417ca54c3Smrg	This request sets the screen to the specified size, rate, rotation
56517ca54c3Smrg	and reflection.
56617ca54c3Smrg
56717ca54c3Smrg	When this request succeeds, 'status' contains Success and the
56817ca54c3Smrg	requested changes to configuration will have been made.
56917ca54c3Smrg
57017ca54c3Smrg	'new-time-stamp' contains the time at which this request was
57117ca54c3Smrg	executed.
57217ca54c3Smrg
57317ca54c3Smrg	'config-timestamp' contains the time when the possible screen
57417ca54c3Smrg	configurations were last changed.
57517ca54c3Smrg
57617ca54c3Smrg	'root' contains the root window for the screen indicated by the
57717ca54c3Smrg	window.
57817ca54c3Smrg
57917ca54c3Smrg	'subpixelOrder' contains the resulting subpixel order of the screen
58017ca54c3Smrg	to allow correct subpixel rendering.
58117ca54c3Smrg
58217ca54c3Smrg	Value errors are generated when 'rotation', 'rate' or 'size-id'
58317ca54c3Smrg	are invalid.
58417ca54c3Smrg
58517ca54c3Smrg┌───
58617ca54c3Smrg    RRGetScreenInfo
58717ca54c3Smrg	window: WINDOW
58817ca54c3Smrg58917ca54c3Smrg	rotations: SETofROTATION
59017ca54c3Smrg	root: WINDOW
59117ca54c3Smrg	timestamp: TIMESTAMP
59217ca54c3Smrg	config-timestamp: TIMESTAMP
59317ca54c3Smrg	size-id: SIZEID
59417ca54c3Smrg	rotation: ROTATION
59517ca54c3Smrg	rate: CARD16
59617ca54c3Smrg	sizes: LISTofSCREENSIZE
59717ca54c3Smrg	refresh: LISTofREFRESH
59817ca54c3Smrg└───
59917ca54c3Smrg
60017ca54c3Smrg	Errors: Window
60117ca54c3Smrg
60217ca54c3Smrg	RRGetScreenInfo returns information about the current and available
60317ca54c3Smrg	configurations for the screen associated with 'window'.
60417ca54c3Smrg
60517ca54c3Smrg	'rotations' contains the set of rotations and reflections supported
60617ca54c3Smrg	by the screen.
60717ca54c3Smrg
60817ca54c3Smrg	'root' is the root window of the screen.
60917ca54c3Smrg
61017ca54c3Smrg	'config-timestamp' indicates when the screen configuration
61117ca54c3Smrg	information last changed: requests to set the screen will fail
61217ca54c3Smrg	unless the timestamp indicates that the information the client
61317ca54c3Smrg	is using is up to date, to ensure clients can be well behaved
61417ca54c3Smrg	in the face of race conditions.
61517ca54c3Smrg
61617ca54c3Smrg	'timestamp' indicates when the configuration was last set.
61717ca54c3Smrg
61817ca54c3Smrg	'size-id' indicates which size is active.
61917ca54c3Smrg
62017ca54c3Smrg	'rate' is the current refresh rate. This is zero when the refresh
62117ca54c3Smrg	rate is unknown or on devices for which refresh is not relevant.
62217ca54c3Smrg
62317ca54c3Smrg	'sizes' is the list of possible frame buffer sizes (at the normal
62417ca54c3Smrg	orientation). Each size indicates both the linear physical size of
62517ca54c3Smrg	the screen and the pixel size.
62617ca54c3Smrg
62717ca54c3Smrg	'refresh' is the list of refresh rates for each size. Each element
62817ca54c3Smrg	of 'sizes' has a corresponding element in 'refresh'. An empty list
62917ca54c3Smrg	indicates no known rates, or a device for which refresh is not
63017ca54c3Smrg	relevant.
63117ca54c3Smrg
63217ca54c3Smrg	The default size of the screen (the size that would become the
63317ca54c3Smrg	current size when the server resets) is the first size in the
63417ca54c3Smrg	list.
63517ca54c3Smrg
63617ca54c3Smrg7.1. Extension Requests added in version 1.2 of the extension
63717ca54c3Smrg
63817ca54c3SmrgAs introduced above, version 1.2 of the extension splits the screen size
63917ca54c3Smrgfrom the crtc and output configuration, permitting the subset of the screen
64017ca54c3Smrgpresented by multiple outputs to be configured. As a separate notion, the
64117ca54c3Smrgsize of the screen itself may be arbitrarily configured within a defined
64217ca54c3Smrgrange. As crtcs and outputs are added and removed from the system, the set
64317ca54c3Smrgreturned by the extension will change so that applications can detect
64417ca54c3Smrgdynamic changes in the display environment.
64517ca54c3Smrg
64617ca54c3Smrg┌───
64717ca54c3Smrg    RRGetScreenSizeRange
64817ca54c3Smrg	window: WINDOW
64917ca54c3Smrg65017ca54c3Smrg	CARD16	minWidth, minHeight
65117ca54c3Smrg	CARD16	maxWidth, maxHeight
65217ca54c3Smrg└───
65317ca54c3Smrg	Errors: Window
65417ca54c3Smrg
65517ca54c3Smrg	Returns the range of possible screen sizes. The screen may be set to
65617ca54c3Smrg	any size within this range.
65717ca54c3Smrg
65817ca54c3Smrg┌───
65917ca54c3Smrg    RRSetScreenSize
66017ca54c3Smrg	window: WINDOW
66117ca54c3Smrg	width: CARD16
66217ca54c3Smrg	height: CARD16
66317ca54c3Smrg	width-in-millimeters: CARD32
66417ca54c3Smrg	height-in-millimeters: CARD32
66517ca54c3Smrg└───
66617ca54c3Smrg	Errors: Window, Match, Value
66717ca54c3Smrg
66817ca54c3Smrg	Sets the screen to the specified size. 'width' and 'height' must be
66917ca54c3Smrg	within the range allowed by GetScreenSizeRanges, otherwise a Value
67017ca54c3Smrg	error results. All active monitors must be configured to display a
67117ca54c3Smrg	subset of the specified size, else a Match error results.
67217ca54c3Smrg
67317ca54c3Smrg	'width-in-millimeters' and 'height-in-millimeters' can be set to
67417ca54c3Smrg	reflect the physical size of the screen reported both through this
67517ca54c3Smrg	extension and the core protocol. They must be non-zero, or Value
67617ca54c3Smrg	error results.
67717ca54c3Smrg
67817ca54c3Smrg	If panning is enabled, the width and height of the panning and the
67917ca54c3Smrg	tracking areas are adapted to the new size and clamped afterwards.
68017ca54c3Smrg	Disabled panning axes remain disabled.
68117ca54c3Smrg	Panning borders are disabled if their requirements are no longer met
68217ca54c3Smrg	(see RRSetPanning).
68317ca54c3Smrg
68417ca54c3Smrg┌───
68517ca54c3Smrg    RRGetScreenResources
68617ca54c3Smrg	window: WINDOW
68717ca54c3Smrg68817ca54c3Smrg	timestamp: TIMESTAMP
68917ca54c3Smrg	config-timestamp: TIMESTAMP
69017ca54c3Smrg	crtcs: LISTofCRTC
69117ca54c3Smrg	outputs: LISTofOUTPUT
69217ca54c3Smrg	modes: LISTofMODEINFO
69317ca54c3Smrg└───
69417ca54c3Smrg	Errors: Window
69517ca54c3Smrg
69617ca54c3Smrg	RRGetScreenResources returns the list of outputs and crtcs connected
69717ca54c3Smrg	to the screen associated with 'window'.
69817ca54c3Smrg
69917ca54c3Smrg	'timestamp' indicates when the configuration was last set.
70017ca54c3Smrg
70117ca54c3Smrg	'config-timestamp' indicates when the configuration information last
70217ca54c3Smrg	changed. Requests to configure the output will fail unless the
70317ca54c3Smrg	timestamp indicates that the information the client is using is up
70417ca54c3Smrg	to date, to ensure clients can be well behaved in the face of race
70517ca54c3Smrg	conditions.
70617ca54c3Smrg
70717ca54c3Smrg	'crtcs' contains the list of CRTCs associated with the screen.
70817ca54c3Smrg
70917ca54c3Smrg	'outputs' contains the list of outputs associated with the screen.
71017ca54c3Smrg
71117ca54c3Smrg	'modes' contains the list of modes associated with the screen
71217ca54c3Smrg
71317ca54c3Smrg	This request explicitly asks the server to ensure that the
71417ca54c3Smrg	configuration data is up-to-date wrt the hardware. If that requires
71517ca54c3Smrg	polling, this is when such polling would take place.  If the
71617ca54c3Smrg	current configuration is all that's required, use
71717ca54c3Smrg	RRGetScreenResourcesCurrent instead.
71817ca54c3Smrg
71917ca54c3Smrg┌───
72017ca54c3Smrg    RRGetOutputInfo
72117ca54c3Smrg	output: OUTPUT
72217ca54c3Smrg	config-timestamp: TIMESTAMP
72317ca54c3Smrg72417ca54c3Smrg	status: RRCONFIGSTATUS
72517ca54c3Smrg	timestamp: TIMESTAMP
72617ca54c3Smrg	crtc: CRTC
72717ca54c3Smrg
72817ca54c3Smrg	name: STRING
72917ca54c3Smrg	connection: CONNECTION
73017ca54c3Smrg	subpixel-order: SUBPIXELORDER
73117ca54c3Smrg	widthInMillimeters, heightInMillimeters: CARD32
73217ca54c3Smrg	crtcs: LISTofCRTC
73317ca54c3Smrg	clones: LISTofOUTPUT
73417ca54c3Smrg	modes: LISTofMODE
73517ca54c3Smrg	num-preferred: CARD16
73617ca54c3Smrg└───
73717ca54c3Smrg	Errors: Output
73817ca54c3Smrg
73917ca54c3Smrg	RRGetOutputInfo returns information about the current and available
74017ca54c3Smrg	configurations 'output'.
74117ca54c3Smrg
74217ca54c3Smrg	If 'config-timestamp' does not match the current configuration
74317ca54c3Smrg	timestamp (as returned by RRGetScreenResources), 'status' is set to
74417ca54c3Smrg	InvalidConfigTime and the remaining reply data is empty. Otherwise,
74517ca54c3Smrg	'status' is set to Success.
74617ca54c3Smrg
74717ca54c3Smrg	'timestamp' indicates when the configuration was last set.
74817ca54c3Smrg
74917ca54c3Smrg	'crtc' is the current source CRTC for video data, or Disabled if the
75017ca54c3Smrg	output is not connected to any CRTC.
75117ca54c3Smrg
75217ca54c3Smrg	'name' is a UTF-8 encoded string designed to be presented to the
75317ca54c3Smrg	user to indicate which output this is. E.g. "S-Video" or "DVI".
75417ca54c3Smrg
75517ca54c3Smrg	'connection' indicates whether the hardware was able to detect a
75617ca54c3Smrg	device connected to this output. If the hardware cannot determine
75717ca54c3Smrg	whether something is connected, it will set this to
75817ca54c3Smrg	UnknownConnection.
75917ca54c3Smrg
76017ca54c3Smrg	'subpixel-order' contains the resulting subpixel order of the
76117ca54c3Smrg	connected device to allow correct subpixel rendering.
76217ca54c3Smrg
76317ca54c3Smrg	'widthInMillimeters' and 'heightInMillimeters' report the physical
76417ca54c3Smrg	size of the displayed area. If unknown, or not really fixed (e.g.,
76517ca54c3Smrg	for a projector), these	values are both zero.
76617ca54c3Smrg
76717ca54c3Smrg	'crtcs' is the list of CRTCs that this output may be connected to.
76817ca54c3Smrg	Attempting to connect this output to a different CRTC results in a
76917ca54c3Smrg	Match error.
77017ca54c3Smrg
77117ca54c3Smrg	'clones' is the list of outputs which may be simultaneously
77217ca54c3Smrg	connected to the same CRTC along with this output. Attempting to
77317ca54c3Smrg	connect this output with an output not in the 'clones' list
77417ca54c3Smrg	results in a Match error.
77517ca54c3Smrg
77617ca54c3Smrg	'modes' is the list of modes supported by this output. Attempting to
77717ca54c3Smrg	connect this output to a CRTC not using one of these modes results
77817ca54c3Smrg	in a Match error.
77917ca54c3Smrg
78017ca54c3Smrg	The first 'num-preferred' modes in 'modes' are preferred by the
78117ca54c3Smrg	monitor in some way; for fixed-pixel devices, this would generally
78217ca54c3Smrg	indicate which modes match the resolution of the output device.
78317ca54c3Smrg
78417ca54c3Smrg	Changes in version 1.6 of the protocol:
78517ca54c3Smrg
78617ca54c3Smrg	When a “non-desktop” device is connected, the 'connection'
78717ca54c3Smrg	field will report Disconnected but the remaining fields will
78817ca54c3Smrg	report information about the connected device.
78917ca54c3Smrg
79017ca54c3Smrg┌───
79117ca54c3Smrg    RRListOutputProperties
79217ca54c3Smrg	output:OUTPUT
79317ca54c3Smrg79417ca54c3Smrg	atoms: LISTofATOM
79517ca54c3Smrg└───
79617ca54c3Smrg	Errors: Output
79717ca54c3Smrg
79817ca54c3Smrg	This request returns the atoms of properties currently defined on
79917ca54c3Smrg	the output.
80017ca54c3Smrg
80117ca54c3Smrg	Changes in version 1.6 of the protocol:
80217ca54c3Smrg
80317ca54c3Smrg	When a “non-desktop” device is connected, the property list
80417ca54c3Smrg	will be correct for the device, even though RRGetOutputInfo
80517ca54c3Smrg	reports the device as disconnected.
80617ca54c3Smrg
80717ca54c3Smrg┌───
80817ca54c3Smrg    RRQueryOutputProperty
80917ca54c3Smrg	output: OUTPUT
81017ca54c3Smrg	property: ATOM
81117ca54c3Smrg81217ca54c3Smrg	pending: BOOL
81317ca54c3Smrg	range: BOOL
81417ca54c3Smrg	immutable: BOOL
81517ca54c3Smrg	valid-values: LISTofINT32
81617ca54c3Smrg└───
81717ca54c3Smrg	Errors: Name, Atom, Output
81817ca54c3Smrg
81917ca54c3Smrg	If the specified property does not exist for the specified output,
82017ca54c3Smrg	then a Name error is returned.
82117ca54c3Smrg
82217ca54c3Smrg	If 'pending' is TRUE, changes made to property values with
82317ca54c3Smrg	RRChangeOutputProperty will be saved in the pending property value
82417ca54c3Smrg	and be automatically copied to the current value on the next
82517ca54c3Smrg	RRSetCrtcConfig request involving the named output. If 'pending' is
82617ca54c3Smrg	FALSE, changes are copied immediately.
82717ca54c3Smrg
82817ca54c3Smrg	If 'range' is TRUE, then the valid-values list will contain
82917ca54c3Smrg	precisely two values indicating the minimum and maximum allowed
83017ca54c3Smrg	values. If 'range' is FALSE, then the valid-values list will contain
83117ca54c3Smrg	the list of possible values; attempts to set other values will
83217ca54c3Smrg	result in a Value error.
83317ca54c3Smrg
83417ca54c3Smrg	If 'immutable' is TRUE, then the property configuration cannot be
83517ca54c3Smrg	changed by clients. Immutable properties are interpreted by the X
83617ca54c3Smrg	server.
83717ca54c3Smrg
83817ca54c3Smrg	Changes in version 1.6 of the protocol:
83917ca54c3Smrg
84017ca54c3Smrg	When a “non-desktop” device is connected, the property information
84117ca54c3Smrg	will be correct for the device, even though RRGetOutputInfo
84217ca54c3Smrg	reports the device as disconnected.
84317ca54c3Smrg
84417ca54c3Smrg┌───
84517ca54c3Smrg    RRConfigureOutputProperty
84617ca54c3Smrg	output: OUTPUT
84717ca54c3Smrg	property: ATOM
84817ca54c3Smrg	pending: BOOL
84917ca54c3Smrg	range: BOOL
85017ca54c3Smrg	valid-values: LISTofINT32
85117ca54c3Smrg└───
85217ca54c3Smrg	Errors: Access, Name, Atom, Output
85317ca54c3Smrg
85417ca54c3Smrg	If the specified property is 'immutable', an Access error is
85517ca54c3Smrg	returned.
85617ca54c3Smrg
85717ca54c3Smrg	Otherwise, the configuration of the specified property is changed to
85817ca54c3Smrg	the values provided in this request.
85917ca54c3Smrg
86017ca54c3Smrg	If the specified property does not exist for the specified output,
86117ca54c3Smrg	it is created with an empty value and None type.
86217ca54c3Smrg
86317ca54c3Smrg┌───
86417ca54c3Smrg    RRChangeOutputProperty
86517ca54c3Smrg	output: OUTPUT
86617ca54c3Smrg	property, type: ATOM
86717ca54c3Smrg	format: {8, 16, 32}
86817ca54c3Smrg	mode: { Replace, Prepend, Append }
86917ca54c3Smrg	data: LISTofINT8 or LISTofINT16 or LISTofINT32
87017ca54c3Smrg└───
87117ca54c3Smrg	Errors: Alloc, Atom, Match, Value, Output
87217ca54c3Smrg
87317ca54c3Smrg	This request alters the value of the property for the specified
87417ca54c3Smrg	output. If the property is marked as a 'pending' property, only the
87517ca54c3Smrg	pending value of the property is changed. Otherwise, changes are
87617ca54c3Smrg	reflected in both the pending and current values of the property.
87717ca54c3Smrg	The type is uninterpreted by the server.  The format specifies
87817ca54c3Smrg	whether the data should be viewed as a list of 8-bit, 16-bit, or
87917ca54c3Smrg	32-bit quantities so that the server can correctly byte-swap as
88017ca54c3Smrg	necessary.
88117ca54c3Smrg
88217ca54c3Smrg	If the mode is Replace, the previous property value is discarded.
88317ca54c3Smrg	If the mode is Prepend or Append, then the type and format must
88417ca54c3Smrg	match the existing property value (or a Match error results).  If
88517ca54c3Smrg	the property is undefined, it is treated as defined with the correct
88617ca54c3Smrg	type and format with zero-length data.
88717ca54c3Smrg
88817ca54c3Smrg	For Prepend, the data is tacked on to the beginning of the existing
88917ca54c3Smrg	data, and for Append, it is tacked on to the end of the existing data.
89017ca54c3Smrg
89117ca54c3Smrg	This request generates a OutputPropertyNotify
89217ca54c3Smrg
89317ca54c3Smrg	The lifetime of a property is not tied to the storing client.
89417ca54c3Smrg	Properties remain until explicitly deleted, until the output is
89517ca54c3Smrg	destroyed, or until server reset (see section 10).
89617ca54c3Smrg
89717ca54c3Smrg	The maximum size of a property is server-dependent and may vary
89817ca54c3Smrg	dynamically.
89917ca54c3Smrg
90017ca54c3Smrg┌───
90117ca54c3Smrg    RRDeleteOutputProperty
90217ca54c3Smrg	output: OUTPUT
90317ca54c3Smrg	property: ATOM
90417ca54c3Smrg└───
90517ca54c3Smrg	Errors: Atom, Output
90617ca54c3Smrg
90717ca54c3Smrg	This request deletes the property from the specified window if the
90817ca54c3Smrg	property exists and generates a OutputPropertyNotify event unless
90917ca54c3Smrg	the property does not exist.
91017ca54c3Smrg
91117ca54c3Smrg┌───
91217ca54c3Smrg    RRGetOutputProperty
91317ca54c3Smrg	output: OUTPUT
91417ca54c3Smrg	property: ATOM
91517ca54c3Smrg	type: ATOM or AnyPropertyType
91617ca54c3Smrg	long-offset, long-length: CARD32
91717ca54c3Smrg	delete: BOOL
91817ca54c3Smrg	pending: BOOL
91917ca54c3Smrg92017ca54c3Smrg	type: ATOM or None
92117ca54c3Smrg	format: {0, 8, 16, 32}
92217ca54c3Smrg	bytes-after: CARD32
92317ca54c3Smrg	value: LISTofINT8 or LISTofINT16 or LISTofINT32
92417ca54c3Smrg└───
92517ca54c3Smrg	Errors: Atom, Value, Output
92617ca54c3Smrg
92717ca54c3Smrg	If the specified property does not exist for the specified output,
92817ca54c3Smrg	then the return type is None, the format and bytes-after are zero,
92917ca54c3Smrg	and the value is empty.  The delete argument is ignored in this
93017ca54c3Smrg	case.
93117ca54c3Smrg
93217ca54c3Smrg	If the specified property exists but its type does not match the
93317ca54c3Smrg	specified type, then the return type is the actual type of the
93417ca54c3Smrg	property, the format is the actual format of the property (never
93517ca54c3Smrg	zero), the bytes-after is the length of the property in bytes (even
93617ca54c3Smrg	if the format is 16 or 32), and the value is empty.  The delete
93717ca54c3Smrg	argument is ignored in this case.
93817ca54c3Smrg
93917ca54c3Smrg	If the specified property exists and either AnyPropertyType is
94017ca54c3Smrg	specified or the specified type matches the actual type of the
94117ca54c3Smrg	property, then the return type is the actual type of the property,
94217ca54c3Smrg	the format is the actual format of the property (never zero), and
94317ca54c3Smrg	the bytes-after and value are as follows, given:
94417ca54c3Smrg
94517ca54c3Smrg		N = actual length of the stored property in bytes
94617ca54c3Smrg				  (even if the format is 16 or 32)
94717ca54c3Smrg		I = 4 × offset
94817ca54c3Smrg		T = N - I
94917ca54c3Smrg		L = MINIMUM(T, 4 × long-length)
95017ca54c3Smrg		A = N - (I + L)
95117ca54c3Smrg
95217ca54c3Smrg	If 'pending' is true, and if the property holds a pending value,
95317ca54c3Smrg	then the value returned will be the pending value of the property
95417ca54c3Smrg	rather than the current value.  The returned value starts at byte
95517ca54c3Smrg	index I in the property (indexing from 0), and its length in bytes
95617ca54c3Smrg	is L.  However, it is a Value error if long-offset is given such
95717ca54c3Smrg	that L is negative.  The value of bytes-after is A, giving the
95817ca54c3Smrg	number of trailing unread bytes in the stored property.  If delete
95917ca54c3Smrg	is True and the bytes-after is zero, the property is also deleted
96017ca54c3Smrg	from the output, and a RROutputPropertyNotify event is generated.
96117ca54c3Smrg
96217ca54c3Smrg	Changes in version 1.6 of the protocol:
96317ca54c3Smrg
96417ca54c3Smrg	When a “non-desktop” device is connected, the property value
96517ca54c3Smrg	will be correct for the device, even though RRGetOutputInfo
96617ca54c3Smrg	reports the device as disconnected.
96717ca54c3Smrg
96817ca54c3Smrg┌───
96917ca54c3Smrg    RRCreateMode
97017ca54c3Smrg	window: WINDOW
97117ca54c3Smrg	modeinfo: MODEINFO
97217ca54c3Smrg97317ca54c3Smrg	mode: MODE
97417ca54c3Smrg└───
97517ca54c3Smrg	Errors: Window, Name, Value
97617ca54c3Smrg
97717ca54c3Smrg	'modeinfo' provides a new mode for outputs on the screen
97817ca54c3Smrg	associated with 'window'. If the name of 'modeinfo' names an
97917ca54c3Smrg	existing mode, a Name error is returned.  If some parameter of the
98017ca54c3Smrg	mode is not valid in some other way, a Value error is returned.
98117ca54c3Smrg
98217ca54c3Smrg	The returned 'mode' provides the id for the mode.
98317ca54c3Smrg
98417ca54c3Smrg┌───
98517ca54c3Smrg    RRDestroyMode
98617ca54c3Smrg	mode: MODE
98717ca54c3Smrg└───
98817ca54c3Smrg	Errors: Mode, Access
98917ca54c3Smrg
99017ca54c3Smrg	The user-defined 'mode' is destroyed. 'mode' must name a mode
99117ca54c3Smrg	defined with RRCreateMode, else an Match error is returned.  If
99217ca54c3Smrg	'mode' is in use by some CRTC or Output, then an Access error is
99317ca54c3Smrg	returned.
99417ca54c3Smrg
99517ca54c3Smrg┌───
99617ca54c3Smrg    RRAddOutputMode
99717ca54c3Smrg	output: OUTPUT
99817ca54c3Smrg	mode: MODE
99917ca54c3Smrg└───
100017ca54c3Smrg	Errors: Output, Mode, Match
100117ca54c3Smrg
100217ca54c3Smrg	'output' indicates which output is to be configured.
100317ca54c3Smrg
100417ca54c3Smrg	'mode' specifies which mode to add. If 'mode' is not valid for
100517ca54c3Smrg	'output', then a Match error is generated.
100617ca54c3Smrg
100717ca54c3Smrg	This request generates OutputChangeNotify events.
100817ca54c3Smrg
100917ca54c3Smrg┌───
101017ca54c3Smrg    RRDeleteOutputMode
101117ca54c3Smrg	output: OUTPUT
101217ca54c3Smrg	mode: MODE
101317ca54c3Smrg└───
101417ca54c3Smrg	Errors: Output, Mode
101517ca54c3Smrg
101617ca54c3Smrg	'output' indicates which output is to be configured.
101717ca54c3Smrg
101817ca54c3Smrg	'mode' specifies which mode to delete. 'mode' must have been added
101917ca54c3Smrg	with RRAddOutputMode, else an Access error is returned. 'mode' must
102017ca54c3Smrg	not be active, else a Match error is returned.
102117ca54c3Smrg
102217ca54c3Smrg	This request generates OutputChangeNotify events.
102317ca54c3Smrg
102417ca54c3Smrg┌───
102517ca54c3Smrg    RRGetCrtcInfo
102617ca54c3Smrg	crtc: CRTC
102717ca54c3Smrg	config-timestamp: TIMESTAMP
102817ca54c3Smrg102917ca54c3Smrg	status: RRCONFIGSTATUS
103017ca54c3Smrg	timestamp: TIMESTAMP
103117ca54c3Smrg	x, y: INT16
103217ca54c3Smrg	width, height: CARD16
103317ca54c3Smrg	mode: MODE
103417ca54c3Smrg	rotation: ROTATION
103517ca54c3Smrg	outputs: LISTofOUTPUT
103617ca54c3Smrg
103717ca54c3Smrg	rotations: SETofROTATION
103817ca54c3Smrg	possible-outputs: LISTofOUTPUT
103917ca54c3Smrg└───
104017ca54c3Smrg
104117ca54c3Smrg	Errors: Window
104217ca54c3Smrg
104317ca54c3Smrg	RRGetCrtcInfo returns information about the current and available
104417ca54c3Smrg	configurations for the specified crtc connected to the screen
104517ca54c3Smrg	associated with 'window'.
104617ca54c3Smrg
104717ca54c3Smrg	If 'config-timestamp' does not match the current configuration
104817ca54c3Smrg	timestamp (as returned by RRGetScreenResources), 'status' is set to
104917ca54c3Smrg	InvalidConfigTime and the remaining reply data is empty. Otherwise,
105017ca54c3Smrg	'status' is set to Success.
105117ca54c3Smrg
105217ca54c3Smrg	'timestamp' indicates when the configuration was last set.
105317ca54c3Smrg
105417ca54c3Smrg	'x' and 'y' indicate the position of this CRTC within the screen
105517ca54c3Smrg	region. They will be set to 0 when the CRTC is disabled.
105617ca54c3Smrg
105717ca54c3Smrg	'width' and 'height' indicate the size of the area within the screen
105817ca54c3Smrg	presented by this CRTC. This may be different than the size of the
105917ca54c3Smrg	mode due to rotation, the projective transform, and the Border property
106017ca54c3Smrg	described below.  They will be set to 0 when the CRTC is disabled.
106117ca54c3Smrg
106217ca54c3Smrg	'mode' indicates which mode is active, or None indicating that the
106317ca54c3Smrg	CRTC has been disabled and is not displaying the screen contents.
106417ca54c3Smrg
106517ca54c3Smrg	'rotation' indicates the active rotation. It is set to Rotate_0
106617ca54c3Smrg	when the CRTC is disabled.
106717ca54c3Smrg
106817ca54c3Smrg	'outputs' is the list of outputs currently connected to this CRTC
106917ca54c3Smrg	and is empty when the CRTC is disabled.
107017ca54c3Smrg
107117ca54c3Smrg	'rotations' contains the set of rotations and reflections supported
107217ca54c3Smrg	by the CRTC.
107317ca54c3Smrg
107417ca54c3Smrg	'possible-outputs' lists all of the outputs which may be connected
107517ca54c3Smrg	to this CRTC.
107617ca54c3Smrg
107717ca54c3Smrg┌───
107817ca54c3Smrg    RRSetCrtcConfig
107917ca54c3Smrg	crtc: CRTC
108017ca54c3Smrg	timestamp: TIMESTAMP
108117ca54c3Smrg	config-timestamp: TIMESTAMP
108217ca54c3Smrg	x, y: INT16
108317ca54c3Smrg	mode: MODE
108417ca54c3Smrg	rotation: ROTATION
108517ca54c3Smrg	outputs: LISTofOUTPUT
108617ca54c3Smrg108717ca54c3Smrg	status: RRCONFIGSTATUS
108817ca54c3Smrg	new-timestamp: TIMESTAMP
108917ca54c3Smrg└───
109017ca54c3Smrg	Errors: Value, Match
109117ca54c3Smrg
109217ca54c3Smrg	If 'timestamp' is less than the time when the configuration was last
109317ca54c3Smrg	successfully set, the request is ignored and InvalidTime returned in
109417ca54c3Smrg	status.
109517ca54c3Smrg
109617ca54c3Smrg	If 'config-timestamp' is not equal to when the monitor's
109717ca54c3Smrg	configuration last changed, the request is ignored and
109817ca54c3Smrg	InvalidConfigTime returned in status. This could occur if the
109917ca54c3Smrg	monitor changed since you last made a RRGetScreenInfo request,
110017ca54c3Smrg	perhaps by a different monitor being connected to the machine.
110117ca54c3Smrg	Rather than allowing an incorrect call to be executed based on stale
110217ca54c3Smrg	data, the server will ignore the request.
110317ca54c3Smrg
110417ca54c3Smrg	'x' and 'y' contain the desired location within the screen for this
110517ca54c3Smrg	monitor's content. 'x' and 'y' must be within the screen size, else
110617ca54c3Smrg	a Value error results.
110717ca54c3Smrg
110817ca54c3Smrg	'mode' is either the desired mode or None indicating the CRTC should
110917ca54c3Smrg	be disabled. If 'mode' is not one of these values, a Value
111017ca54c3Smrg	error results. 'mode' must be valid for all of the configured outputs,
111117ca54c3Smrg	else a Match error.
111217ca54c3Smrg
111317ca54c3Smrg	'rotation' contains the desired rotation along with which
111417ca54c3Smrg	reflections should be enabled. The rotation and reflection values
111517ca54c3Smrg	must be among those allowed for this monitor, else a Value error
111617ca54c3Smrg	results.
111717ca54c3Smrg
111817ca54c3Smrg	'outputs' contains the set of outputs that this CRTC should be
111917ca54c3Smrg	connected to. The set must be among the list of acceptable output
112017ca54c3Smrg	sets for this CRTC or a Match error results.
112117ca54c3Smrg
112217ca54c3Smrg	If 'mode' is None, then 'outputs' must be empty, else a Match error
112317ca54c3Smrg	results. Conversely, if 'mode' is not None, then 'outputs' must not be
112417ca54c3Smrg	empty, else a Match error results.
112517ca54c3Smrg
112617ca54c3Smrg	This request may fail for other indeterminate reasons, in which case
112717ca54c3Smrg	'status' will be set to Failed and no configuration change will be
112817ca54c3Smrg	made.
112917ca54c3Smrg
113017ca54c3Smrg	This request sets the CRTC to the specified position, mode, rotation
113117ca54c3Smrg	and reflection. The entire area of the CRTC must fit within the
113217ca54c3Smrg	screen size, else a Match error results. As an example, rotating the
113317ca54c3Smrg	screen so that a single CRTC fills the entire screen before and
113417ca54c3Smrg	after may necessitate disabling the CRTC, resizing the screen,
113517ca54c3Smrg	then re-enabling the CRTC at the new configuration to avoid an
113617ca54c3Smrg	invalid intermediate configuration.
113717ca54c3Smrg
113817ca54c3Smrg	If panning is enabled, the width and height of the panning and the
113917ca54c3Smrg	tracking areas are clamped to the new mode size.
114017ca54c3Smrg	Disabled panning axes remain disabled.
114117ca54c3Smrg	Panning borders are disabled if their requirements are no longer met
114217ca54c3Smrg	(see RRSetPanning).
114317ca54c3Smrg
114417ca54c3Smrg	When this request succeeds, 'status' contains Success and the
114517ca54c3Smrg	requested changes to configuration will have been made.
114617ca54c3Smrg
114717ca54c3Smrg	'new-time-stamp' contains the time at which this request was
114817ca54c3Smrg	executed.
114917ca54c3Smrg
115017ca54c3Smrg┌───
115117ca54c3Smrg    RRGetCrtcGammaSize
115217ca54c3Smrg	crtc: CRTC
115317ca54c3Smrg115417ca54c3Smrg	size: CARD16
115517ca54c3Smrg└───
115617ca54c3Smrg	Errors: Crtc
115717ca54c3Smrg
115817ca54c3Smrg	This request returns the size of the gamma ramps used by 'crtc'.
115917ca54c3Smrg
116017ca54c3Smrg┌───
116117ca54c3Smrg    RRGetCrtcGamma
116217ca54c3Smrg	crtc: CRTC
116317ca54c3Smrg116417ca54c3Smrg	red: LISTofCARD16
116517ca54c3Smrg	green: LISTofCARD16
116617ca54c3Smrg	blue: LISTofCARD16
116717ca54c3Smrg└───
116817ca54c3Smrg	Errors: Crtc
116917ca54c3Smrg
117017ca54c3Smrg	This request returns the currently set gamma ramps for 'crtc'.  All
117117ca54c3Smrg	three lists will be the size returned by the RRGetCrtcGammaSize
117217ca54c3Smrg	request.
117317ca54c3Smrg
117417ca54c3Smrg┌───
117517ca54c3Smrg    RRSetCrtcGamma
117617ca54c3Smrg	crtc: CRTC
117717ca54c3Smrg	red: LISTofCARD16
117817ca54c3Smrg	green: LISTofCARD16
117917ca54c3Smrg	blue: LISTofCARD16
118017ca54c3Smrg└───
118117ca54c3Smrg	Errors: Crtc, Match
118217ca54c3Smrg
118317ca54c3Smrg	This request sets the gamma ramps for 'crtc'. All three lists
118417ca54c3Smrg	must be the size returned by RRGetCrtcGammaSize else a Value error
118517ca54c3Smrg	results.
118617ca54c3Smrg
118717ca54c3Smrg7.2. Extension Requests added in version 1.3 of the extension
118817ca54c3Smrg
118917ca54c3Smrg┌───
119017ca54c3Smrg    RRGetScreenResourcesCurrent
119117ca54c3Smrg	window: WINDOW
119217ca54c3Smrg119317ca54c3Smrg	timestamp: TIMESTAMP
119417ca54c3Smrg	config-timestamp: TIMESTAMP
119517ca54c3Smrg	crtcs: LISTofCRTC
119617ca54c3Smrg	outputs: LISTofOUTPUT
119717ca54c3Smrg	modes: LISTofMODEINFO
119817ca54c3Smrg└───
119917ca54c3Smrg	Errors: Window
120017ca54c3Smrg
120117ca54c3Smrg	RRGetScreenResourcesCurrent returns the list of outputs and crtcs
120217ca54c3Smrg	connected to the screen associated with 'window'.
120317ca54c3Smrg
120417ca54c3Smrg	'timestamp' indicates when the configuration was last set.
120517ca54c3Smrg
120617ca54c3Smrg	'config-timestamp' indicates when the configuration information last
120717ca54c3Smrg	changed. Requests to configure the output will fail unless the
120817ca54c3Smrg	timestamp indicates that the information the client is using is up
120917ca54c3Smrg	to date, to ensure clients can be well behaved in the face of race
121017ca54c3Smrg	conditions.
121117ca54c3Smrg
121217ca54c3Smrg	'crtcs' contains the list of CRTCs associated with the screen.
121317ca54c3Smrg
121417ca54c3Smrg	'outputs' contains the list of outputs associated with the screen.
121517ca54c3Smrg
121617ca54c3Smrg	'modes' contains the list of modes associated with the screen.
121717ca54c3Smrg
121817ca54c3Smrg	Unlike RRGetScreenResources, this merely returns the current
121917ca54c3Smrg	configuration, and does not poll for hardware changes.
122017ca54c3Smrg
122117ca54c3Smrg┌───
122217ca54c3Smrg    RRSetCrtcTransform
122317ca54c3Smrg	crtc: CRTC
122417ca54c3Smrg	transform: TRANSFORM
122517ca54c3Smrg	filter: STRING8
122617ca54c3Smrg	values: LISTofFIXED
122717ca54c3Smrg└───
122817ca54c3Smrg	Errors: Crtc, Match
122917ca54c3Smrg
123017ca54c3Smrg	This request provides a mechanism that is more general than the
123117ca54c3Smrg	existing rotation and reflection values for describing the
123217ca54c3Smrg	transformation from frame buffer image to crtc presentation.
123317ca54c3Smrg	'transform' is a full 2D projective transformation from screen
123417ca54c3Smrg	coordinate space to crtc coordinate space. This transformation is
123517ca54c3Smrg	applied before the rotation and reflection values to compute the
123617ca54c3Smrg	complete transform.
123717ca54c3Smrg
123817ca54c3Smrg	'filter' and 'values' specify a Render filter that may be used by the
123917ca54c3Smrg	server when transforming data from frame buffer to crtc.
124017ca54c3Smrg
124117ca54c3Smrg	This request sets the transform to be used at the next
124217ca54c3Smrg	RRSetCrtcConfig request execution; it does not cause any change to
124317ca54c3Smrg	occur in the current configuration.
124417ca54c3Smrg
124517ca54c3Smrg	When a non-identity transformation is in use, the rectangle returned
124617ca54c3Smrg	by RRGetCrtcInfo defines the bounding rectangle of the screen that is
124717ca54c3Smrg	projected to the crtc. It is this projected rectangle which must be
124817ca54c3Smrg	within the area of the screen when the mode is set.
124917ca54c3Smrg
125017ca54c3Smrg┌───
125117ca54c3Smrg    RRGetCrtcTransform
125217ca54c3Smrg	crtc: CRTC
125317ca54c3Smrg125417ca54c3Smrg	pending-transform: TRANSFORM
125517ca54c3Smrg	pending-filter: STRING8
125617ca54c3Smrg	pending-values: LISTofFIXED
125717ca54c3Smrg	current-transform: TRANSFORM
125817ca54c3Smrg	current-filter: STRING8
125917ca54c3Smrg	current-values: LISTofFIXED
126017ca54c3Smrg└───
126117ca54c3Smrg
126217ca54c3Smrg	This request returns the pending and current transforms for the
126317ca54c3Smrg	specified CRTC. The pending transform will be the same as the current
126417ca54c3Smrg	transform if no new pending transform has been set since the last call
126517ca54c3Smrg	to RRSetCrtcConfig.
126617ca54c3Smrg
126717ca54c3Smrg┌───
126817ca54c3Smrg    RRGetPanning
126917ca54c3Smrg	crtc: CRTC
127017ca54c3Smrg127117ca54c3Smrg	status: RRCONFIGSTATUS
127217ca54c3Smrg	timestamp: TIMESTAMP
127317ca54c3Smrg	left, top, width, height: CARD16
127417ca54c3Smrg	track_left, track_top, track_width, track_height: CARD16
127517ca54c3Smrg	border_left, border_top, border_right, border_bottom: INT16
127617ca54c3Smrg└───
127717ca54c3Smrg
127817ca54c3Smrg	Errors: Crtc
127917ca54c3Smrg
128017ca54c3Smrg	Version 1.3 adds panning support again. If multiple crtcs are active
128117ca54c3Smrg	the panning behavior can be defined per crtc individually.
128217ca54c3Smrg	RRGetPanning returns information about the currently set panning
128317ca54c3Smrg	configuration for the specified crtc.  If the CRTC does not support
128417ca54c3Smrg	panning, all fields (except timestamp) will be 0.
128517ca54c3Smrg
128617ca54c3Smrg	'timestamp' indicates when the configuration was last set.
128717ca54c3Smrg
128817ca54c3Smrg	All other entries are explained for RRSetPanning.
128917ca54c3Smrg
129017ca54c3Smrg┌───
129117ca54c3Smrg    RRSetPanning
129217ca54c3Smrg	crtc: CRTC
129317ca54c3Smrg	timestamp: TIMESTAMP
129417ca54c3Smrg	left, top, width, height: CARD16
129517ca54c3Smrg	track_left, track_top, track_width, track_height: CARD16
129617ca54c3Smrg	border_left, border_top, border_right, border_bottom: INT16
129717ca54c3Smrg129817ca54c3Smrg	status: RRCONFIGSTATUS
129917ca54c3Smrg	new-timestamp: TIMESTAMP
130017ca54c3Smrg└───
130117ca54c3Smrg	Errors: Crtc, Match
130217ca54c3Smrg
130317ca54c3Smrg	This request sets the panning parameters.  As soon as panning is
130417ca54c3Smrg	enabled, the CRTC position can change with every pointer move.
130517ca54c3Smrg	RRCrtcChangeNotify events are sent to the clients requesting those.
130617ca54c3Smrg
130717ca54c3Smrg	If 'timestamp' is less than the time when the configuration was last
130817ca54c3Smrg	successfully set, the request is ignored and InvalidTime returned in
130917ca54c3Smrg	status.
131017ca54c3Smrg
131117ca54c3Smrg	┌──┳━━━━━━━━━━━━━━┳─────┬ ─ ─ ─ ─ ─ ┐
131217ca54c3Smrg	│  ┃     CRTC     ┃     │
131317ca54c3Smrg	│  ┃              ┃     │           │
131417ca54c3Smrg	│  ┃             X┃→    │
131517ca54c3Smrg	│  ┃              ┃     │           │  framebuffer
131617ca54c3Smrg	│  ┗━━━━━━━━━━━━━━┛     │
131717ca54c3Smrg	│                       │           │
131817ca54c3Smrg	│panning area           │
131917ca54c3Smrg	└───────────────────────┴ ─ ─ ─ ─ ─ ┘
132017ca54c3Smrg
132117ca54c3Smrg	'left', 'top', 'width', and 'height' contain the total panning area
132217ca54c3Smrg	for this CRTC.  'width' has to be larger than or equal to the CRTC's
132317ca54c3Smrg	width or 0, and 'left'+'width' must be within the screen size, else a
132417ca54c3Smrg	Match error results.  Equivalent restrictions for the height exist.
132517ca54c3Smrg	'width' or 'height' set to 0 indicate that panning should be disabled
132617ca54c3Smrg	on the according axis.  Setting 'width'/'height' to the CRTC's
132717ca54c3Smrg	width/height will disable panning on the X/Y axis as well, but
132817ca54c3Smrg	RRSetScreenSize will silently enable panning if the screen size is
132917ca54c3Smrg	increased. This does not happen if set to 0.
133017ca54c3Smrg
133117ca54c3Smrg	┌────────┳━━━━━━━━━━━━━━┳ ─ ─ ─ ─ ─ ┐
133217ca54c3Smrg	│        ┃     CRTC     ┃
133317ca54c3Smrg	│        ┃              ┃           │
133417ca54c3Smrg	│        ┃              ┃
133517ca54c3Smrg	│        ┃              ┃           │  tracking area
133617ca54c3Smrg	│        ┗━━━━━━━━━━━━━━┫     X
133717ca54c3Smrg	│               ↓       │     ↓     │
133817ca54c3Smrg	│panning area           │
133917ca54c3Smrg	└───────────────────────┴ ─ ─ ─ ─ ─ ┘
134017ca54c3Smrg
134117ca54c3Smrg	'track_left', 'track_top', 'track_width', and 'track_height' contain
134217ca54c3Smrg	the pointer area for which the panning region is updated.  For normal
134317ca54c3Smrg	use cases it should enclose the panning area minus borders, and is
134417ca54c3Smrg	typically set to either the panning area minus borders, or to the
134517ca54c3Smrg	total screen size. If set to the total screen size, the CRTC will pan
134617ca54c3Smrg	in the remaining axis even if the pointer is outside the panning area
134717ca54c3Smrg	on a different CRTC, as shown in the figure above. If the pointer is
134817ca54c3Smrg	outside the tracking area, the CRTC will not pan. Zero can be used as
134917ca54c3Smrg	an alias for the total screen size.
135017ca54c3Smrg
135117ca54c3Smrg	┌──┳━━━━━━━━━━━━━━┳────────────┐
135217ca54c3Smrg	│  ┃     CRTC     ┃            │
135317ca54c3Smrg	│  ┃              ┃            │
135417ca54c3Smrg	│  ┃              ┃→           │
135517ca54c3Smrg	│  ┃           X←→┃            │
135617ca54c3Smrg	│  ┃       border_right        │
135717ca54c3Smrg	│  ┗━━━━━━━━━━━━━━┛            │
135817ca54c3Smrg	│                              │
135917ca54c3Smrg	│panning area                  │
136017ca54c3Smrg	└──────────────────────────────┘
136117ca54c3Smrg
136217ca54c3Smrg	'border_left', 'border_top', 'border_right', and 'border_bottom'
136317ca54c3Smrg	define the distances from the CRTC borders that will activate panning
136417ca54c3Smrg	if the pointer hits them.  If the borders are 0, the screen will pan
136517ca54c3Smrg	when the pointer hits the CRTC borders (behavior of pre-RandR Xserver
136617ca54c3Smrg	panning).  If the borders are positive, the screen will pan when the
136717ca54c3Smrg	pointer gets close to the CRTC borders, if they are negative, the
136817ca54c3Smrg	screen will only pan when the pointer is already way past the CRTC
136917ca54c3Smrg	borders.  Negative values might confuse users and disable panning to
137017ca54c3Smrg	the very edges of the screen.  Thus they are discouraged.
137117ca54c3Smrg	border_left + border_right has to be lower or equal than the CRTC's
137217ca54c3Smrg	width, else a Match error results.  An equivalent restriction for the
137317ca54c3Smrg	height exists.
137417ca54c3Smrg
137517ca54c3Smrg	Screen size changes update the panning and the tracking areas to the
137617ca54c3Smrg	new size. Both screen size changes and mode changes clamp these areas
137717ca54c3Smrg	to the current CRTC size.  In these cases panning borders are disabled
137817ca54c3Smrg	if their requirements are no longer met.
137917ca54c3Smrg
138017ca54c3Smrg	When this request succeeds, 'status' contains Success and the
138117ca54c3Smrg	requested changes to configuration will have been made.
138217ca54c3Smrg
138317ca54c3Smrg	'new-time-stamp' contains the time at which this request was
138417ca54c3Smrg	executed.
138517ca54c3Smrg
138617ca54c3Smrg┌───
138717ca54c3Smrg    RRSetOutputPrimary
138817ca54c3Smrg	window: WINDOW
138917ca54c3Smrg	output: OUTPUT
139017ca54c3Smrg└───
139117ca54c3Smrg	Errors: Match, Output, Window
139217ca54c3Smrg
139317ca54c3Smrg	RRSetOutputPrimary marks 'output' as the primary output for the
139417ca54c3Smrg	screen with the same root window as 'window'. This output's CRTC
139517ca54c3Smrg	will be sorted to the front of the list in Xinerama and RANDR
139617ca54c3Smrg	geometry requests for the benefit of older applications. The
139717ca54c3Smrg	default primary output is None, and None is a legal value to pass
139817ca54c3Smrg	to RRSetOutputPrimary. This request is expected to be used by
139917ca54c3Smrg	desktop environments to mark the screen that should hold the primary
140017ca54c3Smrg	menu bar or panel.
140117ca54c3Smrg
140217ca54c3Smrg	As this changes the logical layout of the screen, ConfigureNotify
140317ca54c3Smrg	and RRScreenChangeNotify will be generated on the appropriate root
140417ca54c3Smrg	window when the primary output is changed by this call. This request
140517ca54c3Smrg	also generates RROutputChangeNotify events on the outputs that gained
140617ca54c3Smrg	and lost primary status.
140717ca54c3Smrg
140817ca54c3Smrg	If an output is disconnected asynchronously (eg. due to recabling),
140917ca54c3Smrg	the primary status does not change, but RROutputChangeNotify events
141017ca54c3Smrg	will be generated if the hardware is capable of detecting this;
141117ca54c3Smrg	clients are expected to reconfigure if appropriate.
141217ca54c3Smrg
141317ca54c3Smrg	If an output is deleted (eg. due to device hotplug), the server will
141417ca54c3Smrg	act as though None was passed to RRSetOutputPrimary, including
141517ca54c3Smrg	generating the appropriate events.
141617ca54c3Smrg
141717ca54c3Smrg┌───
141817ca54c3Smrg    RRGetOutputPrimary
141917ca54c3Smrg	window: WINDOW
142017ca54c3Smrg142117ca54c3Smrg	output: OUTPUT
142217ca54c3Smrg└───
142317ca54c3Smrg	Errors: Window
142417ca54c3Smrg
142517ca54c3Smrg	RRGetOutputPrimary returns the primary output for the screen.
142617ca54c3Smrg
142717ca54c3Smrg			      ❧❧❧❧❧❧❧❧❧❧❧
142817ca54c3Smrg
142917ca54c3Smrg7.4 Extension Requests added in version 1.4 of the extension.
143017ca54c3Smrg
143117ca54c3Smrg┌───
143217ca54c3Smrg    RRGetProviders
143317ca54c3Smrg	window : WINDOW
143417ca54c3Smrg143517ca54c3Smrg	timestamp: TIMESTAMP
143617ca54c3Smrg	providers: LISTofPROVIDER
143717ca54c3Smrg└───
143817ca54c3Smrg	Errors: Window
143917ca54c3Smrg
144017ca54c3Smrg	RRGetProviders returns the list of providers connected to the screen
144117ca54c3Smrg	associated with 'window'.
144217ca54c3Smrg
144317ca54c3Smrg	'timestamp' indicates when the configuration was last set.
144417ca54c3Smrg
144517ca54c3Smrg	'providers' contains the list of PROVIDERs associated with the
144617ca54c3Smrg	screen.
144717ca54c3Smrg
144817ca54c3Smrg┌───
144917ca54c3Smrg    RRGetProviderInfo
145017ca54c3Smrg	provider: PROVIDER
145117ca54c3Smrg145217ca54c3Smrg	capabilities: PROVIDER_CAPS
145317ca54c3Smrg	name: STRING
145417ca54c3Smrg	crtcs: LISTofCRTC
145517ca54c3Smrg	outputs: LISTofOUTPUT
145617ca54c3Smrg	associated_providers: LISTofPROVIDERS
145717ca54c3Smrg	associated_provider_capability: LISTofPROVIDER_CAPS
145817ca54c3Smrg└───
145917ca54c3Smrg	Errors: Provider
146017ca54c3Smrg
146117ca54c3Smrg	RRGetProviderInfo return information about the specified provider.
146217ca54c3Smrg	The capabilities of the current provider are returned, along with
146317ca54c3Smrg	the list of providers currently associated with this provider and
146417ca54c3Smrg	the capability they are associated with. It also provides the list
146517ca54c3Smrg	of crtcs and outputs that this provider is responsible for.
146617ca54c3Smrg
146717ca54c3Smrg	'name' is a UTF-8 encoded string to be presented to the user to
146817ca54c3Smrg	indicate the device or driver supplied name.
146917ca54c3Smrg
147017ca54c3Smrg┌───
147117ca54c3Smrg    RRSetProviderOffloadSink
147217ca54c3Smrg	provider: PROVIDER
147317ca54c3Smrg	sink_provider: PROVIDER
147417ca54c3Smrg	config-timestamp: TIMESTAMP
147517ca54c3Smrg└───
147617ca54c3Smrg	Errors: Provider
147717ca54c3Smrg
147817ca54c3Smrg	RRSetOffloadSink sets the offload sink for this provider to the
147917ca54c3Smrg	specified provider.
148017ca54c3Smrg
148117ca54c3Smrg┌───
148217ca54c3Smrg    RRSetProviderOutputSource
148317ca54c3Smrg	provider: PROVIDER
148417ca54c3Smrg	source_provider: PROVIDER
148517ca54c3Smrg	config-timestamp: TIMESTAMP
148617ca54c3Smrg└───
148717ca54c3Smrg	Errors: Provider
148817ca54c3Smrg
148917ca54c3Smrg	RRSetOutputSource sets the output source for this provider to the
149017ca54c3Smrg	specified provider.
149117ca54c3Smrg
149217ca54c3Smrg┌───
149317ca54c3Smrg    RRListProviderProperties
149417ca54c3Smrg	provider:PROVIDERS
149517ca54c3Smrg149617ca54c3Smrg	atoms: LISTofATOM
149717ca54c3Smrg└───
149817ca54c3Smrg	Errors: Provider
149917ca54c3Smrg
150017ca54c3Smrg	This request returns the atoms of properties currently defined on
150117ca54c3Smrg	the provider.
150217ca54c3Smrg
150317ca54c3Smrg┌───
150417ca54c3Smrg    RRQueryProviderProperty
150517ca54c3Smrg	provider: PROVIDER
150617ca54c3Smrg	property: ATOM
150717ca54c3Smrg150817ca54c3Smrg	pending: BOOL
150917ca54c3Smrg	range: BOOL
151017ca54c3Smrg	immutable: BOOL
151117ca54c3Smrg	valid-values: LISTofINT32
151217ca54c3Smrg└───
151317ca54c3Smrg	Errors: Name, Atom, Provider
151417ca54c3Smrg
151517ca54c3Smrg	If the specified property does not exist for the specified provider,
151617ca54c3Smrg	then a Name error is returned.
151717ca54c3Smrg
151817ca54c3Smrg	If 'pending' is TRUE, changes made to property values with
151917ca54c3Smrg	RRChangeProviderProperty will be saved in the pending property value
152017ca54c3Smrg	and be automatically copied to the current value on the next
152117ca54c3Smrg	RRSetCrtcConfig request on a crtc attached to that provider.
152217ca54c3Smrg	If 'pending' is	FALSE, changes are copied immediately.
152317ca54c3Smrg
152417ca54c3Smrg	If 'range' is TRUE, then the valid-values list will contain
152517ca54c3Smrg	precisely two values indicating the minimum and maximum allowed
152617ca54c3Smrg	values. If 'range' is FALSE, then the valid-values list will contain
152717ca54c3Smrg	the list of possible values; attempts to set other values will
152817ca54c3Smrg	result in a Value error.
152917ca54c3Smrg
153017ca54c3Smrg	If 'immutable' is TRUE, then the property configuration cannot be
153117ca54c3Smrg	changed by clients. Immutable properties are interpreted by the X
153217ca54c3Smrg	server.
153317ca54c3Smrg
153417ca54c3Smrg┌───
153517ca54c3Smrg    RRConfigureProviderProperty
153617ca54c3Smrg	provider: PROVIDER
153717ca54c3Smrg	property: ATOM
153817ca54c3Smrg	pending: BOOL
153917ca54c3Smrg	range: BOOL
154017ca54c3Smrg	valid-values: LISTofINT32
154117ca54c3Smrg└───
154217ca54c3Smrg	Errors: Access, Name, Atom, Provider
154317ca54c3Smrg
154417ca54c3Smrg	If the specified property is 'immutable', an Access error is
154517ca54c3Smrg	returned.
154617ca54c3Smrg
154717ca54c3Smrg	Otherwise, the configuration of the specified property is changed to
154817ca54c3Smrg	the values provided in this request.
154917ca54c3Smrg
155017ca54c3Smrg	If the specified property does not exist for the specified provider,
155117ca54c3Smrg	it is created with an empty value and None type.
155217ca54c3Smrg
155317ca54c3Smrg┌───
155417ca54c3Smrg    RRChangeProviderProperty
155517ca54c3Smrg	provider: PROVIDER
155617ca54c3Smrg	property, type: ATOM
155717ca54c3Smrg	format: {8, 16, 32}
155817ca54c3Smrg	mode: { Replace, Prepend, Append }
155917ca54c3Smrg	data: LISTofINT8 or LISTofINT16 or LISTofINT32
156017ca54c3Smrg└───
156117ca54c3Smrg	Errors: Alloc, Atom, Match, Value, Provider
156217ca54c3Smrg
156317ca54c3Smrg	This request alters the value of the property for the specified
156417ca54c3Smrg	provider. If the property is marked as a 'pending' property, only the
156517ca54c3Smrg	pending value of the property is changed. Otherwise, changes are
156617ca54c3Smrg	reflected in both the pending and current values of the property.
156717ca54c3Smrg	The type is uninterpreted by the server.  The format specifies
156817ca54c3Smrg	whether the data should be viewed as a list of 8-bit, 16-bit, or
156917ca54c3Smrg	32-bit quantities so that the server can correctly byte-swap as
157017ca54c3Smrg	necessary.
157117ca54c3Smrg
157217ca54c3Smrg	If the mode is Replace, the previous property value is discarded.
157317ca54c3Smrg	If the mode is Prepend or Append, then the type and format must
157417ca54c3Smrg	match the existing property value (or a Match error results).  If
157517ca54c3Smrg	the property is undefined, it is treated as defined with the correct
157617ca54c3Smrg	type and format with zero-length data.
157717ca54c3Smrg
157817ca54c3Smrg	For Prepend, the data is tacked on to the beginning of the existing
157917ca54c3Smrg	data, and for Append, it is tacked on to the end of the existing data.
158017ca54c3Smrg
158117ca54c3Smrg	This request generates a ProviderPropertyNotify
158217ca54c3Smrg
158317ca54c3Smrg	The lifetime of a property is not tied to the storing client.
158417ca54c3Smrg	Properties remain until explicitly deleted, until the provider is
158517ca54c3Smrg	destroyed, or until server reset (see section 10).
158617ca54c3Smrg
158717ca54c3Smrg	The maximum size of a property is server-dependent and may vary
158817ca54c3Smrg	dynamically.
158917ca54c3Smrg┌───
159017ca54c3Smrg    RRDeleteProviderProperty
159117ca54c3Smrg	provider: Provider
159217ca54c3Smrg	property: ATOM
159317ca54c3Smrg└───
159417ca54c3Smrg	Errors: Atom, Provider
159517ca54c3Smrg
159617ca54c3Smrg	This request deletes the property from the specified provider if the
159717ca54c3Smrg	property exists and generates a ProviderPropertyNotify event unless
159817ca54c3Smrg	the property does not exist.
159917ca54c3Smrg
160017ca54c3Smrg┌───
160117ca54c3Smrg    RRGetProviderProperty
160217ca54c3Smrg	provider: PROVIDER
160317ca54c3Smrg	property: ATOM
160417ca54c3Smrg	type: ATOM or AnyPropertyType
160517ca54c3Smrg	long-offset, long-length: CARD32
160617ca54c3Smrg	delete: BOOL
160717ca54c3Smrg	pending: BOOL
160817ca54c3Smrg160917ca54c3Smrg	type: ATOM or None
161017ca54c3Smrg	format: {0, 8, 16, 32}
161117ca54c3Smrg	bytes-after: CARD32
161217ca54c3Smrg	value: LISTofINT8 or LISTofINT16 or LISTofINT32
161317ca54c3Smrg└───
161417ca54c3Smrg	Errors: Atom, Value, Provider
161517ca54c3Smrg
161617ca54c3Smrg	If the specified property does not exist for the specified provider,
161717ca54c3Smrg	then the return type is None, the format and bytes-after are zero,
161817ca54c3Smrg	and the value is empty.  The delete argument is ignored in this
161917ca54c3Smrg	case.
162017ca54c3Smrg
162117ca54c3Smrg	If the specified property exists but its type does not match the
162217ca54c3Smrg	specified type, then the return type is the actual type of the
162317ca54c3Smrg	property, the format is the actual format of the property (never
162417ca54c3Smrg	zero), the bytes-after is the length of the property in bytes (even
162517ca54c3Smrg	if the format is 16 or 32), and the value is empty.  The delete
162617ca54c3Smrg	argument is ignored in this case.
162717ca54c3Smrg
162817ca54c3Smrg	If the specified property exists and either AnyPropertyType is
162917ca54c3Smrg	specified or the specified type matches the actual type of the
163017ca54c3Smrg	property, then the return type is the actual type of the property,
163117ca54c3Smrg	the format is the actual format of the property (never zero), and
163217ca54c3Smrg	the bytes-after and value are as follows, given:
163317ca54c3Smrg
163417ca54c3Smrg		N = actual length of the stored property in bytes
163517ca54c3Smrg				  (even if the format is 16 or 32)
163617ca54c3Smrg		I = 4 × offset
163717ca54c3Smrg		T = N - I
163817ca54c3Smrg		L = MINIMUM(T, 4 × long-length)
163917ca54c3Smrg		A = N - (I + L)
164017ca54c3Smrg
164117ca54c3Smrg	If 'pending' is true, and if the property holds a pending value,
164217ca54c3Smrg	then the value returned will be the pending value of the property
164317ca54c3Smrg	rather than the current value.  The returned value starts at byte
164417ca54c3Smrg	index I in the property (indexing from 0), and its length in bytes
164517ca54c3Smrg	is L.  However, it is a Value error if long-offset is given such
164617ca54c3Smrg	that L is negative.  The value of bytes-after is A, giving the
164717ca54c3Smrg	number of trailing unread bytes in the stored property.  If delete
164817ca54c3Smrg	is True and the bytes-after is zero, the property is also deleted
164917ca54c3Smrg	from the provider, and a RRProviderPropertyNotify event is generated.
165017ca54c3Smrg
165117ca54c3Smrg
165217ca54c3Smrg			      ❧❧❧❧❧❧❧❧❧❧❧
165317ca54c3Smrg
165417ca54c3Smrg7.5. Extension Requests added in version 1.5 of the extension.
165517ca54c3Smrg
165617ca54c3Smrg┌───
165717ca54c3Smrg    RRGetMonitors
165817ca54c3Smrg	window : WINDOW
165917ca54c3Smrg	get_active : BOOL
166017ca54c3Smrg166117ca54c3Smrg	timestamp: TIMESTAMP
166217ca54c3Smrg	monitors: LISTofMONITORINFO
166317ca54c3Smrg└───
166417ca54c3Smrg	Errors: Window
166517ca54c3Smrg
166617ca54c3Smrg	Returns the list of Monitors for the screen containing
166717ca54c3Smrg	'window'. If 'get_active' is set it returns only active
166817ca54c3Smrg	monitors (non-0x0 monitors).  'get_active' should always
166917ca54c3Smrg	be set by toolkits, and not by configuration clients.
167017ca54c3Smrg
167117ca54c3Smrg	'timestamp' indicates the server time when the list of
167217ca54c3Smrg	monitors last changed.
167317ca54c3Smrg
167417ca54c3Smrg┌───
167517ca54c3Smrg    RRSetMonitor
167617ca54c3Smrg	window : WINDOW
167717ca54c3Smrg	info: MONITORINFO
167817ca54c3Smrg└───
167917ca54c3Smrg	Errors: Window, Output, Atom, Value
168017ca54c3Smrg
168117ca54c3Smrg	Create a new monitor. Any existing Monitor of the same name is deleted.
168217ca54c3Smrg
168317ca54c3Smrg	'name' must be a valid atom or an Atom error results.
168417ca54c3Smrg
168517ca54c3Smrg	'name' must not match the name of any Output on the screen, or
168617ca54c3Smrg	a Value error results.
168717ca54c3Smrg
168817ca54c3Smrg	If 'info.outputs' is non-empty, and if x, y, width, height are all
168917ca54c3Smrg	zero, then the Monitor geometry will be dynamically defined to
169017ca54c3Smrg	be the bounding box of the geometry of the active CRTCs
169117ca54c3Smrg	associated with them.
169217ca54c3Smrg
169317ca54c3Smrg	If 'name' matches an existing Monitor on the screen, the
169417ca54c3Smrg	existing one will be deleted as if RRDeleteMonitor were called.
169517ca54c3Smrg
169668872e7fSmrg	If an 'info.output' contains only the automatically generated default
169768872e7fSmrg	monitor, this is replaced by the new monitor. If the 'info.output' already
169868872e7fSmrg	contains a user-defined monitor, the new monitor will be added.
169968872e7fSmrg	This allows to have more than one monitor on an output (e.g. to split an
170068872e7fSmrg	output into multiple virtual monitors).
170117ca54c3Smrg
170217ca54c3Smrg	Only one monitor per screen may be primary. If 'info.primary'
170317ca54c3Smrg	is true, then the primary value will be set to false on all
170417ca54c3Smrg	other monitors on the screen.
170517ca54c3Smrg
170617ca54c3Smrg	RRSetMonitor generates a ConfigureNotify event on the root
170717ca54c3Smrg	window of the screen.
170817ca54c3Smrg
170917ca54c3Smrg┌───
171017ca54c3Smrg    RRDeleteMonitor
171117ca54c3Smrg	window : WINDOW
171217ca54c3Smrg	name: ATOM
171317ca54c3Smrg└───
171417ca54c3Smrg	Errors: Window, Atom, Value
171517ca54c3Smrg
171617ca54c3Smrg	Deletes the named Monitor.
171717ca54c3Smrg
171817ca54c3Smrg	'name' must be a valid atom or an Atom error results.
171917ca54c3Smrg
172017ca54c3Smrg	'name' must match the name of a Monitor on the screen, or a
172117ca54c3Smrg	Value error results.
172217ca54c3Smrg
172368872e7fSmrg	If the last user-defined monitor is removed from an 'info.output',
172468872e7fSmrg	the automatically generated default monitor will be restored. It is not
172568872e7fSmrg	possible to delete the automatically generated default monitor.
172668872e7fSmrg
172717ca54c3Smrg	RRDeleteMonitor generates a ConfigureNotify event on the root
172817ca54c3Smrg	window of the screen.
172917ca54c3Smrg
173017ca54c3Smrg			      ❧❧❧❧❧❧❧❧❧❧❧
173117ca54c3Smrg
173217ca54c3Smrg7.6. Extension Requests added in version 1.6 of the extension.
173317ca54c3Smrg
173417ca54c3Smrg┌───
173517ca54c3Smrg    RRCreateLease
173617ca54c3Smrg	window : WINDOW
173717ca54c3Smrg	lid: LEASE
173817ca54c3Smrg	crtcs: LISTofCRTC
173917ca54c3Smrg	outputs: LISTofOUTPUT
174017ca54c3Smrg174117ca54c3Smrg	nfd: CARD8
174217ca54c3Smrg	lease: FD
174317ca54c3Smrg└───
174417ca54c3Smrg	Errors: IdChoice, Window, Access, Value, CRTC, Output
174517ca54c3Smrg
174617ca54c3Smrg	Creates a new Lease called 'lid' for the specified crtcs and
174717ca54c3Smrg	outputs from the screen defined by 'window'. Returns a KMS/DRM
174817ca54c3Smrg	file descriptor which can control the leased objects directly
174917ca54c3Smrg	through the kernel. While leased, all resources will appear to
175017ca54c3Smrg	be 'useless' to clients other than the leasing client as
175117ca54c3Smrg	follows:
175217ca54c3Smrg
175317ca54c3Smrg	• Crtcs are reported as having no 'possible-outputs' and all
175417ca54c3Smrg	  other values reported as if the crtc were disabled.
175517ca54c3Smrg
175617ca54c3Smrg	• Outputs are reported as having no crtcs they can be
175717ca54c3Smrg	  connected to, no clones they can share a crtc with, will
175817ca54c3Smrg	  report a connection status of Disconnected, and will show
175917ca54c3Smrg	  the current crtc as if it were disabled.
176017ca54c3Smrg
176117ca54c3Smrg	The lease remains in effect until the file descriptor is
176217ca54c3Smrg	closed, even if the client holding the lease disconnects from
176317ca54c3Smrg	the X server.
176417ca54c3Smrg
176517ca54c3Smrg	Returns an Access error if any of the named resources are
176617ca54c3Smrg	already leased to another client.
176717ca54c3Smrg
176817ca54c3Smrg┌───
176917ca54c3Smrg    RRFreeLease
177017ca54c3Smrg	lid: LEASE
177117ca54c3Smrg	terminate: BOOL
177217ca54c3Smrg└───
177317ca54c3Smrg	Errors: Lease
177417ca54c3Smrg
177517ca54c3Smrg	Frees the reference to the lease 'lid'. If 'terminate' is
177617ca54c3Smrg	true, then the lease is terminated and all leased resources
177717ca54c3Smrg	returned to the X server. If 'terminate' is false, then the
177817ca54c3Smrg	lease remains in effect, but the X server no longer has a name
177917ca54c3Smrg	for it.
178017ca54c3Smrg
178117ca54c3Smrg			      ❧❧❧❧❧❧❧❧❧❧❧
178217ca54c3Smrg8. Extension Events
178317ca54c3Smrg
178417ca54c3SmrgClients MAY select for ConfigureNotify on the root window to be
178517ca54c3Smrginformed of screen changes. This may be advantageous if all your
178617ca54c3Smrgclient needs to know is the size of the root window, as it avoids
178717ca54c3Smrground trips to set up the extension.
178817ca54c3Smrg
178917ca54c3SmrgRRScreenChangeNotify is sent if RRSelectInput has requested it
179017ca54c3Smrgwhenever properties of the screen change, which may be due to external
179117ca54c3Smrgfactors, such as re-cabling a monitor, etc.
179217ca54c3Smrg
179317ca54c3Smrg┌───
179417ca54c3Smrg    RRScreenChangeNotify
179517ca54c3Smrg
179617ca54c3Smrg	rotation: ROTATION;		new rotation
179717ca54c3Smrg	sequenceNumber: CARD16		low 16 bits of request seq. number
179817ca54c3Smrg	timestamp: TIMESTAMP		time screen was changed
179917ca54c3Smrg	configTimestamp: TIMESTAMP	time config data was changed
180017ca54c3Smrg	root: WINDOW			root window of screen
180117ca54c3Smrg	window: WINDOW			window requesting notification
180217ca54c3Smrg	size-id: SIZEID			index of new SCREENSIZE
180317ca54c3Smrg	subpixelOrder: SUBPIXELORDER	order of subpixels
180417ca54c3Smrg	widthInPixels: CARD16		width in pixels of the new SCREENSIZE
180517ca54c3Smrg	heightInPixels: CARD16		height in pixels of the new SCREENSIZE
180617ca54c3Smrg	widthInMillimeters: CARD16	width in mm of the new SCREENSIZE
180717ca54c3Smrg	heightInMillimeters: CARD16	height in mm of the new SCREENSIZE
180817ca54c3Smrg└───
180917ca54c3Smrg	This event is generated whenever the screen configuration is changed
181017ca54c3Smrg	and sent to requesting clients. 'timestamp' indicates when the
181117ca54c3Smrg	screen configuration was changed. 'configTimestamp' says when the
181217ca54c3Smrg	last time the configuration was changed. 'root' is the root of the
181317ca54c3Smrg	screen the change occurred on, 'window' is window selecting for this
181417ca54c3Smrg	event. 'size-id' contains the index of the current size.
181517ca54c3Smrg
181617ca54c3Smrg	This event is sent whenever the screen's configuration changes
181717ca54c3Smrg	or if a new screen configuration becomes available that was
181817ca54c3Smrg	not available in the past. In this case (config-timestamp in
181917ca54c3Smrg	the event not being equal to the config-timestamp returned in
182017ca54c3Smrg	the last call to RRGetScreenInfo), the client MUST call
182117ca54c3Smrg	RRGetScreenInfo to update its view of possible screen
182217ca54c3Smrg	configurations to have a correct view of possible screen
182317ca54c3Smrg	organizations.
182417ca54c3Smrg
182517ca54c3Smrg	Clients which select screen change notification events may be
182617ca54c3Smrg	sent an event immediately if the screen configuration was
182717ca54c3Smrg	changed between when they connected to the X server and
182817ca54c3Smrg	selected for notification. This is to prevent a common race
182917ca54c3Smrg	that might occur on log-in, where many applications start up
183017ca54c3Smrg	just at the time when a display manager or log in script might
183117ca54c3Smrg	be changing the screen size or configuration.
183217ca54c3Smrg
183317ca54c3Smrg	Note that the sizes in this event reflect the new SCREENSIZE and
183417ca54c3Smrg	thus will appear rotated by the 'rotation' parameter from the sizes
183517ca54c3Smrg	of the screen itself. In other words, when rotation is 90 or 270,
183617ca54c3Smrg	widthInPixels in this event will be the same as the height value
183717ca54c3Smrg	from a ConfigureNotify that reflects the same size change. This
183817ca54c3Smrg	will probably confuse developers.
183917ca54c3Smrg
184017ca54c3Smrg8.1 Events added in version 1.2 of the RandR extension
184117ca54c3Smrg
184217ca54c3Smrg┌───
184317ca54c3Smrg    RROutputChangeNotify:
184417ca54c3Smrg	timestamp: TIMESTAMP		time screen was reconfigured
184517ca54c3Smrg	config-timestamp: TIMESTAMP	time available config data was changed
184617ca54c3Smrg	window: WINDOW			window requesting notification
184717ca54c3Smrg	output: OUTPUT			output affected by change
184817ca54c3Smrg	crtc: CRTC			connected CRTC or None
184917ca54c3Smrg	mode: MODE			mode in use on CRTC or None
185017ca54c3Smrg	connection: CONNECTION		connection status
185117ca54c3Smrg└───
185217ca54c3Smrg
185317ca54c3Smrg	This event is generated whenever the available output configurations
185417ca54c3Smrg	have changed and is sent to requesting clients. 'timestamp'
185517ca54c3Smrg	indicates when the crtc configuration was changed by a client.
185617ca54c3Smrg	'config-timestamp' says when the last time the available
185717ca54c3Smrg	configurations changed. 'root' is the root of the screen the change
185817ca54c3Smrg	occurred on, 'window' is window selecting for this event. The
185917ca54c3Smrg	precise change can be detected by examining the new state of the
186017ca54c3Smrg	system.
186117ca54c3Smrg
186217ca54c3Smrg	Changes in version 1.6 of the protocol:
186317ca54c3Smrg
186417ca54c3Smrg	When a “non-desktop” device is connected, this event will be
186517ca54c3Smrg	delivered when the connection status of the output changes,
186617ca54c3Smrg	however the 'connection' value will be set to 'Disconnected'.
186717ca54c3Smrg
186817ca54c3Smrg┌───
186917ca54c3Smrg    RROutputPropertyNotify:
187017ca54c3Smrg	window: WINDOW			window requesting notification
187117ca54c3Smrg	output: OUTPUT			output affected by change
187217ca54c3Smrg	atom: ATOM			affected property
187317ca54c3Smrg	time: TIMESTAMP			time property was changed
187417ca54c3Smrg	subpixel-order: SUBPIXELORDER	order of subpixels
187517ca54c3Smrg	state: { NewValue, Deleted }	new property state
187617ca54c3Smrg└───
187717ca54c3Smrg
187817ca54c3Smrg	This event is reported to clients selecting RROutputPropertyChange
187917ca54c3Smrg	on the window and is generated with state NewValue when a property
188017ca54c3Smrg	of the window is changed using RRChangeOutputProperty even when
188117ca54c3Smrg	adding zero-length data and when replacing all or part of a property
188217ca54c3Smrg	with identical data.  It is generated with state Deleted when a
188317ca54c3Smrg	property of the window is deleted using either
188417ca54c3Smrg	RRDeleteOutputProperty or RRGetOutputProperty.  The timestamp
188517ca54c3Smrg	indicates the server time when the property was changed.
188617ca54c3Smrg
188717ca54c3Smrg┌───
188817ca54c3Smrg    RRCrtcChangeNotify
188917ca54c3Smrg	timestamp: TIMESTAMP		time monitor was changed
189017ca54c3Smrg	window: WINDOW			window requesting notification
189117ca54c3Smrg	crtc: CRTC			CRTC which changed
189217ca54c3Smrg	mode: MODE			new mode
189317ca54c3Smrg	rotation: ROTATION;		new rotation
189417ca54c3Smrg	x: INT16			x position of CRTC within screen
189517ca54c3Smrg	y: INT16			y position of CRTC within screen
189617ca54c3Smrg	width: CARD16			width of new configuration
189717ca54c3Smrg	height: CARD16			height of new configuration
189817ca54c3Smrg└───
189917ca54c3Smrg	This event is generated whenever the CRTC configuration is changed
190017ca54c3Smrg	and sent to requesting clients. 'timestamp' indicates when the
190117ca54c3Smrg	CRTC configuration was changed. 'window' is window selecting for this
190217ca54c3Smrg	event. 'mode' is the new mode, or None if the crtc is disabled.
190317ca54c3Smrg	'x' and 'y' mark the location in the screen where this CRTC
190417ca54c3Smrg	is reading data. 'width' and 'height' indicate the size of the
190517ca54c3Smrg	CRTC viewport, which is the mode size adjusted by the optional
190617ca54c3Smrg	Border output property described below. 'x', 'y, 'width' and
190717ca54c3Smrg	'height' are all zero when 'mode' is None.
190817ca54c3Smrg
190917ca54c3Smrg	This event is sent whenever the monitor's configuration changes
191017ca54c3Smrg	or if a new monitor configuration becomes available that was
191117ca54c3Smrg	not available in the past. In this case, the client MUST call
191217ca54c3Smrg	RRGetCrtcInfo to update its view of possible monitor
191317ca54c3Smrg	configurations to have a correct view of possible monitor
191417ca54c3Smrg	organizations.
191517ca54c3Smrg
191617ca54c3Smrg	Clients which select monitor change notification events may be
191717ca54c3Smrg	sent an event immediately if the monitor configuration was
191817ca54c3Smrg	changed between when they connected to the X server and
191917ca54c3Smrg	selected for notification. This is to prevent a common race
192017ca54c3Smrg	that might occur on log-in, where many applications start up
192117ca54c3Smrg	just at the time when a display manager or log in script might
192217ca54c3Smrg	be changing the monitor size or configuration.
192317ca54c3Smrg
192417ca54c3Smrg8.2 Events added in version 1.4 of the RandR extension
192517ca54c3Smrg
192617ca54c3Smrg┌───
192717ca54c3Smrg    RRProviderChangeNotify:
192817ca54c3Smrg	timestamp: TIMESTAMP		time screen was reconfigured
192917ca54c3Smrg	window: WINDOW			window requesting notification
193017ca54c3Smrg	provider: PROVIDER		provider affected by change
193117ca54c3Smrg└───
193217ca54c3Smrg
193317ca54c3Smrg	This event is generated whenever the role for a provider has changed
193417ca54c3Smrg	and is sent to requesting clients. 'timestamp' indicates when the
193517ca54c3Smrg	provider configuration was changed by a client.  'window' is the
193617ca54c3Smrg	window selecting for this event.  The precise change can be detected
193717ca54c3Smrg	by examining the new state of the system.
193817ca54c3Smrg
193917ca54c3Smrg┌───
194017ca54c3Smrg    RRProviderPropertyNotify:
194117ca54c3Smrg	window: WINDOW			window requesting notification
194217ca54c3Smrg	provider: PROVIDER		provider affected by change
194317ca54c3Smrg	atom: ATOM			affected property
194417ca54c3Smrg	time: TIMESTAMP			time property was changed
194517ca54c3Smrg	state: { NewValue, Deleted }	new property state
194617ca54c3Smrg└───
194717ca54c3Smrg
194817ca54c3Smrg	This event is reported to clients selecting RRProviderPropertyChange
194917ca54c3Smrg	on the window and is generated with state NewValue when a property
195017ca54c3Smrg	of the window is changed using RRChangeProviderProperty even when
195117ca54c3Smrg	adding zero-length data and when replacing all or part of a property
195217ca54c3Smrg	with identical data.  It is generated with state Deleted when a
195317ca54c3Smrg	property of the window is deleted using either
195417ca54c3Smrg	RRDeleteProviderProperty or RRGetProviderProperty.  The timestamp
195517ca54c3Smrg	indicates the server time when the property was changed.
195617ca54c3Smrg
195717ca54c3Smrg┌───
195817ca54c3Smrg    RRResourceChangeNotify:
195917ca54c3Smrg	window: WINDOW			window requesting notification
196017ca54c3Smrg	time: TIMESTAMP			time property was changed
196117ca54c3Smrg└───
196217ca54c3Smrg
196317ca54c3Smrg	This event is reported to clients selecting RRResourceChange
196417ca54c3Smrg	on the window and is generated whenever the set of available
196517ca54c3Smrg	RandR resources associated with the screen has changed, either
196617ca54c3Smrg	created or destroyed. Querying the list of available resources
196717ca54c3Smrg	with RRGetScreenResources and RRGetProviders will return the new set.
196817ca54c3Smrg
196917ca54c3Smrg8.3 Events added in version 1.6 of the RandR extension
197017ca54c3Smrg
197117ca54c3Smrg┌───
197217ca54c3Smrg    RRLeaseNotify:
197317ca54c3Smrg	timestamp : TIMESTAMP		time screen was reconfigured
197417ca54c3Smrg	window : WINDOW			window requesting notification
197517ca54c3Smrg	lease : LEASE			lease
197617ca54c3Smrg	created : BOOL			created/destroyed indicator
197717ca54c3Smrg└───
197817ca54c3Smrg
197917ca54c3Smrg	This event is generated whenever a lease has been created or
198017ca54c3Smrg	destroyed and is sent to requesting clients. 'timestamp'
1981d63b911fSmrg	indicates when the change happened.  'window' is the window
198217ca54c3Smrg	selecting for this event.
198317ca54c3Smrg
198417ca54c3Smrg			      ❧❧❧❧❧❧❧❧❧❧❧
198517ca54c3Smrg
198617ca54c3Smrg9. Properties
198717ca54c3Smrg
198817ca54c3SmrgProperties are used for output specific parameters, and for announcing
198917ca54c3Smrgstatic or rarely changing data.  Announced data is typically
199017ca54c3Smrgimmutable.  Properties are also used for evaluating new parameters
199117ca54c3Smrgbefore adding them to the RandR protocol.
199217ca54c3Smrg
199317ca54c3SmrgThe following properties are hereby declared official, and drivers SHOULD
199417ca54c3Smrgprefix driver specific properties with '_', unless they are planned to be
199517ca54c3Smrgadded to this specification.  List values, that are not declared by the table
199617ca54c3Smrgbelow, and will remain driver specific or are not planned to be added to this
199717ca54c3Smrgspecification, SHOULD be prefixed with "_" as well in order to avoid name
199817ca54c3Smrgspace or semantics clashes with future extensions of these values.
199917ca54c3Smrg
200017ca54c3SmrgBeginning with version 1.3 of the RandR extension, certain properties
200117ca54c3Smrgare mandatory and MUST be provided by implementations.  Earlier
200217ca54c3Smrgversions of the RandR extension MAY provide these properties as well,
200317ca54c3Smrgas long as the semantics are not altered.  Clients SHOULD fall back
200417ca54c3Smrggracefully to lower version functionality, though, if the driver
200517ca54c3Smrgdoesn't handle a mandatory property correctly.
200617ca54c3Smrg
200717ca54c3SmrgChanges in version 1.6 of the protocol:
200817ca54c3Smrg
200917ca54c3SmrgWhen a “non-desktop” device is connected, the property information
201017ca54c3Smrgwill be correct for the device, even though RRGetOutputInfo
201117ca54c3Smrgreports the device as disconnected. The “non-desktop” property will be
201217ca54c3Smrgset to 1 for such devices and not present on other devices.
201317ca54c3Smrg
201417ca54c3Smrg9.1 Known properties
201517ca54c3Smrg
201617ca54c3Smrg    "Backlight"			aka RR_PROPERTY_BACKLIGHT
201717ca54c3Smrg	Type:			INTEGER
201817ca54c3Smrg	Format:			32
201917ca54c3Smrg	Num. items:		1
202017ca54c3Smrg	Flags:			-
202117ca54c3Smrg	Range/List:		0-x (driver specific)
202217ca54c3Smrg
202317ca54c3Smrg	This property controls the brightness on laptop panels and equivalent
202417ca54c3Smrg	displays with a backlight controller. The driver specific maximum
202517ca54c3Smrg	value MUST turn the backlight to full brightness, 1 SHOULD turn the
202617ca54c3Smrg	backlight to minimum brightness, 0 SHOULD turn the backlight off.
202717ca54c3Smrg
202817ca54c3Smrg    "CloneList"			aka RR_PROPERTY_CLONE_LIST
202917ca54c3Smrg	Type:			ATOM
203017ca54c3Smrg	Format:			32
203117ca54c3Smrg	Num. items:		2*n
203217ca54c3Smrg	Flags:			Immutable
203317ca54c3Smrg	Range/List:		0-
203417ca54c3Smrg
203517ca54c3Smrg	Some combinations of outputs on some cards cannot be served
203617ca54c3Smrg	independently from each other, because they are wired up to the same
203717ca54c3Smrg	encoder outputs.
203817ca54c3Smrg	This property lists all output + signal format pairs that are
203917ca54c3Smrg	driven together with this output, and thus can only be programmed in
204017ca54c3Smrg	clone mode with the same CRTC.
204117ca54c3Smrg	This property MUST be symmetric, but may change with changing signal
204217ca54c3Smrg	format. I.e. if the property for DVI-1/VGA specifies VGA-1/VGA to be
204317ca54c3Smrg	cloned, VGA-1/VGA has to list DVI-1/VGA as well.
204417ca54c3Smrg	Outputs / format pairs listed in this property MUST be included in the
204517ca54c3Smrg	CompatibilityList.
204617ca54c3Smrg
204717ca54c3Smrg    "CompatibilityList"		aka RR_PROPERTY_COMPATIBILITY_LIST
204817ca54c3Smrg	Type:			ATOM
204917ca54c3Smrg	Format:			32
205017ca54c3Smrg	Num items:		2*n
205117ca54c3Smrg	Flags:			Immutable
205217ca54c3Smrg	Range/List:		0-
205317ca54c3Smrg
205417ca54c3Smrg	Some combinations of outputs on some cards cannot be served at all,
205517ca54c3Smrg	because the according encoder is only capable of driving one output at
205617ca54c3Smrg	a time.
205717ca54c3Smrg	This property lists all output + signal format pairs that can be
205817ca54c3Smrg	driven together with this output. NULL atoms specify any output / any
205917ca54c3Smrg	signal format, respectively.
206017ca54c3Smrg	This property MUST be symmetric, but may change with changing signal
206117ca54c3Smrg	format. I.e. if the property for DVI-1/TMDS specifies VGA-1/VGA to be
206217ca54c3Smrg	available, VGA-1/VGA has to list DVI-1/TMDS as well.
206317ca54c3Smrg
206417ca54c3Smrg    "ConnectorNumber"		aka RR_PROPERTY_CONNECTOR_NUMBER
206517ca54c3Smrg	Type:			INTEGER
206617ca54c3Smrg	Format:			32
206717ca54c3Smrg	Num items:		1
206817ca54c3Smrg	Flags:			Immutable, Static
206917ca54c3Smrg	Range/List:		0-
207017ca54c3Smrg
207117ca54c3Smrg	Outputs that route their signal to the same connector MUST
207217ca54c3Smrg	have the same connector number. Outputs with the same
207317ca54c3Smrg	connector number MUST route their signal to the same
207417ca54c3Smrg	connector, except if it is 0, which indicates unknown
207517ca54c3Smrg	connectivity. 1 is called the primary connector, 2 the
207617ca54c3Smrg	secondary. 3 is typically a TV connector, but that is completely
207717ca54c3Smrg	driver / hardware dependent.
207817ca54c3Smrg	Outputs with the same connector number SHOULD have the same
207917ca54c3Smrg	connector type. Meaning and client behavior for mismatching
208017ca54c3Smrg	connector types is undefined at the moment.
208117ca54c3Smrg
208217ca54c3Smrg    "ConnectorType"		aka RR_PROPERTY_CONNECTOR_TYPE
208317ca54c3Smrg	Type:			ATOM
208417ca54c3Smrg	Format:			32
208517ca54c3Smrg	Num items:		1
208617ca54c3Smrg	Flags:			Immutable, Static
208717ca54c3Smrg	Range/List:		unknown VGA DVI DVI‐I DVI‐A DVI‐D HDMI Panel
208817ca54c3Smrg				TV TV-Composite TV-SVideo TV-Component
208917ca54c3Smrg				TV-SCART TV-C4 DisplayPort
209017ca54c3Smrg
209117ca54c3Smrg	Connector type, as far as known to the driver.
209217ca54c3Smrg	Values with dashes (TV‐Composite) describe more specific versions of
209317ca54c3Smrg	the base values (TV). The former SHOULD be used if the connector is
209417ca54c3Smrg	not capable of producing other signal formats. The later SHOULD be
209517ca54c3Smrg	used if the exact connector is unknown, or the connector is a
209617ca54c3Smrg	multi‐format connector that is not described otherwise. DVI, for
209717ca54c3Smrg	instance, SHOULD be handled like a DVI‐I connector, unless additional
209817ca54c3Smrg	information is available to the user agent. PANEL describes
209917ca54c3Smrg	laptop‐internal (normally LVDS) displays. TV, TV‐SCART, TV‐Component,
210017ca54c3Smrg	and TV‐C4 with signal format VGA are valid combinations and describe
210117ca54c3Smrg	RGB TV signals.
210217ca54c3Smrg
210317ca54c3Smrg    "EDID"			aka RR_PROPERTY_RANDR_EDID
210417ca54c3Smrg	Type:			INTEGER
210517ca54c3Smrg	Format:			8
210617ca54c3Smrg	Num items:		n
210717ca54c3Smrg	Flags:			Immutable
210817ca54c3Smrg	Range/List:		-
210917ca54c3Smrg
211017ca54c3Smrg	Raw EDID data from the device attached to the according
211117ca54c3Smrg	output. Should include main EDID data and all extension
211217ca54c3Smrg	blocks. Previously known as EdidData.
211317ca54c3Smrg
211417ca54c3Smrg    “non-desktop”	aka RR_PROPERTY_NON_DESKTOP
211517ca54c3Smrg	Type:			INTEGER
211617ca54c3Smrg	Format:			32
211717ca54c3Smrg	Num items:		1
211817ca54c3Smrg	Flags			Immutable
211917ca54c3Smrg	Range/List:		0-1
212017ca54c3Smrg
212117ca54c3Smrg	Indicates whether the device attached to this output should not
212217ca54c3Smrg	be considered part of the normal desktop. When set to 0 or not
212317ca54c3Smrg	present, the output should be presented as part of the
212417ca54c3Smrg	desktop.
212517ca54c3Smrg
212617ca54c3Smrg	When set to 1, the output should not be presented as part of
212717ca54c3Smrg	the desktop. To not present an output as part of the desktop,
212817ca54c3Smrg	the normal desktop environment should not be shown on this
212917ca54c3Smrg	output, nor should desktop applications be positioned on it.
213017ca54c3Smrg
213117ca54c3Smrg	When set to 1, RRGetOutputInfo will always report connection status
213217ca54c3Smrg	Disconnected, but RROutputChangeNotify events will still be
213317ca54c3Smrg	delivered when the connection status changes and all other
213417ca54c3Smrg	information about the output and connected device will be
213517ca54c3Smrg	reported correctly.
213617ca54c3Smrg
213717ca54c3Smrg    "SignalFormat"		aka RR_PROPERTY_SIGNAL_FORMAT
213817ca54c3Smrg	Type:			ATOM
213917ca54c3Smrg	Format:			32
214017ca54c3Smrg	Num items:		1
214117ca54c3Smrg	Flags:			-
214217ca54c3Smrg	Range/List:		unknown VGA TMDS LVDS Composite Composite-PAL
214317ca54c3Smrg				Composite-NTSC Composite-SECAM SVideo
214417ca54c3Smrg				Component DisplayPort
214517ca54c3Smrg
214617ca54c3Smrg	Signal format / physical protocol format that is used for the
214717ca54c3Smrg	specified output. valid-values lists all possible formats on this
214817ca54c3Smrg	output, which SHOULD be a subset of the list above and MUST be static.
214917ca54c3Smrg	Values with dashes (Composite-PAL) describe more specific versions of
215017ca54c3Smrg	the base values (Composite) and SHOULD be used if known to the driver.
215117ca54c3Smrg	A driver MAY change this property of an output if the underlying
215217ca54c3Smrg	hardware indicates a protocol change (e.g. TV formats).  Clients are
215317ca54c3Smrg	allowed to change the signal format in order to select a different
215417ca54c3Smrg	signal format (e.g. Composite etc.) or physical protocol (e.g. VGA or
215517ca54c3Smrg	TMDS on DVI-I).
215617ca54c3Smrg	Laptop panels SHOULD not be detected with this property, but rather by
215717ca54c3Smrg	ConnectorType.
215817ca54c3Smrg
215917ca54c3Smrg    "SignalProperties"		aka RR_PROPERTY_SIGNAL_FORMAT
216017ca54c3Smrg	Type:			ATOM
216117ca54c3Smrg	Format:			32
216217ca54c3Smrg	Num items:		n
216317ca54c3Smrg	Flags:			-
216417ca54c3Smrg	Range/List:		For Composite signals:
216517ca54c3Smrg				  NTSC NTSC-M NTSC-J NTSC-N NTSC-4.43 NTSC-film
216617ca54c3Smrg				  PAL PAL-B PAL-G PAL-H PAL-H PAL-I PAL-M PAL-D
216717ca54c3Smrg				  PAL-N PAL-Nc PAL-L PAL-60
216817ca54c3Smrg				  SECAM SECAM-L SECAM-B SECAM-G SECAM-D SECAM-K
216917ca54c3Smrg				  SECAM-H SECAM-K
217017ca54c3Smrg				For TMDS signals:
217117ca54c3Smrg				  SingleLink DualLink
217217ca54c3Smrg				For DisplayPort signals:
217317ca54c3Smrg				  Lane1 Lane2 Lane4 LowSpeed HiSpeed
217417ca54c3Smrg
217517ca54c3Smrg	Properties of the signal format that is currently used for the
217617ca54c3Smrg	specified output. valid-values lists all possible properties on this
217717ca54c3Smrg	output, which SHOULD be a subset of the list above. It will change if
217817ca54c3Smrg	SignalFormat changes.  Multiple properties are allowed.
217917ca54c3Smrg	Values with dashes (PAL-B) describe more specific versions of the base
218017ca54c3Smrg	values (PAL) and SHOULD be used if known to the driver.  A driver MAY
218117ca54c3Smrg	change this property of an output if the underlying hardware indicates
218217ca54c3Smrg	a signal change (e.g. TV formats).  Clients are allowed to change the
218317ca54c3Smrg	properties in order to select a different signal subformat.
218417ca54c3Smrg
218517ca54c3Smrg    "Border"			aka RR_PROPERTY_BORDER
218617ca54c3Smrg	Type:			CARDINAL
218717ca54c3Smrg	Format:			16
218817ca54c3Smrg	Num items:		0, 1, 2, or 4
218917ca54c3Smrg	Flags:			Immutable
219017ca54c3Smrg	Range/List:		0-
219117ca54c3Smrg
219217ca54c3Smrg	This property is a list of integers specifying adjustments for the edges
219317ca54c3Smrg	of the displayed image. How this property is applied depends on the
219417ca54c3Smrg	number of elements in the list:
219517ca54c3Smrg
219617ca54c3Smrg	  0 = No border is applied
219717ca54c3Smrg	  1 = A border of Border[0] is applied to all four sides of the image.
219817ca54c3Smrg	  2 = A border of Border[0] is applied to the left and right sides of
219917ca54c3Smrg	      the image, and a border of Border[1] is applied to the top and
220017ca54c3Smrg	      bottom.
220117ca54c3Smrg	  4 = The border dimensions are as follows:
220217ca54c3Smrg		Border[0]: left
220317ca54c3Smrg		Border[1]: top
220417ca54c3Smrg		Border[2]: right
220517ca54c3Smrg		Border[3]: bottom
220617ca54c3Smrg
220717ca54c3Smrg	Note that how many configuration dimensions are actually supported is
220817ca54c3Smrg	specified by the BorderDimensions property described below. If more than
220917ca54c3Smrg	BorderDimensions values are specified, the extra values are ignored.
221017ca54c3Smrg
221117ca54c3Smrg	These border dimensions shrink the region of pixels displayed by the
221217ca54c3Smrg	CRTC by the corresponding number of rows or columns, and is applied
221317ca54c3Smrg	after the CRTC transform. For example, a mode with a 1920x1080 active
221417ca54c3Smrg	region, border dimensions of [ 10, 20, 30, 40 ], and a ½x scaling
221517ca54c3Smrg	transform would display a rectangle of 940x510 pixels from the scanout
221617ca54c3Smrg	pixmap scaled to 1880x1020 raster pixels positioned at (10, 20) in
221717ca54c3Smrg	display raster space.
221817ca54c3Smrg
221917ca54c3Smrg	Raster pixels in the border are black.
222017ca54c3Smrg
222117ca54c3Smrg	This property is created with pending == TRUE, so changes are not
222217ca54c3Smrg	applied immediately and instead take effect at the next RRSetCrtcConfig.
222317ca54c3Smrg
222417ca54c3Smrg	If multiple outputs with different border settings are bound to the same
222517ca54c3Smrg	CRTC when the configuration is changed, the behavior is undefined.
222617ca54c3Smrg
222717ca54c3Smrg	If the length of the property is less than four when the CRTC is
222817ca54c3Smrg	configured, the missing values are assumed to be zero.  If the length is
222917ca54c3Smrg	greater than four, the extra values are ignored.
223017ca54c3Smrg
223117ca54c3Smrg	If the width of the mode is less than or equal to the sum of the left
223217ca54c3Smrg	and right borders, then the left and right border settings are ignored.
223317ca54c3Smrg	Likewise, if the height of the mode is less than or equal to the sum of
223417ca54c3Smrg	the top and bottom borders, the top and bottom borders are ignored.
223517ca54c3Smrg
223617ca54c3Smrg    "BorderDimensions"		aka RR_PROPERTY_BORDER_DIMENSIONS
223717ca54c3Smrg	Type:			CARDINAL
223817ca54c3Smrg	Format:			8
223917ca54c3Smrg	Num items:		1
224017ca54c3Smrg	Flags:			Immutable, Static
224117ca54c3Smrg	Range/List:		0, 1, 2, or 4
224217ca54c3Smrg
224317ca54c3Smrg	This property lists how many border adjustment parameters can actually
224417ca54c3Smrg	be used:
224517ca54c3Smrg
224617ca54c3Smrg	  0 = no borders are supported
224717ca54c3Smrg	  1 = a single border value is applied to all four sides of the image
224817ca54c3Smrg	  2 = left/right and top/bottom borders can be specified independently
224917ca54c3Smrg	  4 = all four borders can be specified independently
225017ca54c3Smrg
225117ca54c3Smrg    "GUID"			aka RR_PROPERTY_GUID
225217ca54c3Smrg	Type:			INTEGER
225317ca54c3Smrg	Format:			8
225417ca54c3Smrg	Num items:		16
225517ca54c3Smrg	Flags:			Immutable
225617ca54c3Smrg	Range/List:		-
225717ca54c3Smrg
225817ca54c3Smrg	Some display devices, such as DisplayPort 1.2 devices, have globally
225917ca54c3Smrg	unique identifiers.  When such an identifier is available, this property
226017ca54c3Smrg	contains its raw bytes.
226117ca54c3Smrg
226217ca54c3Smrg    "TILE"			aka RR_PROPERTY_RANDR_TILE
226317ca54c3Smrg	Type:			INTEGER
226417ca54c3Smrg	Format:			32
226517ca54c3Smrg	Num items:		8
226617ca54c3Smrg	Flags:			Immutable
226717ca54c3Smrg	Range/List:		-
226817ca54c3Smrg
226917ca54c3Smrg        Tile monitors have an array of values describing the tiling,
227017ca54c3Smrg        based on DisplayID v1.3
227117ca54c3Smrg
227217ca54c3Smrg	The 8 elements are:
227317ca54c3Smrg        0: group id - The tile group identifier
227417ca54c3Smrg        1: flags - flags for tile group
227517ca54c3Smrg		0x1 = single monitor enclosure
227617ca54c3Smrg        2: number of horizontal tiles in tile group
227717ca54c3Smrg        3: number of vertical tiles in tile group
227817ca54c3Smrg        4: horizontal tile location for this tile
227917ca54c3Smrg        5: vertical tile location for this tile
228017ca54c3Smrg        6: horizontal tile size for this tile
228117ca54c3Smrg        7: vertical tile size for this tile
228217ca54c3Smrg
228317ca54c3Smrg9.2 Properties introduced with version 1.2 of the RandR extension
228417ca54c3Smrg
228517ca54c3SmrgProperty			Immutable	Mandatory since
228617ca54c3Smrg────────			─────────	───────────────
228717ca54c3SmrgEDID				yes		n/a
228817ca54c3Smrg
228917ca54c3SmrgEDID is provided by the RandR frontend, thus not driver specific.
229017ca54c3Smrg
229117ca54c3Smrg
229217ca54c3Smrg9.3 Properties introduced with version 1.3 of the RandR extension
229317ca54c3Smrg
229417ca54c3SmrgProperty			Immutable	Mandatory since
229517ca54c3Smrg────────			─────────	───────────────
229617ca54c3SmrgCloneList			yes		not mandatory
229717ca54c3SmrgCompatibilityList		yes		not mandatory
229817ca54c3SmrgConnectorNumber			yes: static	not mandatory
229917ca54c3SmrgConnectorType			yes: static	RandR 1.3
230017ca54c3SmrgSignalFormat			no		RandR 1.3
230117ca54c3SmrgSignalProperties		no		not mandatory
230217ca54c3Smrg
230317ca54c3Smrg9.4 Properties introduced with version 1.3.1 of the RandR extension
230417ca54c3Smrg
230517ca54c3SmrgProperty			Immutable	Mandatory since
230617ca54c3Smrg────────			─────────	───────────────
230717ca54c3SmrgBacklight			no		not mandatory
230817ca54c3Smrg
230917ca54c3Smrg9.5 Properties introduced with version 1.4.0 of the RandR extension
231017ca54c3Smrg
231117ca54c3SmrgProperty			Immutable	Mandatory since
231217ca54c3Smrg────────			─────────	───────────────
231317ca54c3SmrgBorder				yes		not mandatory
231417ca54c3SmrgBorderDimensions		yes: static	not mandatory
231517ca54c3Smrg
231617ca54c3Smrg9.6 Properties introduced with version 1.4.1 of the RandR extension
231717ca54c3Smrg
231817ca54c3SmrgProperty			Immutable	Mandatory since
231917ca54c3Smrg────────			─────────	───────────────
232017ca54c3SmrgGUID				yes		not mandatory
232117ca54c3Smrg
232217ca54c3Smrg9.7 Properties introduced with version 1.5 of the RandR extension
232317ca54c3Smrg
232417ca54c3SmrgProperty			Immutable	Mandatory since
232517ca54c3Smrg────────			─────────	───────────────
232617ca54c3SmrgTILE				yes		not mandatory
232717ca54c3Smrg
232817ca54c3Smrg9.8 Properties introduced with version 1.6 of the RandR extension
232917ca54c3Smrg
233017ca54c3SmrgProperty			Immutable	Mandatory since
233117ca54c3Smrg────────			─────────	───────────────
233217ca54c3Smrgnon-desktop			yes		not mandatory
233317ca54c3Smrg
233417ca54c3Smrg			      ❧❧❧❧❧❧❧❧❧❧❧
233517ca54c3Smrg
233617ca54c3Smrg10. Extension Versioning
233717ca54c3Smrg
233817ca54c3SmrgThe RandR extension was developed in parallel with the implementation
233917ca54c3Smrgto ensure the feasibility of various portions of the design. As
234017ca54c3Smrgportions of the extension are implemented, the version number of the
234117ca54c3Smrgextension has changed to reflect the portions of the standard provided.
234217ca54c3SmrgThis document describes the version 1.4 of the specification, the
234317ca54c3Smrgpartial implementations have version numbers less than that. Here's a
234417ca54c3Smrglist of what each version provided:
234517ca54c3Smrg
234617ca54c3Smrg	0.0: This prototype implemented resize and rotation in the
234717ca54c3Smrg	     TinyX server Used approximately the protocol described in
234817ca54c3Smrg	     the Usenix paper. Appeared in the TinyX server in
234917ca54c3Smrg	     XFree86 4.2, but not in the XFree86 main server.
235017ca54c3Smrg
235117ca54c3Smrg	0.1: Added subpixel order, added an event for subpixel order.
235217ca54c3Smrg	     This version was never checked in to XFree86 CVS.
235317ca54c3Smrg
235417ca54c3Smrg	1.0: Implements resize, rotation, and reflection. Implemented
235517ca54c3Smrg	     both in the XFree86 main server (size change only at this
235617ca54c3Smrg	     date), and fully (size change, rotation, and reflection)
235717ca54c3Smrg	     in XFree86's TinyX server.
235817ca54c3Smrg
235917ca54c3Smrg	1.1: Added refresh rates
236017ca54c3Smrg
236117ca54c3Smrg	1.2: Separate screens from CRTCs and outputs, switch to full VESA
236217ca54c3Smrg	     modes
236317ca54c3Smrg
236417ca54c3Smrg	1.3: Added cheap version of RRGetScreenResources.  Added CRTC
236517ca54c3Smrg	     transformations.  Added panning.  Added primary outputs.
236617ca54c3Smrg	     Added standard properties.
236717ca54c3Smrg
236817ca54c3Smrg        1.4: Added provider objects for handling multi-GPU systems.
236917ca54c3Smrg
237017ca54c3Smrg	1.5: Added Monitors
237117ca54c3Smrg
237217ca54c3Smrg	1.6: Added Leases and non-desktop output information.
237317ca54c3Smrg
237417ca54c3SmrgCompatibility between 0.0 and 1.0 was *NOT* preserved, and 0.0 clients
237517ca54c3Smrgwill fail against 1.0 servers. The wire encoding op-codes were
237617ca54c3Smrgchanged for GetScreenInfo to ensure this failure in a relatively
237717ca54c3Smrggraceful way. Version 1.1 servers and clients are cross compatible with
237817ca54c3Smrg1.0. Version 1.1 is considered to be stable and we intend upward
237917ca54c3Smrgcompatibility from this point. Version 1.2 offers an extended model of the
238017ca54c3Smrgsystem with multiple output support. Version 1.3 adds a cheap version of
238117ca54c3SmrgGetScreenResources to avoid expensive DDC operations, CRTC transformations,
238217ca54c3Smrgpanning, and the primary output concept. Versions 1.2 through 1.6 are
238317ca54c3Smrgbackward-compatible with 1.1.
238417ca54c3Smrg
238517ca54c3Smrg			      ❧❧❧❧❧❧❧❧❧❧❧
238617ca54c3Smrg
238717ca54c3Smrg11. Relationship with other extensions
238817ca54c3Smrg
238917ca54c3SmrgTwo other extensions have a direct relationship with this extension. This
239017ca54c3Smrgsection attempts to explain how these three are supposed to work together.
239117ca54c3Smrg
239217ca54c3Smrg11.1 XFree86-VidModeExtension
239317ca54c3Smrg
239417ca54c3SmrgXFree86-VidModeExtension changes the configuration of a single monitor
239517ca54c3Smrgattached to the screen without changing the configuration of the screen
239617ca54c3Smrgitself. It provides the ability to specify new mode lines for the server to
239717ca54c3Smrguse along with selecting among existing mode lines. As it uses screen
239817ca54c3Smrgnumbers instead of window identifiers, it can be used to affect multiple
239917ca54c3Smrgmonitors in a single-screen Xinerama configuration. However, the association
240017ca54c3Smrgbetween screen numbers and root windows in a multi-Screen environment is not
240117ca54c3Smrgdefined by the extension. Version 2.0 of this extension added the ability to
240217ca54c3Smrgadjust the DAC values in a TrueColor server to modify the brightness curves
240317ca54c3Smrgof the display.
240417ca54c3Smrg
240517ca54c3SmrgAll of the utility of this extension is subsumed by RandR version 1.2, RandR
240617ca54c3Smrgshould be used in preference to XFree86-VidModeExtension where both are
240717ca54c3Smrgpresent.
240817ca54c3Smrg
240917ca54c3Smrg11.2 Xinerama
241017ca54c3Smrg
241117ca54c3SmrgXinerama provides a mechanism for describing the relationship between the
241217ca54c3Smrgoverall screen display and monitors placed within that area. As such, it
241317ca54c3Smrgprovides the query functionality of RandR 1.2 without any of the
241417ca54c3Smrgconfiguration functionality. Applications using Xinerama to discover
241517ca54c3Smrgmonitor geometry can continue to do so, with the caveat that they will not be
241617ca54c3Smrginformed of changes when they occur. However, Xinerama configuration data
241717ca54c3Smrgwill be updated, so applications selecting for RandR notification and
241817ca54c3Smrgre-querying the configuration with the Xinerama extension will get updated
241917ca54c3Smrginformation. It is probably better to view RandR as a superset of Xinerama
242017ca54c3Smrgat this point and use it in preference to Xinerama where both are present.
242117ca54c3Smrg
242217ca54c3Smrg			      ❧❧❧❧❧❧❧❧❧❧❧
242317ca54c3Smrg
242417ca54c3SmrgAppendix A. Protocol Encoding
242517ca54c3Smrg
242617ca54c3SmrgSyntactic Conventions
242717ca54c3Smrg
242817ca54c3SmrgThis document uses the same syntactic conventions as the core X
242917ca54c3Smrgprotocol encoding document.
243017ca54c3Smrg
243117ca54c3SmrgA.1 Common Types
243217ca54c3Smrg
243317ca54c3Smrg┌───
243417ca54c3Smrg    ROTATION
243517ca54c3Smrg	0x0001	Rotate_0
243617ca54c3Smrg	0x0002	Rotate_90
243717ca54c3Smrg	0x0004	Rotate_180
243817ca54c3Smrg	0x0008	Rotate_270
243917ca54c3Smrg	0x0010	Reflect_X
244017ca54c3Smrg	0x0020	Reflect_Y
244117ca54c3Smrg└───
244217ca54c3Smrg	Used to encode both sets of possible rotations and individual
244317ca54c3Smrg	selected rotations.
244417ca54c3Smrg
244517ca54c3Smrg┌───
244617ca54c3Smrg    RRSELECTMASK
244717ca54c3Smrg	0x0001	ScreenChangeNotifyMask
244817ca54c3Smrg	0x0002	CrtcChangeNotifyMask		Added in version 1.2
244917ca54c3Smrg	0x0004	OutputChangeNotifyMask		Added in version 1.2
245017ca54c3Smrg	0x0008	OutputPropertyNotifyMask	Added in version 1.2
245117ca54c3Smrg	0x0010	ProviderChangeNotifyMask 	Added in version 1.4
245217ca54c3Smrg	0x0020	ProviderPropertyNotifyMask	Added in version 1.4
245317ca54c3Smrg	0x0040	ResourceChangeNotifyMask	Added in version 1.4
245417ca54c3Smrg	0x0080  LeaseNotifyMask                 Added in version 1.6
245517ca54c3Smrg
245617ca54c3Smrg└───
245717ca54c3Smrg      Event select mask for RRSelectInput
245817ca54c3Smrg
245917ca54c3Smrg┌───
246017ca54c3Smrg    RRCONFIGSTATUS
246117ca54c3Smrg	0x0 Success
246217ca54c3Smrg	0x1 InvalidConfigTime
246317ca54c3Smrg	0x2 InvalidTime
246417ca54c3Smrg	0x3 Failed
246517ca54c3Smrg└───
246617ca54c3Smrg	Return status for requests which depend on time.
246717ca54c3Smrg
246817ca54c3Smrg┌───
246917ca54c3Smrg    MODEINFO (32)				Added in version 1.2
247017ca54c3Smrg	4	CARD32		id
247117ca54c3Smrg	2	CARD16		width in pixels
247217ca54c3Smrg	2	CARD16		height in pixels
247317ca54c3Smrg	4	CARD32		dot clock
247417ca54c3Smrg	2	CARD16		h sync start
247517ca54c3Smrg	2	CARD16		h sync end
247617ca54c3Smrg	2	CARD16		h total
247717ca54c3Smrg	2	CARD16		h skew
247817ca54c3Smrg	2	CARD16		v sync start
247917ca54c3Smrg	2	CARD16		v sync end
248017ca54c3Smrg	2	CARD16		v total
248117ca54c3Smrg	2	CARD16		name length
248217ca54c3Smrg	4	SETofMODEFLAG	mode flags
248317ca54c3Smrg└───
248417ca54c3Smrg
248517ca54c3Smrg	An output mode specifies the complete CRTC timings for
248617ca54c3Smrg	a specific mode. The vertical and horizontal synchronization rates
248717ca54c3Smrg	can be computed given the dot clock and the h total/v total
248817ca54c3Smrg	values. If the dot clock is zero, then all of the timing
248917ca54c3Smrg	parameters and flags are not used, and must be zero as this
249017ca54c3Smrg	indicates that the timings are unknown or otherwise unused.
249117ca54c3Smrg	The name itself will be encoded separately in each usage.
249217ca54c3Smrg
249317ca54c3Smrg┌───
249417ca54c3Smrg    MODEFLAG
249517ca54c3Smrg	0x00000001	HSyncPositive
249617ca54c3Smrg	0x00000002	HSyncNegative
249717ca54c3Smrg	0x00000004	VSyncPositive
249817ca54c3Smrg	0x00000008	VSyncNegative
249917ca54c3Smrg	0x00000010	Interlace
250017ca54c3Smrg	0x00000020	DoubleScan
250117ca54c3Smrg	0x00000040	CSync
250217ca54c3Smrg	0x00000080	CSyncPositive
250317ca54c3Smrg	0x00000100	CSyncNegative
250417ca54c3Smrg	0x00000200	HSkewPresent
250517ca54c3Smrg	0x00000400	BCast
250617ca54c3Smrg	0x00000800	PixelMultiplex
250717ca54c3Smrg	0x00001000	DoubleClock
250817ca54c3Smrg	0x00002000	ClockDivideBy2
250917ca54c3Smrg└───
251017ca54c3Smrg┌───
251117ca54c3Smrg    CONNECTION
251217ca54c3Smrg	0		Connected
251317ca54c3Smrg	1		Disconnected
251417ca54c3Smrg	2		UnknownConnection
251517ca54c3Smrg└───
251617ca54c3Smrg
251717ca54c3Smrg┌───
251817ca54c3Smrg    PROVIDER_CAPS				Added in version 1.4
251917ca54c3Smrg	0x00000001	SourceOutput
252017ca54c3Smrg	0x00000002	SinkOutput
252117ca54c3Smrg	0x00000004	SourceOffload
252217ca54c3Smrg	0x00000008	SinkOffload
252317ca54c3Smrg└───
252417ca54c3Smrg
252517ca54c3SmrgA.1.1 Common Types added in version 1.5 of the protocol
252617ca54c3Smrg
252717ca54c3Smrg┌───
252817ca54c3Smrg    MONITORINFO (16 + 4*n)
252917ca54c3Smrg	4	ATOM		name
253017ca54c3Smrg	1	BOOL		primary
253117ca54c3Smrg	1	BOOL		automatic
253217ca54c3Smrg	2	CARD16		noutputs
253317ca54c3Smrg	2	INT16		x
253417ca54c3Smrg	2	INT16		y
253517ca54c3Smrg	2	CARD16		width in pixels
253617ca54c3Smrg	2	CARD16		height in pixels
253717ca54c3Smrg	4	CARD32		width in millimeters
253817ca54c3Smrg	4	CARD32		height in millimeters
253917ca54c3Smrg	4*n	OUTPUT		outputs
254017ca54c3Smrg└───
254117ca54c3Smrg
254217ca54c3SmrgA.2 Protocol Requests
254317ca54c3Smrg
254417ca54c3SmrgOpcodes 1 and 3 were used in the 0.0 protocols, and will return
254517ca54c3Smrgerrors if used in version 1.0.
254617ca54c3Smrg
254717ca54c3Smrg┌───
254817ca54c3Smrg    RRQueryVersion
254917ca54c3Smrg
255017ca54c3Smrg	1	CARD8			major opcode
255117ca54c3Smrg	1	0			RandR opcode
255217ca54c3Smrg	2	3			length
255317ca54c3Smrg	4	CARD32			major version
255417ca54c3Smrg	4	CARD32			minor version
255517ca54c3Smrg255617ca54c3Smrg	1	1			Reply
255717ca54c3Smrg	1				unused
255817ca54c3Smrg	2	CARD16			sequence number
255917ca54c3Smrg	4	0			reply length
256017ca54c3Smrg	1	CARD32			major version
256117ca54c3Smrg	1	CARD32			minor version
256217ca54c3Smrg└───
256317ca54c3Smrg┌───
256417ca54c3Smrg    RRSetScreenConfig
256517ca54c3Smrg
256617ca54c3Smrg	1	CARD8			major opcode
256717ca54c3Smrg	1	2			RandR opcode
256817ca54c3Smrg	2	6			length
256917ca54c3Smrg	4	WINDOW			window on screen to be configured
257017ca54c3Smrg	4	TIMESTAMP		timestamp
257117ca54c3Smrg	4	TIMESTAMP		config timestamp
257217ca54c3Smrg	2	SIZEID			size index
257317ca54c3Smrg	2	ROTATION		rotation/reflection
257417ca54c3Smrg	2	CARD16			refresh rate (1.1 only)
257517ca54c3Smrg	2	CARD16			pad
257617ca54c3Smrg257717ca54c3Smrg	1	1			Reply
257817ca54c3Smrg	1	RRCONFIGSTATUS		status
257917ca54c3Smrg	2	CARD16			sequence number
258017ca54c3Smrg	4	0			reply length
258117ca54c3Smrg	4	TIMESTAMP		new timestamp
258217ca54c3Smrg	4	TIMESTAMP		new configuration timestamp
258317ca54c3Smrg	4	WINDOW			root
258417ca54c3Smrg	2	SUBPIXELORDER		subpixel order defined in Render
258517ca54c3Smrg	2	CARD16			pad4
258617ca54c3Smrg	4	CARD32			pad5
258717ca54c3Smrg	4	CARD32			pad6
258817ca54c3Smrg└───
258917ca54c3Smrg┌───
259017ca54c3Smrg    RRSelectInput
259117ca54c3Smrg
259217ca54c3Smrg	1	CARD8			major opcode
259317ca54c3Smrg	1	4			RandR opcode
259417ca54c3Smrg	2	3			length
259517ca54c3Smrg	4	WINDOW			window
259617ca54c3Smrg	2	SETofRRSELECTMASK	enable
259717ca54c3Smrg	2	CARD16			pad
259817ca54c3Smrg└───
259917ca54c3Smrg┌───
260017ca54c3Smrg    RRGetScreenInfo
260117ca54c3Smrg
260217ca54c3Smrg	1	CARD8			major opcode
260317ca54c3Smrg	1	5			RandR opcode
260417ca54c3Smrg	2	2			length
260517ca54c3Smrg	4	WINDOW			window
260617ca54c3Smrg260717ca54c3Smrg	1	1			Reply
260817ca54c3Smrg	1	CARD8			set of Rotations
260917ca54c3Smrg	2	CARD16			sequence number
261017ca54c3Smrg	4	0			reply length
261117ca54c3Smrg	4	WINDOW			root window
261217ca54c3Smrg	4	TIMESTAMP		timestamp
261317ca54c3Smrg	4	TIMESTAMP		config timestamp
261417ca54c3Smrg	2	CARD16			number of SCREENSIZE following
261517ca54c3Smrg	2	SIZEID			current size index
261617ca54c3Smrg	2	ROTATION		current rotation and reflection
261717ca54c3Smrg	2	CARD16			current rate (added in version 1.1)
261817ca54c3Smrg	2	CARD16			length of rate info (number of CARD16s)
261917ca54c3Smrg	2	CARD16			pad
262017ca54c3Smrg
262117ca54c3Smrg	SCREENSIZE
262217ca54c3Smrg	2	CARD16			width in pixels
262317ca54c3Smrg	2	CARD16			height in pixels
262417ca54c3Smrg	2	CARD16			width in millimeters
262517ca54c3Smrg	2	CARD16			height in millimeters
262617ca54c3Smrg
262717ca54c3Smrg	REFRESH
262817ca54c3Smrg	2	CARD16			number of rates (n)
262917ca54c3Smrg	2n	CARD16			rates
263017ca54c3Smrg└───
263117ca54c3Smrg
263217ca54c3SmrgA.2.1 Protocol Requests added with version 1.2
263317ca54c3Smrg
263417ca54c3Smrg┌───
263517ca54c3Smrg    RRGetScreenSizeRange
263617ca54c3Smrg	1	CARD8			major opcode
263717ca54c3Smrg	1	6			RandR opcode
263817ca54c3Smrg	2	2			length
263917ca54c3Smrg	4	WINDOW			window
264017ca54c3Smrg264117ca54c3Smrg	1	1			Reply
264217ca54c3Smrg	1				unused
264317ca54c3Smrg	2	CARD16			sequence number
264417ca54c3Smrg	4	0			reply length
264517ca54c3Smrg	2	CARD16			minWidth
264617ca54c3Smrg	2	CARD16			minHeight
264717ca54c3Smrg	2	CARD16			maxWidth
264817ca54c3Smrg	2	CARD16			maxHeight
264917ca54c3Smrg	16				unused
265017ca54c3Smrg└───
265117ca54c3Smrg┌───
265217ca54c3Smrg    RRSetScreenSize
265317ca54c3Smrg	1	CARD8			major opcode
265417ca54c3Smrg	1	7			RandR opcode
265517ca54c3Smrg	2	5			length
265617ca54c3Smrg	4	WINDOW			window
265717ca54c3Smrg	2	CARD16			width
265817ca54c3Smrg	2	CARD16			height
265917ca54c3Smrg	4	CARD32			width in millimeters
266017ca54c3Smrg	4	CARD32			height in millimeters
266117ca54c3Smrg└───
266217ca54c3Smrg┌───
266317ca54c3Smrg    RRGetScreenResources
266417ca54c3Smrg	1	CARD8			major opcode
266517ca54c3Smrg	1	8			RandR opcode
266617ca54c3Smrg	2	2			length
266717ca54c3Smrg	4	WINDOW			window
266817ca54c3Smrg266917ca54c3Smrg	1	1			Reply
267017ca54c3Smrg	1				unused
267117ca54c3Smrg	2	CARD16			sequence number
267217ca54c3Smrg	4	c+o+8m+(b+p)/4		reply length
267317ca54c3Smrg	4	TIMESTAMP		timestamp
267417ca54c3Smrg	4	TIMESTAMP		config-timestamp
267517ca54c3Smrg	2	c			number of CRTCs
267617ca54c3Smrg	2	o			number of outputs
267717ca54c3Smrg	2	m			number of modeinfos
267817ca54c3Smrg	2	b			total bytes in mode names
267917ca54c3Smrg	8				unused
268017ca54c3Smrg	4c	LISTofCRTC		crtcs
268117ca54c3Smrg	4o	LISTofOUTPUT		outputs
268217ca54c3Smrg	32m	LISTofMODEINFO		modeinfos
268317ca54c3Smrg	b	STRING8			mode names
268417ca54c3Smrg	p				unused, p=pad(b)
268517ca54c3Smrg└───
268617ca54c3Smrg┌───
268717ca54c3Smrg    RRGetOutputInfo
268817ca54c3Smrg	1	CARD8			major opcode
268917ca54c3Smrg	1	9			RandR opcode
269017ca54c3Smrg	2	3			length
269117ca54c3Smrg	4	OUTPUT			output
269217ca54c3Smrg	4	TIMESTAMP		config-timestamp
269317ca54c3Smrg269417ca54c3Smrg	1	1			Reply
269517ca54c3Smrg	1	RRCONFIGSTATUS		status
269617ca54c3Smrg	2	CARD16			sequence number
269717ca54c3Smrg	4	1+c+m+(n+p)/4		reply length
269817ca54c3Smrg	4	TIMESTAMP		timestamp
269917ca54c3Smrg	4	CRTC			current connected crtc
270017ca54c3Smrg	4	CARD32			width in millimeters
270117ca54c3Smrg	4	CARD32			height in millimeters
270217ca54c3Smrg	1	CONNECTION		connection
270317ca54c3Smrg	1	SUBPIXELORDER		subpixel-order
270417ca54c3Smrg	2	c			number of CRTCs
270517ca54c3Smrg	2	m			number of modes
270617ca54c3Smrg	2	p			number of preferred modes
270717ca54c3Smrg	2	o			number of clones
270817ca54c3Smrg	2	n			length of name
270917ca54c3Smrg	4c	LISTofCRTC		crtcs
271017ca54c3Smrg	4m	LISTofMODE		modes
271117ca54c3Smrg	4o	LISTofOUTPUT		clones
271217ca54c3Smrg	n	STRING8			name
271317ca54c3Smrg	p				unused, p=pad(n)
271417ca54c3Smrg└───
271517ca54c3Smrg┌───
271617ca54c3Smrg    RRListOutputProperties
271717ca54c3Smrg	1	CARD8			major opcode
271817ca54c3Smrg	1	10			RandR opcode
271917ca54c3Smrg	2	2			length
272017ca54c3Smrg	4	OUTPUT			output
272117ca54c3Smrg272217ca54c3Smrg	1	1			Reply
272317ca54c3Smrg	1				unused
272417ca54c3Smrg	2	CARD16			sequence number
272517ca54c3Smrg	4	n			reply length
272617ca54c3Smrg	2	n			number of ATOMs in atoms
272717ca54c3Smrg	22				unused
272817ca54c3Smrg	4n	LISTofATOM		atoms
272917ca54c3Smrg└───
273017ca54c3Smrg┌───
273117ca54c3Smrg    RRQueryOutputProperty
273217ca54c3Smrg	1	CARD8			major opcode
273317ca54c3Smrg	1	11			RandR opcode
273417ca54c3Smrg	2	3			request length
273517ca54c3Smrg	4	OUTPUT			output
273617ca54c3Smrg	4	ATOM			property
273717ca54c3Smrg273817ca54c3Smrg	1	1			Reply
273917ca54c3Smrg	1				unused
274017ca54c3Smrg	2	CARD16			sequence number
274117ca54c3Smrg	4	n			reply length
274217ca54c3Smrg	1	BOOL			pending
274317ca54c3Smrg	1	BOOL			range
274417ca54c3Smrg	1	BOOL			immutable
274517ca54c3Smrg	21				unused
274617ca54c3Smrg	4n	LISTofINT32		valid values
274717ca54c3Smrg└───
274817ca54c3Smrg┌───
274917ca54c3Smrg    RRConfigureOutputProperty
275017ca54c3Smrg	1	CARD8			major opcode
275117ca54c3Smrg	1	12			RandR opcode
275217ca54c3Smrg	2	4+n			request length
275317ca54c3Smrg	4	OUTPUT			output
275417ca54c3Smrg	4	ATOM			property
275517ca54c3Smrg	1	BOOL			pending
275617ca54c3Smrg	1	BOOL			range
275717ca54c3Smrg	2				unused
275817ca54c3Smrg	4n	LISTofINT32		valid values
275917ca54c3Smrg└───
276017ca54c3Smrg┌───
276117ca54c3Smrg    RRChangeOutputProperty
276217ca54c3Smrg	1	CARD8			major opcode
276317ca54c3Smrg	1	13			RandR opcode
276417ca54c3Smrg	2	6+(n+p)/4		request length
276517ca54c3Smrg	4	OUTPUT			output
276617ca54c3Smrg	4	ATOM			property
276717ca54c3Smrg	4	ATOM			type
276817ca54c3Smrg	1	CARD8			format
276917ca54c3Smrg	1				mode
277017ca54c3Smrg		0	Replace
277117ca54c3Smrg		1	Prepend
277217ca54c3Smrg		2	Append
277317ca54c3Smrg	2				unused
277417ca54c3Smrg	4	CARD32			length of data in format units
277517ca54c3Smrg					(= n for format = 8)
277617ca54c3Smrg					(= n/2 for format = 16)
277717ca54c3Smrg					(= n/4 for format = 32)
277817ca54c3Smrg	n	LISTofBYTE		data
277917ca54c3Smrg					(n is a multiple of 2 for format = 16)
278017ca54c3Smrg					(n is a multiple of 4 for format = 32)
278117ca54c3Smrg	p				unused, p=pad(n)
278217ca54c3Smrg└───
278317ca54c3Smrg┌───
278417ca54c3Smrg    RRDeleteOutputProperty
278517ca54c3Smrg	1	CARD8			major opcode
278617ca54c3Smrg	1	14			RandR opcode
278717ca54c3Smrg	2	3			request length
278817ca54c3Smrg	4	OUTPUT			output
278917ca54c3Smrg	4	ATOM			property
279017ca54c3Smrg└───
279117ca54c3Smrg┌───
279217ca54c3Smrg    RRGetOutputProperty
279317ca54c3Smrg	1	CARD8			major opcode
279417ca54c3Smrg	1	15			RandR opcode
279517ca54c3Smrg	2	7			request length
279617ca54c3Smrg	4	OUTPUT			output
279717ca54c3Smrg	4	ATOM			property
279817ca54c3Smrg	4	ATOM			type
279917ca54c3Smrg		0	AnyPropertyType
280017ca54c3Smrg	4	CARD32			long-offset
280117ca54c3Smrg	4	CARD32			long-length
280217ca54c3Smrg	1	BOOL			delete
280317ca54c3Smrg	1	BOOL			pending
280417ca54c3Smrg	2				unused
280517ca54c3Smrg280617ca54c3Smrg	1	1			Reply
280717ca54c3Smrg	1	CARD8			format
280817ca54c3Smrg	2	CARD16			sequence number
280917ca54c3Smrg	4	(n+p)/4			reply length
281017ca54c3Smrg	4	ATOM			type
281117ca54c3Smrg		0	None
281217ca54c3Smrg	4	CARD32			bytes-after
281317ca54c3Smrg	4	CARD32			length of value in format units
281417ca54c3Smrg					(= 0 for format = 0)
281517ca54c3Smrg					(= n for format = 8)
281617ca54c3Smrg					(= n/2 for format = 16)
281717ca54c3Smrg					(= n/4 for format = 32)
281817ca54c3Smrg	12				unused
281917ca54c3Smrg	n	LISTofBYTE		value
282017ca54c3Smrg					(n is zero for format = 0)
282117ca54c3Smrg					(n is a multiple of 2 for format = 16)
282217ca54c3Smrg					(n is a multiple of 4 for format = 32)
282317ca54c3Smrg	p				unused, p=pad(n)
282417ca54c3Smrg└───
282517ca54c3Smrg┌───
282617ca54c3Smrg    RRCreateMode
282717ca54c3Smrg	1	CARD8			major opcode
282817ca54c3Smrg	1	16			RandR opcode
282917ca54c3Smrg	2	10+(n+p)/4		length
283017ca54c3Smrg	4	WINDOW			window
283117ca54c3Smrg	32	MODEINFO		mode
283217ca54c3Smrg	n	STRING8			mode name
283317ca54c3Smrg	p				unused, p=pad(n)
283417ca54c3Smrg283517ca54c3Smrg	1	1			Reply
283617ca54c3Smrg	1				unused
283717ca54c3Smrg	2	CARD16			sequence number
283817ca54c3Smrg	4	0			reply length
283917ca54c3Smrg	4	MODE			mode
284017ca54c3Smrg	20				unused
284117ca54c3Smrg└───
284217ca54c3Smrg┌───
284317ca54c3Smrg    RRDestroyMode
284417ca54c3Smrg	1	CARD8			major opcode
284517ca54c3Smrg	1	17			RandR opcode
284617ca54c3Smrg	2	2			length
284717ca54c3Smrg	4	MODE			mode
284817ca54c3Smrg└───
284917ca54c3Smrg┌───
285017ca54c3Smrg    RRAddOutputMode
285117ca54c3Smrg	1	CARD8			major opcode
285217ca54c3Smrg	1	18			RandR opcode
285317ca54c3Smrg	2	3			length
285417ca54c3Smrg	4	OUTPUT			output
285517ca54c3Smrg	4	MODE			mode
285617ca54c3Smrg└───
285717ca54c3Smrg┌───
285817ca54c3Smrg    RRDeleteOutputMode
285917ca54c3Smrg	1	CARD8			major opcode
286017ca54c3Smrg	1	19			RandR opcode
286117ca54c3Smrg	2	3			length
286217ca54c3Smrg	4	OUTPUT			output
286317ca54c3Smrg	4	MODE			mode
286417ca54c3Smrg└───
286517ca54c3Smrg┌───
286617ca54c3Smrg    RRGetCrtcInfo
286717ca54c3Smrg	1	CARD8			major opcode
286817ca54c3Smrg	1	20			RandR opcode
286917ca54c3Smrg	2	3			length
287017ca54c3Smrg	4	CRTC			crtc
287117ca54c3Smrg	4	TIMESTAMP		config-timestamp
287217ca54c3Smrg287317ca54c3Smrg	1	1			Reply
287417ca54c3Smrg	1	RRCONFIGSTATUS		status
287517ca54c3Smrg	2	CARD16			sequence number
287617ca54c3Smrg	4	o+p			reply length
287717ca54c3Smrg	4	TIMESTAMP		timestamp
287817ca54c3Smrg	2	INT16			x
287917ca54c3Smrg	2	INT16			y
288017ca54c3Smrg	2	CARD16			width
288117ca54c3Smrg	2	CARD16			height
288217ca54c3Smrg	4	MODE			mode
288317ca54c3Smrg	2	ROTATION		current rotation and reflection
288417ca54c3Smrg	2	ROTATION		set of possible rotations
288517ca54c3Smrg	2	o			number of outputs
288617ca54c3Smrg	2	p			number of possible outputs
288717ca54c3Smrg	4o	LISTofOUTPUT		outputs
288817ca54c3Smrg	4p	LISTofOUTPUT		possible outputs
288917ca54c3Smrg└───
289017ca54c3Smrg┌───
289117ca54c3Smrg    RRSetCrtcConfig
289217ca54c3Smrg	1	CARD8			major opcode
289317ca54c3Smrg	1	21			RandR opcode
289417ca54c3Smrg	2	7+n			length
289517ca54c3Smrg	4	CRTC			crtc
289617ca54c3Smrg	4	TIMESTAMP		timestamp
289717ca54c3Smrg	4	TIMESTAMP		config timestamp
289817ca54c3Smrg	2	INT16			x
289917ca54c3Smrg	2	INT16			y
290017ca54c3Smrg	4	MODE			mode
290117ca54c3Smrg	2	ROTATION		rotation/reflection
290217ca54c3Smrg	2				unused
290317ca54c3Smrg	4n	LISTofOUTPUT		outputs
290417ca54c3Smrg290517ca54c3Smrg	1	1			Reply
290617ca54c3Smrg	1	RRCONFIGSTATUS		status
290717ca54c3Smrg	2	CARD16			sequence number
290817ca54c3Smrg	4	0			reply length
290917ca54c3Smrg	4	TIMESTAMP		new timestamp
291017ca54c3Smrg	20				unused
291117ca54c3Smrg└───
291217ca54c3Smrg┌───
291317ca54c3Smrg    RRGetCrtcGammaSize
291417ca54c3Smrg	1	CARD8			major opcode
291517ca54c3Smrg	1	22			RandR opcode
291617ca54c3Smrg	2	2			length
291717ca54c3Smrg	4	CRTC			crtc
291817ca54c3Smrg291917ca54c3Smrg	1	1			Reply
292017ca54c3Smrg	1				unused
292117ca54c3Smrg	2	CARD16			sequence number
292217ca54c3Smrg	4	0			reply length
292317ca54c3Smrg	2	CARD16			size
292417ca54c3Smrg	22				unused
292517ca54c3Smrg└───
292617ca54c3Smrg┌───
292717ca54c3Smrg    RRGetCrtcGamma
292817ca54c3Smrg	1	CARD8			major opcode
292917ca54c3Smrg	1	23			RandR opcode
293017ca54c3Smrg	2	2			length
293117ca54c3Smrg	4	CRTC			crtc
293217ca54c3Smrg293317ca54c3Smrg	1	1			Reply
293417ca54c3Smrg	1				unused
293517ca54c3Smrg	2	CARD16			sequence number
293617ca54c3Smrg	4	(6n+p)/4		reply length
293717ca54c3Smrg	2	n			size
293817ca54c3Smrg	20				unused
293917ca54c3Smrg	2n	LISTofCARD16		red
294017ca54c3Smrg	2n	LISTofCARD16		green
294117ca54c3Smrg	2n	LISTofCARD16		blue
294217ca54c3Smrg	p				unused, p=pad(6n)
294317ca54c3Smrg└───
294417ca54c3Smrg┌───
294517ca54c3Smrg    RRSetCrtcGamma
294617ca54c3Smrg	1	CARD8			major opcode
294717ca54c3Smrg	1	24			RandR opcode
294817ca54c3Smrg	2	3+(6n+p)/4		length
294917ca54c3Smrg	4	CRTC			crtc
295017ca54c3Smrg	2	n			size
295117ca54c3Smrg	2				unused
295217ca54c3Smrg	2n	LISTofCARD16		red
295317ca54c3Smrg	2n	LISTofCARD16		green
295417ca54c3Smrg	2n	LISTofCARD16		blue
295517ca54c3Smrg	p				unused, p=pad(6n)
295617ca54c3Smrg└───
295717ca54c3Smrg
295817ca54c3SmrgA.2.2 Protocol Requests added with version 1.3
295917ca54c3Smrg
296017ca54c3Smrg┌───
296117ca54c3Smrg    RRGetScreenResourcesCurrent
296217ca54c3Smrg	1	CARD8			major opcode
296317ca54c3Smrg	1	25			RandR opcode
296417ca54c3Smrg	2	2			length
296517ca54c3Smrg	4	WINDOW			window
296617ca54c3Smrg296717ca54c3Smrg	1	1			Reply
296817ca54c3Smrg	1				unused
296917ca54c3Smrg	2	CARD16			sequence number
297017ca54c3Smrg	4	c+o+8m+(b+p)/4		reply length
297117ca54c3Smrg	4	TIMESTAMP		timestamp
297217ca54c3Smrg	4	TIMESTAMP		config-timestamp
297317ca54c3Smrg	2	c			number of CRTCs
297417ca54c3Smrg	2	o			number of outputs
297517ca54c3Smrg	2	m			number of modeinfos
297617ca54c3Smrg	2	b			total bytes in mode names
297717ca54c3Smrg	8				unused
297817ca54c3Smrg	4c	LISTofCRTC		crtcs
297917ca54c3Smrg	4o	LISTofOUTPUT		outputs
298017ca54c3Smrg	32m	LISTofMODEINFO		modeinfos
298117ca54c3Smrg	b	STRING8			mode names
298217ca54c3Smrg	p				unused, p=pad(b)
298317ca54c3Smrg└───
298417ca54c3Smrg
298517ca54c3Smrg┌───
298617ca54c3Smrg    RRSetCrtcTransform
298717ca54c3Smrg	1	CARD8			major opcode
298817ca54c3Smrg	1	26			RandR opcode
298917ca54c3Smrg	2	12+(n+p)/4+v		length
299017ca54c3Smrg	4	CRTC			crtc
299117ca54c3Smrg	36	TRANSFORM		transform
299217ca54c3Smrg	2	CARD16			filter length
299317ca54c3Smrg	2				unused
299417ca54c3Smrg	n	STRING8			filter name
299517ca54c3Smrg	p				unused, p=pad(n)
299617ca54c3Smrg	4v	FIXED			filter params
299717ca54c3Smrg└───
299817ca54c3Smrg
299917ca54c3Smrg┌───
300017ca54c3Smrg    RRGetCrtcTransform
300117ca54c3Smrg	1	CARD8			major opcode
300217ca54c3Smrg	1	27			RandR opcode
300317ca54c3Smrg	2	2			length
300417ca54c3Smrg	4	CRTC			crtc
300517ca54c3Smrg300617ca54c3Smrg	1	1			Reply
300717ca54c3Smrg	1				unused
300817ca54c3Smrg	2	CARD16			sequence number
300917ca54c3Smrg	4	16+(pn+pnp)/4+(cn+cnp)/4+pf+cf	reply length
301017ca54c3Smrg	36	TRANSFORM		pending transform
301117ca54c3Smrg	1	BOOL			has transforms
301217ca54c3Smrg	3				unused
301317ca54c3Smrg	36	TRANSFORM		current transform
301417ca54c3Smrg	4				unused
301517ca54c3Smrg	2	pn			pending filter name length
301617ca54c3Smrg	2	pf			pending filter num params
301717ca54c3Smrg	2	cn			current filter name length
301817ca54c3Smrg	2	cf			current filter num params
301917ca54c3Smrg	pn	STRING8			pending filter name
302017ca54c3Smrg	pnp				unused, pnp=pad(pn)
302117ca54c3Smrg	4*pf	FIXED			pending filter params
302217ca54c3Smrg	cn	STRING8			current filter name
302317ca54c3Smrg	cnp				unused, cnp=pad(cn)
302417ca54c3Smrg	4*cf	FIXED			current filter params
302517ca54c3Smrg└───
302617ca54c3Smrg
302717ca54c3Smrg┌───
302817ca54c3Smrg    RRGetPanning
302917ca54c3Smrg	1	CARD8			major opcode
303017ca54c3Smrg	1	28			RandR opcode
303117ca54c3Smrg	2	2			length
303217ca54c3Smrg	4	CRTC			crtc
303317ca54c3Smrg303417ca54c3Smrg	1	1			Reply
303517ca54c3Smrg	1	RRCONFIGSTATUS		status
303617ca54c3Smrg	2	CARD16			sequence number
303717ca54c3Smrg	4	1			reply length
303817ca54c3Smrg	4	TIMESTAMP		timestamp
303917ca54c3Smrg	2	CARD16			left
304017ca54c3Smrg	2	CARD16			top
304117ca54c3Smrg	2	CARD16			width
304217ca54c3Smrg	2	CARD16			height
304317ca54c3Smrg	2	CARD16			track_left
304417ca54c3Smrg	2	CARD16			track_top
304517ca54c3Smrg	2	CARD16			track_width
304617ca54c3Smrg	2	CARD16			track_height
304717ca54c3Smrg	2	INT16			border_left
304817ca54c3Smrg	2	INT16			border_top
304917ca54c3Smrg	2	INT16			border_right
305017ca54c3Smrg	2	INT16			border_bottom
305117ca54c3Smrg└───
305217ca54c3Smrg┌───
305317ca54c3Smrg    RRSetPanning
305417ca54c3Smrg	1	CARD8			major opcode
305517ca54c3Smrg	1	29			RandR opcode
305617ca54c3Smrg	2	9			length
305717ca54c3Smrg	4	CRTC			crtc
305817ca54c3Smrg	4	TIMESTAMP		timestamp
305917ca54c3Smrg	2	CARD16			left
306017ca54c3Smrg	2	CARD16			top
306117ca54c3Smrg	2	CARD16			width
306217ca54c3Smrg	2	CARD16			height
306317ca54c3Smrg	2	CARD16			track_left
306417ca54c3Smrg	2	CARD16			track_top
306517ca54c3Smrg	2	CARD16			track_width
306617ca54c3Smrg	2	CARD16			track_height
306717ca54c3Smrg	2	INT16			border_left
306817ca54c3Smrg	2	INT16			border_top
306917ca54c3Smrg	2	INT16			border_right
307017ca54c3Smrg	2	INT16			border_bottom
307117ca54c3Smrg307217ca54c3Smrg	1	1			Reply
307317ca54c3Smrg	1	RRCONFIGSTATUS		status
307417ca54c3Smrg	2	CARD16			sequence number
307517ca54c3Smrg	4	0			reply length
307617ca54c3Smrg	4	TIMESTAMP		new timestamp
307717ca54c3Smrg	20				unused
307817ca54c3Smrg└───
307917ca54c3Smrg
308017ca54c3Smrg┌───
308117ca54c3Smrg    RRSetOutputPrimary
308217ca54c3Smrg	1	CARD8			major opcode
308317ca54c3Smrg	1	30			RandR opcode
308417ca54c3Smrg	2	3			length
308517ca54c3Smrg	4	WINDOW			window
308617ca54c3Smrg	4	OUTPUT			output
308717ca54c3Smrg└───
308817ca54c3Smrg
308917ca54c3Smrg┌───
309017ca54c3Smrg    RRGetOutputPrimary
309117ca54c3Smrg	1	CARD8			major opcode
309217ca54c3Smrg	1	31			RandR opcode
309317ca54c3Smrg	2	2			length
309417ca54c3Smrg	4	WINDOW			window
309517ca54c3Smrg309617ca54c3Smrg	1	1			Reply
309717ca54c3Smrg	1				unused
309817ca54c3Smrg	2	CARD16			sequence number
309917ca54c3Smrg	4	CARD32			length
310017ca54c3Smrg	4	OUTPUT			output
310117ca54c3Smrg	4	CARD32			pad1
310217ca54c3Smrg	4	CARD32			pad2
310317ca54c3Smrg	4	CARD32			pad3
310417ca54c3Smrg	4	CARD32			pad4
310517ca54c3Smrg└───
310617ca54c3Smrg
310717ca54c3SmrgA.2.3 Protocol Requests added with version 1.4
310817ca54c3Smrg
310917ca54c3Smrg┌───
311017ca54c3Smrg    RRGetProviders
311117ca54c3Smrg	1	CARD8			major opcode
311217ca54c3Smrg	1	32			RandR opcode
311317ca54c3Smrg	2	2			length
311417ca54c3Smrg	4	WINDOW			window
311517ca54c3Smrg311617ca54c3Smrg	1	1			Reply
311717ca54c3Smrg	1				unused
311817ca54c3Smrg	2	CARD16			sequence number
311917ca54c3Smrg	4	p			length
312017ca54c3Smrg	4	TIMESTAMP		timestamp
312117ca54c3Smrg	2	p			number of Providers
312217ca54c3Smrg	18				unused
312317ca54c3Smrg	4p	LISTofPROVIDERS		providers
312417ca54c3Smrg└───
312517ca54c3Smrg┌───
312617ca54c3Smrg    RRGetProviderInfo
312717ca54c3Smrg	1	CARD8			major opcode
312817ca54c3Smrg	1	33			RandR opcode
312917ca54c3Smrg	2	3			length
313017ca54c3Smrg	4	PROVIDER		provider
313117ca54c3Smrg	4	TIMESTAMP		config-timestamp
313217ca54c3Smrg313317ca54c3Smrg	1	1			Reply
313417ca54c3Smrg	1	RRCONFIGSTATUS		status
313517ca54c3Smrg	2	CARD16			sequence number
313617ca54c3Smrg	4	1+c+o+(a*2)+(n+p)/4		reply length
313717ca54c3Smrg	4	TIMESTAMP		timestamp
313817ca54c3Smrg	4	CARD32			capabilities
313917ca54c3Smrg	2	c			number of crtcs
314017ca54c3Smrg	2	o 			number of outputs
314117ca54c3Smrg	2	a 			number of associated providers
314217ca54c3Smrg	2	n			length of name
314317ca54c3Smrg	8       			unused
314417ca54c3Smrg	4c	LISTofCRTC		crtcs
314517ca54c3Smrg	4o	LISTofOUTPUT		outputs
314617ca54c3Smrg	4a	LISTofPROVIDER		associated providers
314717ca54c3Smrg	4a	CARD32			associated provider capability
314817ca54c3Smrg	n	STRING8			name
314917ca54c3Smrg	p				unused, p=pad(n)
315017ca54c3Smrg└───
315117ca54c3Smrg┌───
315217ca54c3Smrg    RRSetProviderOffloadSink
315317ca54c3Smrg	1	CARD8			major opcode
315417ca54c3Smrg	1	34			RandR opcode
315517ca54c3Smrg	2	4			length
315617ca54c3Smrg	4	PROVIDER		provider
315717ca54c3Smrg	4	PROVIDER		offload sink provider
315817ca54c3Smrg	4	TIMESTAMP		timestamp
315917ca54c3Smrg└───
316017ca54c3Smrg┌───
316117ca54c3Smrg    RRSetProviderOutputSource
316217ca54c3Smrg	1	CARD8			major opcode
316317ca54c3Smrg	1	35			RandR opcode
316417ca54c3Smrg	2	4			length
316517ca54c3Smrg	4	PROVIDER		provider
316617ca54c3Smrg	4	PROVIDER		output source provider
316717ca54c3Smrg	4	TIMESTAMP		timestamp
316817ca54c3Smrg└───
316917ca54c3Smrg┌───
317017ca54c3Smrg    RRListProviderProperties
317117ca54c3Smrg	1	CARD8			major opcode
317217ca54c3Smrg	1	36			RandR opcode
317317ca54c3Smrg	2	2			length
317417ca54c3Smrg	4	PROVIDER		provider
317517ca54c3Smrg317617ca54c3Smrg	1	1			Reply
317717ca54c3Smrg	1				unused
317817ca54c3Smrg	2	CARD16			sequence number
317917ca54c3Smrg	4	n			reply length
318017ca54c3Smrg	2	n			number of ATOMs in atoms
318117ca54c3Smrg	22				unused
318217ca54c3Smrg	4n	LISTofATOM		atoms
318317ca54c3Smrg└───
318417ca54c3Smrg┌───
318517ca54c3Smrg    RRQueryProviderProperty
318617ca54c3Smrg	1	CARD8			major opcode
318717ca54c3Smrg	1	37			RandR opcode
318817ca54c3Smrg	2	3			request length
318917ca54c3Smrg	4	PROVIDER		provider
319017ca54c3Smrg	4	ATOM			property
319117ca54c3Smrg319217ca54c3Smrg	1	1			Reply
319317ca54c3Smrg	1				unused
319417ca54c3Smrg	2	CARD16			sequence number
319517ca54c3Smrg	4	n			reply length
319617ca54c3Smrg	1	BOOL			pending
319717ca54c3Smrg	1	BOOL			range
319817ca54c3Smrg	1	BOOL			immutable
319917ca54c3Smrg	21				unused
320017ca54c3Smrg	4n	LISTofINT32		valid values
320117ca54c3Smrg└───
320217ca54c3Smrg┌───
320317ca54c3Smrg    RRConfigureProviderProperty
320417ca54c3Smrg	1	CARD8			major opcode
320517ca54c3Smrg	1	38			RandR opcode
320617ca54c3Smrg	2	4+n			request length
320717ca54c3Smrg	4	PROVIDER		provider
320817ca54c3Smrg	4	ATOM			property
320917ca54c3Smrg	1	BOOL			pending
321017ca54c3Smrg	1	BOOL			range
321117ca54c3Smrg	2				unused
321217ca54c3Smrg	4n	LISTofINT32		valid values
321317ca54c3Smrg└───
321417ca54c3Smrg┌───
321517ca54c3Smrg    RRChangeProviderProperty
321617ca54c3Smrg	1	CARD8			major opcode
321717ca54c3Smrg	1	39			RandR opcode
321817ca54c3Smrg	2	6+(n+p)/4		request length
321917ca54c3Smrg	4	PROVIDER		provider
322017ca54c3Smrg	4	ATOM			property
322117ca54c3Smrg	4	ATOM			type
322217ca54c3Smrg	1	CARD8			format
322317ca54c3Smrg	1				mode
322417ca54c3Smrg		0	Replace
322517ca54c3Smrg		1	Prepend
322617ca54c3Smrg		2	Append
322717ca54c3Smrg	2				unused
322817ca54c3Smrg	4	CARD32			length of data in format units
322917ca54c3Smrg					(= n for format = 8)
323017ca54c3Smrg					(= n/2 for format = 16)
323117ca54c3Smrg					(= n/4 for format = 32)
323217ca54c3Smrg	n	LISTofBYTE		data
323317ca54c3Smrg					(n is a multiple of 2 for format = 16)
323417ca54c3Smrg					(n is a multiple of 4 for format = 32)
323517ca54c3Smrg	p				unused, p=pad(n)
323617ca54c3Smrg└───
323717ca54c3Smrg┌───
323817ca54c3Smrg    RRDeleteProviderProperty
323917ca54c3Smrg	1	CARD8			major opcode
324017ca54c3Smrg	1	40			RandR opcode
324117ca54c3Smrg	2	3			request length
324217ca54c3Smrg	4	PROVIDER		provider
324317ca54c3Smrg	4	ATOM			property
324417ca54c3Smrg└───
324517ca54c3Smrg┌───
324617ca54c3Smrg    RRGetProviderProperty
324717ca54c3Smrg	1	CARD8			major opcode
324817ca54c3Smrg	1	41			RandR opcode
324917ca54c3Smrg	2	7			request length
325017ca54c3Smrg	4	PROVIDER		provider
325117ca54c3Smrg	4	ATOM			property
325217ca54c3Smrg	4	ATOM			type
325317ca54c3Smrg		0	AnyPropertyType
325417ca54c3Smrg	4	CARD32			long-offset
325517ca54c3Smrg	4	CARD32			long-length
325617ca54c3Smrg	1	BOOL			delete
325717ca54c3Smrg	1	BOOL			pending
325817ca54c3Smrg	2				unused
325917ca54c3Smrg326017ca54c3Smrg	1	1			Reply
326117ca54c3Smrg	1	CARD8			format
326217ca54c3Smrg	2	CARD16			sequence number
326317ca54c3Smrg	4	(n+p)/4			reply length
326417ca54c3Smrg	4	ATOM			type
326517ca54c3Smrg		0	None
326617ca54c3Smrg	4	CARD32			bytes-after
326717ca54c3Smrg	4	CARD32			length of value in format units
326817ca54c3Smrg					(= 0 for format = 0)
326917ca54c3Smrg					(= n for format = 8)
327017ca54c3Smrg					(= n/2 for format = 16)
327117ca54c3Smrg					(= n/4 for format = 32)
327217ca54c3Smrg	12				unused
327317ca54c3Smrg	n	LISTofBYTE		value
327417ca54c3Smrg					(n is zero for format = 0)
327517ca54c3Smrg					(n is a multiple of 2 for format = 16)
327617ca54c3Smrg					(n is a multiple of 4 for format = 32)
327717ca54c3Smrg	p				unused, p=pad(n)
327817ca54c3Smrg└───
327917ca54c3Smrg
328017ca54c3SmrgA.2.4 Protocol Requests added with version 1.5
328117ca54c3Smrg
328217ca54c3Smrg┌───
328317ca54c3Smrg    RRGetMonitors
328417ca54c3Smrg	1	CARD8			major opcode
328517ca54c3Smrg	1	42			RandR opcode
328617ca54c3Smrg	2	2			request length
328717ca54c3Smrg	4	WINDOW			window
328817ca54c3Smrg328917ca54c3Smrg	1	1			Reply
329017ca54c3Smrg	1				unused
329117ca54c3Smrg	2	CARD16			sequence number
329217ca54c3Smrg	4	6*n + o			reply length
329317ca54c3Smrg	4	TIMESTAMP		timestamp
329417ca54c3Smrg	4	n			nmonitors
329517ca54c3Smrg	4	o			noutputs
329617ca54c3Smrg	12				unused
329717ca54c3Smrg	n*24+o*4 LISTofMONITORINFO	monitors
329817ca54c3Smrg└───
329917ca54c3Smrg┌───
330017ca54c3Smrg    RRSetMonitor
330117ca54c3Smrg	1	CARD8			major opcode
330217ca54c3Smrg	1	43			RandR opcode
330317ca54c3Smrg	2	6 + o			request length
330417ca54c3Smrg	4	WINDOW			window
330517ca54c3Smrg	24+o	MONITORINFO		monitorinfo
330617ca54c3Smrg└───
330717ca54c3Smrg┌───
330817ca54c3Smrg    RRDeleteMonitor
330917ca54c3Smrg	1	CARD8			major opcode
331017ca54c3Smrg	1	44			RandR opcode
331117ca54c3Smrg	2	3			request length
331217ca54c3Smrg	4	WINDOW			window
331317ca54c3Smrg	4	ATOM			name
331417ca54c3Smrg└───
331517ca54c3Smrg
331617ca54c3SmrgA.3 Protocol Events
331717ca54c3Smrg
331817ca54c3Smrg┌───
331917ca54c3Smrg    RRScreenChangeNotify
332017ca54c3Smrg	1	Base + 0		code
332117ca54c3Smrg	1	ROTATION		new rotation and reflection
332217ca54c3Smrg	2	CARD16			sequence number
332317ca54c3Smrg	4	TIMESTAMP		timestamp
332417ca54c3Smrg	4	TIMESTAMP		configuration timestamp
332517ca54c3Smrg	4	WINDOW			root window
332617ca54c3Smrg	4	WINDOW			request window
332717ca54c3Smrg	2	SIZEID			size ID
332817ca54c3Smrg	2	SUBPIXELORDER		subpixel order defined in Render
332917ca54c3Smrg	2	CARD16			width in pixels
333017ca54c3Smrg	2	CARD16			height in pixels
333117ca54c3Smrg	2	CARD16			width in millimeters
333217ca54c3Smrg	2	CARD16			height in millimeters
333317ca54c3Smrg└───
333417ca54c3Smrg
333517ca54c3SmrgA.3.1 Protocol Events added with version 1.2
333617ca54c3Smrg
333717ca54c3Smrg┌───
333817ca54c3Smrg    RRCrtcChangeNotify
333917ca54c3Smrg	1	Base + 1		code
334017ca54c3Smrg	1	0			sub-code
334117ca54c3Smrg	2	CARD16			sequence number
334217ca54c3Smrg	4	TIMESTAMP		timestamp
334317ca54c3Smrg	4	WINDOW			request window
334417ca54c3Smrg	4	CRTC			crtc affected
334517ca54c3Smrg	4	MODE			mode in use
334617ca54c3Smrg	2	ROTATION		new rotation and reflection
334717ca54c3Smrg	2				unused
334817ca54c3Smrg	2	INT16			x
334917ca54c3Smrg	2	INT16			y
335017ca54c3Smrg	2	CARD16			width
335117ca54c3Smrg	2	CARD16			height
335217ca54c3Smrg└───
335317ca54c3Smrg┌───
335417ca54c3Smrg    RROutputChangeNotify
335517ca54c3Smrg	1	Base + 1		code
335617ca54c3Smrg	1	1			sub-code
335717ca54c3Smrg	2	CARD16			sequence number
335817ca54c3Smrg	4	TIMESTAMP		timestamp
335917ca54c3Smrg	4	TIMESTAMP		configuration timestamp
336017ca54c3Smrg	4	WINDOW			request window
336117ca54c3Smrg	4	OUTPUT			output affected
336217ca54c3Smrg	4	CRTC			crtc in use
336317ca54c3Smrg	4	MODE			mode in use
336417ca54c3Smrg	2	ROTATION		rotation in use
336517ca54c3Smrg	1	CONNECTION		connection status
336617ca54c3Smrg	1	SUBPIXELORDER		subpixel order
336717ca54c3Smrg└───
336817ca54c3Smrg┌───
336917ca54c3Smrg    RROutputPropertyNotify
337017ca54c3Smrg	1	Base + 1		code
337117ca54c3Smrg	1	2			sub-code
337217ca54c3Smrg	2	CARD16			sequence number
337317ca54c3Smrg	4	WINDOW			window
337417ca54c3Smrg	4	OUTPUT			output
337517ca54c3Smrg	4	ATOM			atom
337617ca54c3Smrg	4	TIMESTAMP		time
337717ca54c3Smrg	1				state
337817ca54c3Smrg		0	NewValue
337917ca54c3Smrg		1	Deleted
338017ca54c3Smrg	11				unused
338117ca54c3Smrg└───
338217ca54c3Smrg
338317ca54c3SmrgA.3.2 Protocol Events added with version 1.4
338417ca54c3Smrg┌───
338517ca54c3Smrg    RRProviderChangeNotify
338617ca54c3Smrg	1	Base + 1		code
338717ca54c3Smrg	1	3			sub-code
338817ca54c3Smrg	2	CARD16			sequence number
338917ca54c3Smrg	4	TIMESTAMP		timestamp
339017ca54c3Smrg	4	WINDOW			request window
339117ca54c3Smrg	4	PROVIDER		provider affected
339217ca54c3Smrg	16				unused
339317ca54c3Smrg└───
339417ca54c3Smrg┌───
339517ca54c3Smrg    RRProviderPropertyNotify
339617ca54c3Smrg	1	Base + 1		code
339717ca54c3Smrg	1	4			sub-code
339817ca54c3Smrg	2	CARD16			sequence number
339917ca54c3Smrg	4	WINDOW			window
340017ca54c3Smrg	4	PROVIDER		provider
340117ca54c3Smrg	4	ATOM			atom
340217ca54c3Smrg	4	TIMESTAMP		time
340317ca54c3Smrg	1				state
340417ca54c3Smrg		0	NewValue
340517ca54c3Smrg		1	Deleted
340617ca54c3Smrg	11				unused
340717ca54c3Smrg└───
340817ca54c3Smrg┌───
340917ca54c3Smrg    RRResourceChangeNotify
341017ca54c3Smrg	1	Base + 1		code
341117ca54c3Smrg	1	5			sub-code
341217ca54c3Smrg	2	CARD16			sequence number
341317ca54c3Smrg	4	TIMESTAMP		time
341417ca54c3Smrg	4	WINDOW			window
341517ca54c3Smrg	20				unused
341617ca54c3Smrg└───
341717ca54c3SmrgA.4 Protocol Errors
341817ca54c3Smrg
341917ca54c3Smrg┌───
342017ca54c3Smrg    ERRORS
342117ca54c3Smrg	Base + 0		Output
342217ca54c3Smrg	Base + 1		Crtc
342317ca54c3Smrg	Base + 2		Mode
342417ca54c3Smrg	Base + 3		Provider
342517ca54c3Smrg└───
342617ca54c3Smrg
342717ca54c3SmrgBibliography
342817ca54c3Smrg
342917ca54c3Smrg[RANDR] Gettys, Jim and Keith Packard, "The X Resize and Rotate
343017ca54c3Smrg	Extension - RandR", Proceedings of the 2001 USENIX Annual
343117ca54c3Smrg	Technical Conference, Boston, MA
343217ca54c3Smrg
343317ca54c3Smrg[RENDER]
343417ca54c3Smrg	Packard, Keith, "The X Rendering Extension", work in progress,
3435ea1d6981Smrg	https://gitlab.freedesktop.org/xorg/proto/xorgproto/raw/master/renderproto.txt
3436