summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-07-13 02:40:11 -0700
committerKeith Packard <keithp@keithp.com>2013-07-13 02:40:11 -0700
commitf1950e6f10a61318f22083900602d9c920d00667 (patch)
tree5a6c881177f4eb53c29bb16ca5ac0547918db7f1
parent5e7ebeb7e29be01b8046f30e93891180187e59c2 (diff)
downloadxorg-proto-presentproto-f1950e6f10a61318f22083900602d9c920d00667.tar.gz
Add NotifyMSC. Add serial numbers to Complete and MSC events
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--presentproto.h29
-rw-r--r--presentproto.txt96
-rw-r--r--presenttokens.h22
3 files changed, 123 insertions, 24 deletions
diff --git a/presentproto.h b/presentproto.h
index 01fcb67..44dc96c 100644
--- a/presentproto.h
+++ b/presentproto.h
@@ -56,17 +56,37 @@ typedef struct {
CARD8 presentReqType;
CARD16 length B16;
Window window B32;
+
Pixmap pixmap B32;
+ CARD32 serial B32;
+
Region valid B32;
Region update B32;
+
INT16 x_off B16;
INT16 y_off B16;
+ XSyncFence idle_fence B32;
+
CARD64 target_msc;
CARD64 divisor;
CARD64 remainder;
- XSyncFence idle_fence B32;
} xPresentRegionReq;
-#define sz_xPresentRegionReq 52
+#define sz_xPresentRegionReq 56
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 presentReqType;
+ CARD16 length B16;
+ Window window B32;
+
+ CARD32 serial B32;
+ CARD32 pad0 B32;
+
+ CARD64 target_msc;
+ CARD64 divisor;
+ CARD64 remainder;
+} xPresentNotifyMSCReq;
+#define sz_xPresentNotifyMSCReq 40
typedef struct {
CARD8 reqType;
@@ -115,12 +135,13 @@ typedef struct {
CARD16 pad2 B16;
CARD32 eid B32;
Window window B32;
- CARD32 pad3 B32;
+ CARD32 serial B32;
CARD64 ust;
CARD64 msc;
CARD64 sbc;
-} xPresentCompleteNotify;
+} xPresentCompleteNotify, xPresentMSCNotify;
#define sz_xPresentCompleteNotify 48
+#define sz_xPresentMSCNotify 48
typedef struct {
CARD8 type;
diff --git a/presentproto.txt b/presentproto.txt
index 0d3a380..8f64779 100644
--- a/presentproto.txt
+++ b/presentproto.txt
@@ -90,27 +90,32 @@ The name of this extension is "Present"
PresentRegion
window: WINDOW
pixmap: PIXMAP
+ serial: CARD32
valid-area: REGION or None
update-area: REGION or None
x-off, y-off: INT16
+ idle-fence: FENCE
target-msc: CARD64
divisor: CARD64
remainder: CARD64
- idle-fence: FENCE
└───
- Errors: Drawable, Pixmap, Match
+ Errors: Window, Pixmap, Match
Provides new content for the specified window, to be made
visible at the specified time (defined by 'target-msc', 'divisor'
and 'remainder').
- 'update-area' defines the subset of the window to be updated,
- or None if the whole window is to be updated.
+ 'serial' is an arbitrary client-specified value which will
+ be returned in the associated PresentCompleteNotify event so
+ that the client can associate the event and request.
'valid-area' defines the portion of 'pixmap' which contains
valid window contents, or None if the pixmap contains valid
contents for the whole window.
+ 'update-area' defines the subset of the window to be updated,
+ or None if the whole window is to be updated.
+
PresentRegion may use any region of 'pixmap' which contains
'update-area' and which is contained by 'valid-area'. In other
words, areas inside 'update-area' will be presented from
@@ -123,11 +128,6 @@ The name of this extension is "Present"
the 0,0 location of the pixmap will be presented. valid-area
and update-area are relative to the pixmap.
- If 'target-msc' is greater than the current msc for 'window',
- the presentation will occur at (or after) the 'target-msc'
- field. Otherwise, the presentation will occur after the next
- field where msc % 'divisor' == 'remainder'.
-
'idle-fence' is triggered when 'pixmap' is no longer in
use. This may be at any time following the PresentRegion
request, the contents may be immediately copied to another
@@ -135,6 +135,11 @@ The name of this extension is "Present"
pixmap may be used directly for display, in which case it will
be busy until some future PresentRegion operation.
+ If 'target-msc' is greater than the current msc for 'window',
+ the presentation will occur at (or after) the 'target-msc'
+ field. Otherwise, the presentation will occur after the next
+ field where msc % 'divisor' == 'remainder'.
+
If 'window' is destroyed before the presentation occurs, then
the presentation action will not be completed.
@@ -148,6 +153,31 @@ The name of this extension is "Present"
occur normally.
┌───
+ PresentNotifyMSC
+ window: WINDOW
+ serial: CARD32
+ target-msc: CARD64
+ divisor: CARD64
+ remainder: CARD64
+└───
+ Errors: Window
+
+ Delivers a PresentMSCNotifyEvent after time specified by
+ 'target-msc', 'divisor' and 'remainder').
+
+ 'serial' is an arbitrary client-specified value which will be
+ returned in the event so that the client can associate the
+ event and request.
+
+ If 'target-msc' is greater than the current msc for 'window',
+ the event will be delivered at (or after) the 'target-msc'
+ field. Otherwise, the event delivery will occur after the next
+ field where msc % 'divisor' == 'remainder'.
+
+ If 'window' is destroyed before the event is delivered, then
+ the event delivery will not be completed.
+
+┌───
PresentSelectInput
event-id: PRESENTEVENTID
window: WINDOW
@@ -215,15 +245,38 @@ The name of this extension is "Present"
evtype: CARD16 Present_CompleteNotify
eventID: PRESENTEVENTID
window: WINDOW
+ serial: CARD32
+ ust: CARD64
+ msc: CARD64
+ sbc: CARD64
+└───
+
+ CompleteNotify events are delivered when a PresentRegion
+ operation has completed and the specified contents are being
+ displayed. 'serial' is the value provided in the generating
+ PresentRegion request. 'sbc', 'msc' and 'ust' indicate the
+ swap count, frame count and system time when the presentation
+ actually occurred.
+
+┌───
+ PresentMSCNotify
+ type: CARD8 XGE event type (35)
+ extension: CARD8 Present extension request number
+ length: CARD16 2
+ evtype: CARD16 Present_MSCNotify
+ eventID: PRESENTEVENTID
+ window: WINDOW
+ serial: CARD32
ust: CARD64
msc: CARD64
sbc: CARD64
└───
- Notify events are delivered when a PresentRegion operation has
- completed and the specified contents are being displayed. sbc,
- msc and ust indicate the swap count, frame count and system
- time of the related PresentRegion request.
+ MSCNotify events are delivered when a PresentNotifyMSC
+ operation has completed. 'serial' is the value provided in the
+ generating PresentNotifyMSC request. 'sbc', 'msc' and 'ust'
+ indicate the swap count, frame count and system time when the
+ operation completed.
┌───
PresentRedirectNotify
@@ -235,6 +288,7 @@ The name of this extension is "Present"
event-window: WINDOW
window: WINDOW
pixmap: PIXMAP
+ serial: CARD32
valid-area: REGION
valid-rect: RECTANGLE
update-area: REGION
@@ -349,6 +403,22 @@ A.3 Protocol Events
4 CARD32 pixmap flags
└───
+┌───
+ PresentCompleteNotify
+ 1 35 XGE
+ 1 CARD8 Present extension opcode
+ 2 CARD16 sequence number
+ 4 2 length
+ 2 1 PresentCompleteNotify
+ 2 unused
+ 4 CARD32 event id
+ 4 Window window
+ 4 CARD32 serial
+ 8 CARD64 ust
+ 8 CARD64 msc
+ 8 CARD64 sbc
+└───
+
A.4 Protocol Errors
The DRI3 extension defines no errors.
diff --git a/presenttokens.h b/presenttokens.h
index ba13390..d829f11 100644
--- a/presenttokens.h
+++ b/presenttokens.h
@@ -32,16 +32,24 @@
#define X_PresentQueryVersion 0
#define X_PresentRegion 1
-#define X_PresentSelectInput 2
+#define X_PresentNotifyMSC 2
+#define X_PresentSelectInput 3
-#define PresentNumberRequests 3
+#define PresentNumberRequests 4
#define PresentConfigureNotify 0
#define PresentCompleteNotify 1
-#define PresentRedirectNotify 2
-
-#define PresentAllEvents ((1 << PresentConfigureNotify) | \
- (1 << PresentCompleteNotify) | \
- (1 << PresentRedirectNotify))
+#define PresentMSCNotify 2
+#define PresentRedirectNotify 3
+
+#define PresentConfigureNotifyMask 1
+#define PresentCompleteNotifyMask 2
+#define PresentMSCNotifyMask 4
+#define PresentRedirectNotifyMask 8
+
+#define PresentAllEvents (PresentConfigureNotifyMask | \
+ PresentCompleteNotifyMask | \
+ PresentMSCNotifyMask | \
+ PresentRedirectNotifyMask)
#endif