summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-02-16 22:44:30 -0800
committerKeith Packard <keithp@keithp.com>2011-02-16 22:48:52 -0800
commit105a161a3f5fb67f5fe7e4119629d424672804aa (patch)
tree2ed2af10525579da1875f7e60ba3971f62d391dc
parent611a4e0c7bdc9831e0eda396030a27bcd2c11759 (diff)
Make SetCrtcConfigs take flags bits to allow partial configuration changes
Instead of requiring a complete new configuration to be computed, allow the client to send a partial configuration with only the changed values included. This simplifies clients so that they need not change things they don't understand. This also removes the 'CurrentScanoutPixmap' hack as that is no longer necessary. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--randr.h18
-rw-r--r--randrproto.h6
-rw-r--r--randrproto.txt100
3 files changed, 92 insertions, 32 deletions
diff --git a/randr.h b/randr.h
index 4480f5c..41aedd5 100644
--- a/randr.h
+++ b/randr.h
@@ -93,6 +93,21 @@ typedef unsigned long XRandrModeFlags;
#define RRTransformProjective (1L << 3)
/* V1.4 additions */
+
+#define RR_SetScreenPixmapSize (1 << 0)
+#define RR_SetScreenSize (1 << 1)
+#define RR_SetScreenSizeInMillimeters (1 << 2)
+#define RR_SetScreenCrtcs (1 << 3)
+
+#define RR_SetCrtcPosition (1 << 4)
+#define RR_SetCrtcMode (1 << 5)
+#define RR_SetCrtcRotation (1 << 6)
+#define RR_SetCrtcOutputs (1 << 7)
+#define RR_SetCrtcSpritePositionTransform (1 << 8)
+#define RR_SetCrtcSpriteImageTransform (1 << 9)
+#define RR_SetCrtcPixmap (1 << 10)
+#define RR_SetCrtcPixmapPosition (1 << 11)
+
#define X_RRQueryScanoutPixmaps 32
#define X_RRCreateScanoutPixmap 33
#define X_RRSetCrtcSpriteTransform 34
@@ -156,9 +171,6 @@ typedef unsigned long XRandrModeFlags;
#define BadRRCrtc 1
#define BadRRMode 2
-/* new in 1.4 protocol */
-#define RR_CurrentScanoutPixmap 1 /* current scanout pixmap in RRSetCrtcConfigs */
-
/* Conventional RandR output properties */
#define RR_PROPERTY_BACKLIGHT "Backlight"
diff --git a/randrproto.h b/randrproto.h
index ba9b703..00bae2d 100644
--- a/randrproto.h
+++ b/randrproto.h
@@ -661,6 +661,7 @@ typedef struct {
typedef struct {
RRCrtc crtc B32;
+ CARD32 set B32;
INT16 x B16, y B16;
RRMode mode B32;
Rotation rotation B16;
@@ -670,7 +671,7 @@ typedef struct {
Pixmap pixmap B32;
INT16 xPixmap B16, yPixmap B16;
} xRRCrtcConfig;
-#define sz_xRRCrtcConfig (2*sz_xRenderTransform + 24)
+#define sz_xRRCrtcConfig (2*sz_xRenderTransform + 28)
typedef struct {
CARD8 reqType;
@@ -740,6 +741,7 @@ typedef struct {
CARD8 randrReqType;
CARD16 length B16;
Drawable drawable B32;
+ CARD32 set B32;
CARD16 screenPixmapWidth B16, screenPixmapHeight B16;
CARD16 screenWidth B16, screenHeight B16;
CARD32 widthInMillimeters B32;
@@ -748,7 +750,7 @@ typedef struct {
CARD16 pad0 B16;
CARD32 pad1 B32;
} xRRSetCrtcConfigsReq;
-#define sz_xRRSetCrtcConfigsReq 32
+#define sz_xRRSetCrtcConfigsReq 36
typedef struct {
BYTE type;
diff --git a/randrproto.txt b/randrproto.txt
index ee513e7..20cac75 100644
--- a/randrproto.txt
+++ b/randrproto.txt
@@ -1,5 +1,5 @@
The X Resize, Rotate and Reflect Extension
- Version 1.3.1
+ Version 1.4.0
2009-10-5
Jim Gettys
@@ -371,46 +371,77 @@ SCANOUTPIXMAPINFO { format: PICTFORMAT
compositing process in conjunction with the sprite transforms
described in this extension.
+SCREENFLAG { SetScreenPixmapSize
+ SetScreenSize
+ SetScreenSizeInMillimeters
+ SetScreenCrtcs }
+
+CRTCFLAG { SetCrtcPosition
+ SetCrtcMode
+ SetCrtcRotation
+ SetCrtcOutputs
+ SetCrtcSpritePositionTransform
+ SetCrtcSpriteImageTransform
+ SetCrtcPixmap
+ SetCrtcPixmapPosition }
+
CRTCCONFIG { crtc: CRTC
+ set: SETofCRTCFLAG
x, y: INT16
mode: MODE
rotation: ROTATION
sprite-position-transform: TRANSFORM
sprite-image-transform: TRANSFORM
outputs: LISTofOUTPUT
- pixmap: PIXMAP, None or CurrentScanoutPixmap
+ pixmap: PIXMAP or None
pixmap-x, pixmap-y: INT16 }
- The sprite-position-transform and sprite-image-transform
- values are used as in the RRSetCrtcSpriteTransform request
- position-transform and image-transform parameters.
+ If 'set' includes SetCrtcSpritePositionTransform, then
+ sprite-position-transform is used as in the
+ RRSetCrtcSpriteTransform request position-transform parameter.
- 'pixmap' specifies the origin of the pixel data to be presented on
- 'crtc'. If 'pixmap' is None, then data will be presented from
- the screen pixmap. If 'pixmap' is 'CurrentScanoutPixmap', then
- whatever source is currently in use will remain in use, whether
- that is the screen pixmap or some other allocated scanout pixmap.
+ If 'set' includes SetCrtcSpriteImageTransform, then
+ sprite-image-transform is used as in the
+ RRSetCrtcSpriteTransform request image-transform parameter.
- 'pixmap-x' and 'pixmap-y' specify the origin of the scanout
- data within the pixmap, the area from that location to
- pixmap-x + width-of(mode), pixmap-y + height-of(mode) is what
- will be seen on the connected outputs.
+ If 'set' includes SetCrtcPixmap, then 'pixmap' specifies the
+ origin of the pixel data to be presented on 'crtc'. If
+ 'pixmap' is None, then data will be presented from the screen
+ pixmap.
- The pixmap value must specify a scanout pixmap as created by
- RRCreateScanoutPixmap, or a Match error results.
+ If 'set' includes SetCrtcPixmapPosition, then 'pixmap-x' and
+ 'pixmap-y' specify the origin of the scanout data within the
+ pixmap, the area from that location to pixmap-x +
+ width-of(mode), pixmap-y + height-of(mode) is what will be
+ seen on the connected outputs.
- The specified pixmap must be at least as large as the area to
- be scanned out, or a Match error results.
+ If 'set' includes SetCrtcPixmap, then 'pixmap' must specify a
+ scanout pixmap as created by RRCreateScanoutPixmap or
+ None. Otherwise a Match error results. Furthermore:
- The specified pixmap must have had the specified 'rotation'
- included as a part of its creation paramaeters, or a Match
- error results.
+ * 'pixmap' must be at least as large as the area to be
+ scanned out, or a Match error results.
+
+ * If 'pixmap' is destroyed while still being used as a
+ scanout pixmap, then the associated CRTC will have its
+ scanout pixmap set back to None, the CRTC origin set back
+ to 0,0 (to make sure it fits) and the screen pixmap width
+ and height increased to be at least as big as the current
+ CRTC mode.
+
+ * Future crtc changes that do not change the scanout pixmap
+ will cause an existing scanout pixmap to be resized to be
+ large enough to hold the new mode at the then-current
+ pixmap-x/pixmap-y location.
+
+ If 'set' includes SetCrtcRotation then:
- If 'pixmap' is destroyed while still being used as a scanout
- pixmap, then the associated CRTC will have its scanout pixmap
- set back to None, the CRTC origin set back to 0,0 (to make
- sure it fits) and the screen pixmap width and height increased
- to be at least as big as the current CRTC mode.
+ * Any new or existing scanout pixmap must have had the
+ specified 'rotation' included as a part of its creation
+ parameters, or a Match error results.
+
+ * If no scanout pixmap is in use, then the crtc must support
+ 'rotation' else a Value error results.
❧❧❧❧❧❧❧❧❧❧❧
@@ -1413,6 +1444,7 @@ dynamic changes in the display environment.
┌───
RRSetCrtcConfigs
drawable: DRAWABLE
+ set: SETofSCREENFLAG
screen-pixmap-width: CARD16
screen-pixmap-height: CARD16
screen-width: CARD16
@@ -1426,10 +1458,24 @@ dynamic changes in the display environment.
Errors: Value, Match
This works much like RRSetScreenSize followed by a sequence of
- RRSetCrtcConfig, except that the entire configuration is set
+ RRSetCrtcConfig, except that the entire configuration can be set
in a single operation, either succeeding or failing without
any partial execution.
+ If 'set' includes 'SetScreenPixmapSize', then
+ 'screen-pixmap-width' and 'screen-pixmap-height' specify the
+ new screen pixmap size.
+
+ If 'set' includes 'SetScreenSize', then 'screen-width' and
+ 'screen-height' specify the new screen size.
+
+ If 'set' includes 'SetScreenSizeInMillimeters', then
+ 'width-in-millimeters' and 'height-in-millimeters' specify
+ the new screen physical size.
+
+ If 'set' includes 'SetScreenCrtcs', then 'configs' includes
+ the list of new CRTC configurations.
+
In addition to the pre-1.4 semantics, this request adds the
ability to specific a scanout pixmap for each crtc, and
integrates the 1.4 sprite transform request as well.