presentproto.txt revision 635a5eb8
117ca54c3Smrg			The Present Extension
2635a5eb8Smrg			     Version 1.4
368872e7fSmrg			      2023-06-13
417ca54c3Smrg      
517ca54c3Smrg			    Keith Packard
617ca54c3Smrg			  keithp@keithp.com
717ca54c3Smrg			  Intel Corporation
817ca54c3Smrg
917ca54c3Smrg1. Introduction
1017ca54c3Smrg
1117ca54c3SmrgThe Present extension provides a way for applications to update their
1217ca54c3Smrgwindow contents from a pixmap in a well defined fashion, synchronizing
1317ca54c3Smrgwith the display refresh and potentially using a more efficient
1417ca54c3Smrgmechanism than copying the contents of the source pixmap.
1517ca54c3Smrg
1617ca54c3Smrg1.1. Future Present extension versions
1717ca54c3Smrg
1817ca54c3SmrgThis document includes speculation about future 'redirect' support
1917ca54c3Smrgwithin the Present extension. All such information is subject to
2017ca54c3Smrgchange and is provided only as an aid to further Present development.
2117ca54c3Smrg
2217ca54c3Smrg1.2. Acknowledgments
2317ca54c3Smrg
2417ca54c3SmrgEric Anholt <eric@anholt.net>
2517ca54c3SmrgOwen Taylor <otaylor@redhat.com>
2617ca54c3SmrgJames Jones <jajones@nvidia.com>
2717ca54c3SmrgLouis-Francis Ratté-Boulianne <lfrb@collabora.com>
2817ca54c3Smrg
2917ca54c3Smrg			     ❄ ❄ ❄  ❄  ❄ ❄ ❄ 
3017ca54c3Smrg
3117ca54c3Smrg2. Data Types
3217ca54c3Smrg
3317ca54c3SmrgPRESENTEVENTID { XID }
3417ca54c3Smrg
3517ca54c3Smrg	Defines a unique event delivery target for Present
3617ca54c3Smrg	events. Multiple event IDs can be allocated to provide
3717ca54c3Smrg	multiple distinct event delivery contexts.
3817ca54c3Smrg
3917ca54c3SmrgPRESENTNOTIFY {
4017ca54c3Smrg	window: WINDOW
4117ca54c3Smrg	serial: CARD32
4217ca54c3Smrg	}
4317ca54c3Smrg
4417ca54c3Smrg	A list of these is passed to PresentPixmap; when the indicated
4517ca54c3Smrg	PresentPixmap completes, PresentCompletNotify events will be
4617ca54c3Smrg	delivered both to the PresentPixmap window/serial parameter as
4717ca54c3Smrg	well as each of the entries in the list of PRESENTNOTIFY parameter.
4817ca54c3Smrg
4917ca54c3SmrgPRESENTEVENTTYPE { PresentConfigureNotify,
5017ca54c3Smrg		   PresentCompleteNotify,
5117ca54c3Smrg		   PresentIdleNotify }
5217ca54c3Smrg
5317ca54c3SmrgPRESENTEVENTMASK { PresentConfigureNotifyMask,
5417ca54c3Smrg		   PresentCompleteNotifyMask,
5517ca54c3Smrg		   PresentIdleNotifyMask }
5617ca54c3Smrg
5717ca54c3SmrgPRESENTOPTION { PresentOptionAsync,
5817ca54c3Smrg                PresentOptionCopy,
5917ca54c3Smrg		PresentOptionUST,
6068872e7fSmrg		PresentOptionSuboptimal,
6168872e7fSmrg		PresentOptionAsyncMayTear }
6217ca54c3Smrg
6317ca54c3SmrgPRESENTCAPABILITY { PresentCapabilityAsync,
6417ca54c3Smrg		    PresentCapabilityFence,
6568872e7fSmrg		    PresentCapabilityUST,
66635a5eb8Smrg		    PresentCapabilityAsyncMayTear,
67635a5eb8Smrg		    PresentCapabilitySyncobj }
6817ca54c3Smrg
6917ca54c3SmrgPRESENTCOMPLETEKIND { PresentCompleteKindPixmap,
7017ca54c3Smrg		      PresentCompleteKindMSCNotify }
7117ca54c3Smrg
7217ca54c3SmrgPRESENTCOMPLETEMODE { PresentCompleteModeCopy,
7317ca54c3Smrg		      PresentCompleteModeFlip,
7417ca54c3Smrg		      PresentCompleteModeSkip,
7517ca54c3Smrg		      PresentCompleteModeSuboptimalCopy }
7617ca54c3Smrg
7717ca54c3SmrgThe Present extension also uses the Sync extension Fence data type to
7817ca54c3Smrgprovide synchronization for pixmaps.
7917ca54c3Smrg
8017ca54c3Smrg2.1. Data Types proposed for a later Present extension version
8117ca54c3Smrg
8217ca54c3SmrgPRESENTEVENTTYPE { ...
8317ca54c3Smrg		   PresentRedirectNotify }
8417ca54c3Smrg
8517ca54c3SmrgPRESENTEVENTMASK { ...
8617ca54c3Smrg		   PresentSubredirectNotifyMask }
8717ca54c3Smrg
8817ca54c3Smrg			     ❄ ❄ ❄  ❄  ❄ ❄ ❄ 
8917ca54c3Smrg
9017ca54c3Smrg3. Errors
9117ca54c3Smrg
9217ca54c3SmrgEventID
9317ca54c3Smrg	A value for an EventID argument does not name a defined EventID
9417ca54c3Smrg
9517ca54c3Smrg			     ❄ ❄ ❄  ❄  ❄ ❄ ❄ 
9617ca54c3Smrg
9717ca54c3Smrg5. Events
9817ca54c3Smrg
9917ca54c3SmrgConfigureNotify events inform clients about window configuration
10017ca54c3Smrgchanges which can affect the allocation of window-related buffers.
10117ca54c3Smrg
10217ca54c3SmrgCompleteNotify events inform clients about the completion of a pending
10317ca54c3SmrgPresentPixmap request.
10417ca54c3Smrg
10517ca54c3SmrgIdleNotify events inform clients when pixmaps are available for re-use.
10617ca54c3Smrg
10717ca54c3Smrg5.1. Events proposed for a later Present extension version
10817ca54c3Smrg
10917ca54c3SmrgRedirectNotify events inform clients about other clients PresentPixmap
11017ca54c3Smrgrequests.
11117ca54c3Smrg
11217ca54c3Smrg			     ❄ ❄ ❄  ❄  ❄ ❄ ❄ 
11317ca54c3Smrg
11417ca54c3Smrg6. Extension Initialization
11517ca54c3Smrg
11617ca54c3SmrgThe name of this extension is "Present"
11717ca54c3Smrg
11817ca54c3Smrg┌───
11917ca54c3Smrg    PresentQueryVersion
12017ca54c3Smrg	client-major-version:	CARD32
12117ca54c3Smrg	client-minor-version:	CARD32
12217ca54c3Smrg12317ca54c3Smrg	major-version:		CARD32
12417ca54c3Smrg	minor-version:		CARD32
12517ca54c3Smrg└───
12617ca54c3Smrg
12717ca54c3Smrg	The client sends the highest supported version to the server
12817ca54c3Smrg	and the server sends the highest version it supports, but no
12917ca54c3Smrg	higher than the requested version. Major versions changes can
13017ca54c3Smrg	introduce incompatibilities in existing functionality, minor
13117ca54c3Smrg	version changes introduce only backward compatible changes.
13217ca54c3Smrg	It is the clients responsibility to ensure that the server
13317ca54c3Smrg	supports a version which is compatible with its expectations.
13417ca54c3Smrg
13568872e7fSmrg	Backwards compatible changes include addition of new
13617ca54c3Smrg	requests.
13717ca54c3Smrg
13817ca54c3Smrg			     ❄ ❄ ❄  ❄  ❄ ❄ ❄ 
13917ca54c3Smrg
14017ca54c3Smrg7. Extension Requests
14117ca54c3Smrg
14217ca54c3Smrg┌───
14317ca54c3Smrg    PresentPixmap
14417ca54c3Smrg	window: WINDOW
14517ca54c3Smrg	pixmap: PIXMAP
14617ca54c3Smrg	serial: CARD32
14717ca54c3Smrg	valid-area: REGION or None
14817ca54c3Smrg	update-area: REGION or None
14917ca54c3Smrg	x-off, y-off: INT16
15017ca54c3Smrg	target-crtc: CRTC or None
15117ca54c3Smrg	wait-fence: FENCE
15217ca54c3Smrg	idle-fence: FENCE
15317ca54c3Smrg	options: SETofPRESENTOPTION
15417ca54c3Smrg	target-msc: CARD64
15517ca54c3Smrg	divisor: CARD64
15617ca54c3Smrg	remainder: CARD64
15717ca54c3Smrg	notifies: LISTofPRESENTNOTIFY
15817ca54c3Smrg└───
15917ca54c3Smrg	Errors: Window, Pixmap, Match
16017ca54c3Smrg
16117ca54c3Smrg	Provides new content for the specified window, to be made
16217ca54c3Smrg	visible at the specified time (defined by 'target-msc', 'divisor'
16317ca54c3Smrg	and 'remainder'). If the depth of 'pixmap' and 'window' do not
16417ca54c3Smrg	match, a Match error will be generated.
16517ca54c3Smrg
16617ca54c3Smrg	'serial' is an arbitrary client-specified value which will
16717ca54c3Smrg	be returned in the associated PresentCompleteNotify event so
16817ca54c3Smrg	that the client can associate the event and request.
16917ca54c3Smrg
17017ca54c3Smrg	'valid-area' defines the portion of 'pixmap' which contains
17117ca54c3Smrg	valid window contents, or None if the pixmap contains valid
17217ca54c3Smrg	contents for the whole window.
17317ca54c3Smrg
17417ca54c3Smrg	'update-area' defines the subset of the window to be updated,
17517ca54c3Smrg	or None if the whole window is to be updated.
17617ca54c3Smrg
17717ca54c3Smrg	PresentPixmap may use any region of 'pixmap' which contains
17817ca54c3Smrg	'update-area' and which is contained by 'valid-area'. In other
17917ca54c3Smrg	words, areas inside 'update-area' will be presented from
18017ca54c3Smrg	'pixmap', areas outside 'valid-area' will not be presented
18117ca54c3Smrg	from 'pixmap' and areas inside 'valid-area' but outside
18217ca54c3Smrg	'update-area' may or may not be presented at the discretion of
18317ca54c3Smrg	the X server.
18417ca54c3Smrg
18517ca54c3Smrg	'x-off' and 'y-off' define the location in the window where
18617ca54c3Smrg	the 0,0 location of the pixmap will be presented. valid-area
18717ca54c3Smrg	and update-area are relative to the pixmap.
18817ca54c3Smrg
18917ca54c3Smrg	PresentPixmap will block until 'wait-fence' is triggered.
19017ca54c3Smrg	
19117ca54c3Smrg	When the X server has finished using 'pixmap' for this
19217ca54c3Smrg	operation, it will send a PresentIdleNotify event and arrange
19317ca54c3Smrg	for any 'idle-fence' to be triggered. This may be at any time
19417ca54c3Smrg	following the PresentPixmap request -- the contents may be
19517ca54c3Smrg	immediately copied to another buffer, copied just in time for
19617ca54c3Smrg	the vblank interrupt or the pixmap may be used directly for
19717ca54c3Smrg	display (in which case it will be busy until some future
19817ca54c3Smrg	PresentPixmap operation).
19917ca54c3Smrg
20017ca54c3Smrg	If 'idle-fence' is not None, then the client guarantees to the
20117ca54c3Smrg	X server that it will wait for that fence to be signalled
20217ca54c3Smrg	before it uses the pixmap again. If 'idle-fence' is None, then
20317ca54c3Smrg	the X server must arrange for the pixmap to be re-usable by
20417ca54c3Smrg	the client as soon as the PresentIdleNotify event has been
20517ca54c3Smrg	received. Note that if PresentCapabilityFence is set for the
20617ca54c3Smrg	associated CRTC, then clients should use fences to improve
207d63b911fSmrg	overall system performance. If PresentCapabilityFence is not
20817ca54c3Smrg	set, then using fences offers no benefit, but also no cost.
20917ca54c3Smrg
21017ca54c3Smrg	If 'target-msc' is greater than the current msc for 'window',
21117ca54c3Smrg	the presentation will occur at (or after) the 'target-msc'
21217ca54c3Smrg	field. Otherwise, the presentation will occur after the next
21317ca54c3Smrg	field where msc % 'divisor' == 'remainder'.
21417ca54c3Smrg	
21517ca54c3Smrg	If 'target-crtc' is None, then the X server will choose a
21617ca54c3Smrg	suitable CRTC for synchronization.
21717ca54c3Smrg	
21817ca54c3Smrg	If 'options' contains PresentOptionAsync, and the 'target-msc'
21917ca54c3Smrg	is less than or equal to the current msc for 'window', then
22017ca54c3Smrg	the operation will be performed as soon as possible, not
22168872e7fSmrg	necessarily waiting for the next vertical blank interval. If
22268872e7fSmrg	the target-crtc does not support PresentCapabilityAsyncMayTear,
22368872e7fSmrg	this may result in tearing.
22468872e7fSmrg
22568872e7fSmrg	If the target-crtc supports PresentCapabilityAsyncMayTear,
22668872e7fSmrg	'options' contains PresentOptionAsyncMayTear, and the 'target-msc'
22768872e7fSmrg	is less than or equal to the current msc for 'window', then
22868872e7fSmrg	the operation will be performed as soon as possible, not
22968872e7fSmrg	necessarily waiting for the next vertical blank interval, and
23068872e7fSmrg	possibly resulting in tearing.
23117ca54c3Smrg
23217ca54c3Smrg	If 'options' contains PresentOptionCopy, then 'pixmap' will be
23317ca54c3Smrg	idle, and 'idle-fence' triggered as soon as the operation occurs.
23417ca54c3Smrg
23517ca54c3Smrg	If 'options' contains PresentOptionUST, then target-msc,
23617ca54c3Smrg	divisor and remainder will all be interpreted as UST values
23717ca54c3Smrg	instead of MSC values and the frame update will be scheduled
23817ca54c3Smrg	for the specified UST time, If the target-crtc supports
23917ca54c3Smrg	PresentCapabilityUST, then the swap time will be as close to
24017ca54c3Smrg	the target time as the driver can manage. Otherwise, the
24117ca54c3Smrg	server will take the target UST time and convert it to a
24217ca54c3Smrg	suitable target MSC value.
24317ca54c3Smrg
24417ca54c3Smrg	If 'options' contains PresentOptionSuboptimal, then the
24517ca54c3Smrg	PresentCompleteNotify event can have mode
24617ca54c3Smrg	PresentCompleteModeSuboptimalCopy as the client supports it.
24717ca54c3Smrg
24817ca54c3Smrg	After the presentation occurs, a PresentCompleteNotify event
24917ca54c3Smrg	with kind PresentCompleteKindPixmap will be generated, both to
25017ca54c3Smrg	'window' as well as all members of 'notifies'.
25117ca54c3Smrg
25217ca54c3Smrg	If 'window' is destroyed before the presentation occurs, then
25317ca54c3Smrg	the presentation action will not be completed.
25417ca54c3Smrg
25517ca54c3Smrg	PresentPixmap holds a reference to 'pixmap' until the
25617ca54c3Smrg	presentation occurs, so 'pixmap' may be immediately freed
25717ca54c3Smrg	after the request executes, even if that is before the
25817ca54c3Smrg	presentation occurs.
25917ca54c3Smrg
26017ca54c3Smrg	If 'idle-fence' is destroyed before the presentation occurs,
26117ca54c3Smrg	then idle-fence will not be signaled but the presentation will
26217ca54c3Smrg	occur normally.
26317ca54c3Smrg
26417ca54c3Smrg	If 'wait-fence' is destroyed before it becomes triggered, then
26517ca54c3Smrg	the presentation operation will no longer wait for it and will
26617ca54c3Smrg	occur when the other conditions are satisfied.
26717ca54c3Smrg
26817ca54c3Smrg┌───
26917ca54c3Smrg    PresentNotifyMSC
27017ca54c3Smrg	window: WINDOW
27117ca54c3Smrg	serial: CARD32
27217ca54c3Smrg	target-msc: CARD64
27317ca54c3Smrg	divisor: CARD64
27417ca54c3Smrg	remainder: CARD64
27517ca54c3Smrg└───
27617ca54c3Smrg	Errors: Window
27717ca54c3Smrg
27817ca54c3Smrg	Delivers a PresentCompleteNotifyEvent with kind
27917ca54c3Smrg	PresentCompleteKindNotifyMSC after the time specified by
28068872e7fSmrg	'target-msc', 'divisor' and 'remainder'.
28117ca54c3Smrg
28217ca54c3Smrg	'serial' is an arbitrary client-specified value which will be
28317ca54c3Smrg	returned in the event so that the client can associate the
28417ca54c3Smrg	event and request.
28517ca54c3Smrg
28617ca54c3Smrg	If 'target-msc' is greater than the current msc for 'window',
28717ca54c3Smrg	the event will be delivered at (or after) the 'target-msc'
28817ca54c3Smrg	field. Otherwise, the event delivery will occur after the next
28917ca54c3Smrg	field where msc % 'divisor' == 'remainder'.
29017ca54c3Smrg	
29117ca54c3Smrg	If 'window' is destroyed before the event is delivered, then
29217ca54c3Smrg	the event delivery will not be completed.
29317ca54c3Smrg
29417ca54c3Smrg┌───
29517ca54c3Smrg    PresentSelectInput
29617ca54c3Smrg	event-id: PRESENTEVENTID
29717ca54c3Smrg	window: WINDOW
29817ca54c3Smrg	eventMask: SETofPRESENTEVENT
29917ca54c3Smrg└───
30017ca54c3Smrg	Errors: Window, Value, Match, IDchoice, Access
30117ca54c3Smrg
30217ca54c3Smrg	Selects the set of Present events to be delivered for the
30317ca54c3Smrg	specified window and event context. PresentSelectInput can
30417ca54c3Smrg	create, modify, or delete event contexts. An event context is
30517ca54c3Smrg	associated with a specific window; using an existing event
30617ca54c3Smrg	context with a different window generates a Match error.
30717ca54c3Smrg
30817ca54c3Smrg	If eventContext specifies an existing event context, then if
30917ca54c3Smrg	eventMask is empty, PresentSelectInput deletes the specified
31017ca54c3Smrg	context, otherwise the specified event context is changed to
31117ca54c3Smrg	select a different set of events.
31217ca54c3Smrg
31317ca54c3Smrg	If eventContext is an unused XID, then if eventMask is empty
31417ca54c3Smrg	no operation is performed. Otherwise, a new event context is
31517ca54c3Smrg	created selecting the specified events.
31617ca54c3Smrg
31717ca54c3Smrg┌───
31817ca54c3Smrg    PresentQueryCapabilities
31917ca54c3Smrg	target:			CRTC or WINDOW
32017ca54c3Smrg32117ca54c3Smrg	capabilities:		SETofPRESENTCAPABILITY
32217ca54c3Smrg└───
32317ca54c3Smrg	Errors: Window, CRTC
32417ca54c3Smrg
32517ca54c3Smrg	Returns the supported capabilities for the target CRTC.  If
32617ca54c3Smrg	'target' is a CRTC, then it is used as the target CRTC.  If
32717ca54c3Smrg	'target' is a WINDOW, then the target CRTC is selected by the
32817ca54c3Smrg	X server from among the CRTCs on the screen specified by the window.
32917ca54c3Smrg
33068872e7fSmrg	PresentCapabilityAsyncMayTear means that the target device may be
33168872e7fSmrg	able to flip the scanout buffer mid-frame instead of waiting for
33268872e7fSmrg	a vertical blank interval. The precise latency between the flip
33368872e7fSmrg	request and the actual scanout transition is not defined by this
33417ca54c3Smrg	specification, but is intended to be no more than a few
33517ca54c3Smrg	scanlines.
33617ca54c3Smrg
33768872e7fSmrg	If PresentCapabilityAsyncMayTear is not supported,
33868872e7fSmrg	PresentCapabilityAsync means the same as
33968872e7fSmrg	PresentCapabilityAsyncMayTear described above.
34068872e7fSmrg
34168872e7fSmrg	If PresentCapabilityAsyncMayTear is supported,
34268872e7fSmrg	PresentCapabilityAsync means that even if there is already a flip
34368872e7fSmrg	pending in the target device, it may be possible to replace that
34468872e7fSmrg	flip before the next vertical blank interval. The scanout buffer
34568872e7fSmrg	does not change mid-frame though, i.e. there is no tearing.
34668872e7fSmrg
34717ca54c3Smrg	PresentCapabilityFence means that the target device can take
34817ca54c3Smrg	advantage of SyncFences in the Present operations to improve
34917ca54c3Smrg	GPU throughput. The driver must operate correctly in the
35017ca54c3Smrg	absence of fences, but may have reduced performance. Using
35117ca54c3Smrg	fences for drivers not advertising this capability should have
35217ca54c3Smrg	no performance impact.
35317ca54c3Smrg
35417ca54c3Smrg	PresentCapabilityUST means that the target device can scanout
35517ca54c3Smrg	the image at an arbitrary UST time value, and is not driven by
35617ca54c3Smrg	a periodic scanout timer. Applications specifying UST times
35717ca54c3Smrg	for PresentPixmap can expect that their image will appear to
35817ca54c3Smrg	the user within a short amount of time from that specified in
35917ca54c3Smrg	the request. The precise accuracy of the scanout time is not
36017ca54c3Smrg	defined by the extension, but is expected to be on the order
36117ca54c3Smrg	of milliseconds or less.
36217ca54c3Smrg
363635a5eb8Smrg	PresentCapabilitySyncobj means that the target device supports
364635a5eb8Smrg	explicit synchronization using timeline DRM synchronization
365635a5eb8Smrg	objects. See the PresentPixmapSynced request for details.
366635a5eb8Smrg
367635a5eb8Smrg┌───
368635a5eb8Smrg    PresentPixmapSynced
369635a5eb8Smrg	window: WINDOW
370635a5eb8Smrg	pixmap: PIXMAP
371635a5eb8Smrg	serial: CARD32
372635a5eb8Smrg	valid-area: REGION or None
373635a5eb8Smrg	update-area: REGION or None
374635a5eb8Smrg	x-off, y-off: INT16
375635a5eb8Smrg	target-crtc: CRTC or None
376635a5eb8Smrg	acquire-syncobj: SYNCOBJ or None
377635a5eb8Smrg	release-syncobj: SYNCOBJ or None
378635a5eb8Smrg	acquire-point: CARD64
379635a5eb8Smrg	release-point: CARD64
380635a5eb8Smrg	options: SETofPRESENTOPTION
381635a5eb8Smrg	target-msc: CARD64
382635a5eb8Smrg	divisor: CARD64
383635a5eb8Smrg	remainder: CARD64
384635a5eb8Smrg	notifies: LISTofPRESENTNOTIFY
385635a5eb8Smrg└───
386635a5eb8Smrg	Errors: Window, Pixmap, Match, Value
387635a5eb8Smrg
388635a5eb8Smrg	Identical to the PresentPixmap request, except that instead of the
389635a5eb8Smrg	'wait-fence' and 'idle-fence' arguments it accepts mandatory
390635a5eb8Smrg	'acquire-syncobj' and 'release-syncobj' arguments, along with
391635a5eb8Smrg	corresponding acquire and release points, to be used for explicit
392635a5eb8Smrg	timeline-based GPU synchronization. The 'acquire-point' and
393635a5eb8Smrg	'release-point' are assumed to correspond to timeline points on the
394635a5eb8Smrg	respective DRM syncobjs.
395635a5eb8Smrg
396635a5eb8Smrg	The contents of the Pixmap will not be accessed by the server until the
397635a5eb8Smrg	'acquire-point' on the acquire timeline has been signaled by the
398635a5eb8Smrg	client. The fence need not be submitted at the time the
399635a5eb8Smrg	PresentPixmapSynced request is issued.
400635a5eb8Smrg
401635a5eb8Smrg	Once the 'release-point' on the release timeline has been signaled, the
402635a5eb8Smrg	client may assume that no further GPU or CPU access to the Pixmap by
403635a5eb8Smrg	the server will occur as part of the originating PresentPixmapSynced
404635a5eb8Smrg	request.  Note that this is a stronger guarantee than what is provided
405635a5eb8Smrg	by the 'idle-fence' argument of the PresentPixmap request or the
406635a5eb8Smrg	delivery of a PresentIdleNotify event, as those do not necessarily
407635a5eb8Smrg	imply that the Pixmap is idle on the GPU.
408635a5eb8Smrg
409635a5eb8Smrg	The server may wait for the acquire point and signal the release point
410635a5eb8Smrg	itself, as will typically happen if the request is executed by copying
411635a5eb8Smrg	the Pixmap's contents. Alternatively, it may forward the timelines,
412635a5eb8Smrg	acquire, and release points to an output sink directly, provided that
413635a5eb8Smrg	sink also supports explicit synchronization using DRM syncobjs.
414635a5eb8Smrg
415635a5eb8Smrg	The server may signal the release point without waiting for the acquire
416635a5eb8Smrg	point if the Pixmap's contents are never accessed while servicing the
417635a5eb8Smrg	request. This may happen, for example, if a request is discarded due to
418635a5eb8Smrg	it being fully occluded by a later request.
419635a5eb8Smrg
420635a5eb8Smrg	Beware that, if multiple Pixmaps are presented using the same release
421635a5eb8Smrg	timeline, the server makes no guarantees on the order in which the
422635a5eb8Smrg	release points will be signaled. Of particular concern is that, if the
423635a5eb8Smrg	later of the two release points is signaled before the earlier one, it
424635a5eb8Smrg	may appear to the client as though the Pixmap with the earlier release
425635a5eb8Smrg	point has been released before the server has finished its access to
426635a5eb8Smrg	it. Therefore, in general, clients are strongly advised to avoid using
427635a5eb8Smrg	the same release timeline with different Pixmaps.
428635a5eb8Smrg
429635a5eb8Smrg	If the server does not support PresentCapabilitySyncobj, a Value error
430635a5eb8Smrg	is generated.
431635a5eb8Smrg
432635a5eb8Smrg	If either 'acquire-syncobj' or 'release-syncobj' are None or do not
433635a5eb8Smrg	refer to previously imported syncobjs, a Value error is generated.
434635a5eb8Smrg
435635a5eb8Smrg	If 'acquire-point' or 'release-point' is zero, a Value error is
436635a5eb8Smrg	generated.
437635a5eb8Smrg
438635a5eb8Smrg	If 'acquire-syncobj' is equal to 'release-syncobj' and 'acquire-point'
439635a5eb8Smrg	is greater than or equal to 'release-point', a Value error is
440635a5eb8Smrg	generated.
441635a5eb8Smrg
44217ca54c3Smrg
44317ca54c3Smrg7.1 Requests proposed for a later Present extension version
44417ca54c3Smrg
44517ca54c3Smrg	These are not part of the standard and represent future plans
44617ca54c3Smrg	for the Present extension.
44717ca54c3Smrg
44817ca54c3Smrg┌───
44917ca54c3Smrg    PresentSelectInput
45017ca54c3Smrg    ...
45117ca54c3Smrg└───
45217ca54c3Smrg	...
45317ca54c3Smrg
45417ca54c3Smrg	Specifying PresentSubredirectNotify Mask causes PresentPixmap
45517ca54c3Smrg	requests on any child of 'window' from other clients to
45617ca54c3Smrg	generate PresentRedirectNotify events to 'window' instead of
45717ca54c3Smrg	actually performing the operation. However, only one client at
45817ca54c3Smrg	a time can select for PresentRedirect on a window. An attempt
45917ca54c3Smrg	to violate this restriction results in an Access error.
46017ca54c3Smrg
46117ca54c3Smrg			     ❄ ❄ ❄  ❄  ❄ ❄ ❄ 
46217ca54c3Smrg
46317ca54c3Smrg8. Extension Events
46417ca54c3Smrg
46517ca54c3Smrg┌───
46617ca54c3Smrg    PresentConfigureNotify
46717ca54c3Smrg	type: CARD8			XGE event type (35)
46817ca54c3Smrg	extension: CARD8		Present extension request number
46917ca54c3Smrg	sequence-number: CARD16
47017ca54c3Smrg	length: CARD32			2
47117ca54c3Smrg	evtype: CARD16			Present_ConfigureNotify
47217ca54c3Smrg	eventID: PRESENTEVENTID
47317ca54c3Smrg	window: WINDOW
47417ca54c3Smrg	x: INT16
47517ca54c3Smrg	y: INT16
47617ca54c3Smrg	width: CARD16
47717ca54c3Smrg	height: CARD16
47817ca54c3Smrg	off_x: INT16
47917ca54c3Smrg	off_y: INT16
48017ca54c3Smrg	pixmap_width: CARD16
48117ca54c3Smrg	pixmap_height: CARD16
48217ca54c3Smrg	pixmap_flags: CARD32
48317ca54c3Smrg└───
48417ca54c3Smrg
48517ca54c3Smrg	PresentConfigureNotify events are sent when the window
48617ca54c3Smrg	configuration changes if PresentSelectInput has requested
48717ca54c3Smrg	it. PresentConfigureNotify events are XGE events and so do not
48817ca54c3Smrg	have a unique event type.
48917ca54c3Smrg
49017ca54c3Smrg	'x' and 'y' are the parent-relative location of 'window'. 
49117ca54c3Smrg
49217ca54c3Smrg┌───
49317ca54c3Smrg    PresentCompleteNotify
49417ca54c3Smrg	type: CARD8			XGE event type (35)
49517ca54c3Smrg	extension: CARD8		Present extension request number
49617ca54c3Smrg	sequence-number: CARD16
49717ca54c3Smrg	length: CARD32			2
49817ca54c3Smrg	evtype: PRESENTEVENTTYPE	PresentCompleteNotify
49917ca54c3Smrg	eventID: PRESENTEVENTID
50017ca54c3Smrg	window: WINDOW
50117ca54c3Smrg	kind: PRESENTCOMPLETEKIND
50217ca54c3Smrg	mode: PRESENTCOMPLETEMODE
50317ca54c3Smrg	serial: CARD32
50417ca54c3Smrg	ust: CARD64
50517ca54c3Smrg	msc: CARD64
50617ca54c3Smrg└───
50717ca54c3Smrg
50817ca54c3Smrg	CompleteNotify events are delivered when a PresentPixmap or
50917ca54c3Smrg	PresentNotifyMSC operation has completed.
51017ca54c3Smrg
51117ca54c3Smrg	'kind' is PresentCompleteKindPixmap when generated by a
51217ca54c3Smrg	PresentPixmap operation completion or
51317ca54c3Smrg	PresentCompleteKindNotifyMsc when generated by a
51417ca54c3Smrg	PresentNotifyMSC operation completion.
51517ca54c3Smrg
51617ca54c3Smrg	'mode' is PresentCompleteModeCopy when the source pixmap
51717ca54c3Smrg	contents are taken from the pixmap and the pixmap is idle
51817ca54c3Smrg	immediately after the presentation completes. 'mode' is
51917ca54c3Smrg	PresentCompleteModeSuboptimalCopy when the source pixmap
52017ca54c3Smrg	contents are copied but it would be possible to flip the
52117ca54c3Smrg	pixmap if the buffer format/modifier was different (options
52217ca54c3Smrg	given to PresentPixmap must contain PresentOptionSuboptimal).
52317ca54c3Smrg	'mode' is PresentCompleteModeFlip when the pixmap remains in-use
52417ca54c3Smrg	even after the presentation completes. It will become idle no
52517ca54c3Smrg	later than when the next PresentPixmap operation targeting the
52617ca54c3Smrg	same window by any client completes. If the presentation
52717ca54c3Smrg	operation was skipped because some later operation made it
52817ca54c3Smrg	irrelevant, then 'mode' will be PresentCompleteModeSkip.
52917ca54c3Smrg
53017ca54c3Smrg	'serial' is the value provided in the generating PresentPixmap
53117ca54c3Smrg	request.
53217ca54c3Smrg
53317ca54c3Smrg	'msc' and 'ust' indicate the frame count and system time when
53417ca54c3Smrg	the presentation actually occurred.
53517ca54c3Smrg
53617ca54c3Smrg┌───
53717ca54c3Smrg    PresentIdleNotify
53817ca54c3Smrg	type: CARD8			XGE event type (35)
53917ca54c3Smrg	extension: CARD8		Present extension request number
54017ca54c3Smrg	sequence-number: CARD16
54117ca54c3Smrg	length: CARD32			0
54217ca54c3Smrg	evtype: PRESENTEVENTTYPE	PresentIdleNotify
54317ca54c3Smrg	eventID: PRESENTEVENTID
54417ca54c3Smrg	window: WINDOW
54517ca54c3Smrg	serial: CARD32
54617ca54c3Smrg	pixmap: PIXMAP
54717ca54c3Smrg	idle-fence: FENCE
54817ca54c3Smrg└───
54917ca54c3Smrg
55017ca54c3Smrg	IdleNotify events are delivered when a pixmap used in a
55117ca54c3Smrg	PresentPixmap operation may be re-used by the client.
55217ca54c3Smrg
55317ca54c3Smrg	'window' is the window from the PresentPixmap to which this
55417ca54c3Smrg	event is delivered.
55517ca54c3Smrg
55617ca54c3Smrg	'serial' is the value provided in the associated PresentPixmap
55717ca54c3Smrg	request.
55817ca54c3Smrg
55917ca54c3Smrg	'pixmap' is the pixmap which is ready for re-use.
56017ca54c3Smrg
56117ca54c3Smrg	'idle-fence' is the fence which was provided in the
56217ca54c3Smrg	originating PresentPixmap request and is used to synchronize
56317ca54c3Smrg	rendering between the client and the X server's use of the
56417ca54c3Smrg	buffer. If not None, then the client must wait for the fence
56517ca54c3Smrg	to be signaled before using the pixmap.
56617ca54c3Smrg
56717ca54c3Smrg8.1. Extension Events proposed for a later Present extension version
56817ca54c3Smrg
56917ca54c3Smrg┌───
57017ca54c3Smrg    PresentRedirectNotify
57117ca54c3Smrg	type: CARD8			XGE event type (35)
57217ca54c3Smrg	extension: CARD8		Present extension request number
57317ca54c3Smrg	sequence-number: CARD16
57417ca54c3Smrg	length: CARD32			17 + 2 n
57517ca54c3Smrg	evtype: CARD16			Present_RedirectNotify
57617ca54c3Smrg	update-window: BOOL
57717ca54c3Smrg
57817ca54c3Smrg	eventID: PRESENTEVENTID
57917ca54c3Smrg	event-window: WINDOW
58017ca54c3Smrg	window: WINDOW
58117ca54c3Smrg	pixmap: PIXMAP
58217ca54c3Smrg	serial: CARD32
58317ca54c3Smrg
58417ca54c3Smrg	valid-area: REGION
58517ca54c3Smrg	update-area: REGION
58617ca54c3Smrg	valid-rect: RECTANGLE
58717ca54c3Smrg	update-rect: RECTANGLE
58817ca54c3Smrg	x-off, y-off: INT16
58917ca54c3Smrg	target-crtc: CRTC
59017ca54c3Smrg	wait-fence: FENCE
59117ca54c3Smrg	idle-fence: FENCE
59217ca54c3Smrg	options: SETofPRESENTOPTION
59317ca54c3Smrg	target-msc: CARD64
59417ca54c3Smrg	divisor: CARD64
59517ca54c3Smrg	remainder: CARD64
59617ca54c3Smrg	notifies: LISTofPRESENTNOTIFY
59717ca54c3Smrg└───
59817ca54c3Smrg
59917ca54c3Smrg	RedirectNotify events are delivered when the client has
60017ca54c3Smrg	selected for SubredirectNotify the parent of the target
60117ca54c3Smrg	window. All of the values provided to the PresentPixmap
60217ca54c3Smrg	request are provided. If the client simply passes these
60317ca54c3Smrg	parameters back to the X server, the effect will be as if the
60417ca54c3Smrg	original client executed the request.
60517ca54c3Smrg
60617ca54c3Smrg	If 'update-window' is TRUE, then there are clients who have
60717ca54c3Smrg	requested composite automatic redirect on the window and who
60817ca54c3Smrg	presumably expect the window buffer to eventually contain
60917ca54c3Smrg	the application provided contents. The compositing manager
61017ca54c3Smrg	should at least occasionally update the window buffer with
61117ca54c3Smrg	suitable contents. The precise update interval is left to the
61217ca54c3Smrg	discretion of the client receiving this event.
61317ca54c3Smrg
61417ca54c3Smrg			     ❄ ❄ ❄  ❄  ❄ ❄ ❄
61517ca54c3Smrg
61617ca54c3Smrg9. Extension Versioning
61717ca54c3Smrg
61817ca54c3Smrg	1.0: First published version
61917ca54c3Smrg
62017ca54c3Smrg	1.2: Added PresentCompleteModeSuboptimalCopy flag and
62117ca54c3Smrg	     PresentOptionSuboptimal option
62217ca54c3Smrg
62317ca54c3Smrg			     ❄ ❄ ❄  ❄  ❄ ❄ ❄
62417ca54c3Smrg
62517ca54c3Smrg
62617ca54c3Smrg10. Relationship with other extensions
62717ca54c3Smrg
62817ca54c3SmrgAs an extension designed to support other extensions, there is
62917ca54c3Smrgnaturally some interactions with other extensions.
63017ca54c3Smrg
63117ca54c3Smrg10.1 GLX
63217ca54c3Smrg
63317ca54c3SmrgGLX is both an application interface and an X extension. OpenGL
63417ca54c3Smrgapplications using the GLX API will use the GLX extension and may use
63517ca54c3Smrgthe Present extension to display application contents.
63617ca54c3Smrg
63717ca54c3Smrg10.2 DRI3
63817ca54c3Smrg
63917ca54c3SmrgThe DRI3 extension provides a way to share direct rendered pixel data
64017ca54c3Smrgwith the X server as X pixmaps. When used in conjunction with Present,
64117ca54c3Smrgthey provide a complete direct rendering solution for OpenGL or other
64217ca54c3SmrgAPIs.
64317ca54c3Smrg
64417ca54c3Smrg10.3 DRI2
64517ca54c3Smrg
64617ca54c3SmrgPresent provides similar functionality to the DRI2SwapBuffers and
64717ca54c3Smrgrequests, however Present uses X pixmaps to refer to the new window
64817ca54c3Smrgcontents instead of the DRI2 buffer attachments.
64917ca54c3Smrg
65068872e7fSmrgPresent and DRI3 are designed in conjunction to replace DRI2.
65117ca54c3Smrg
65217ca54c3Smrg10.4 XvMC / Xv
65317ca54c3Smrg
65417ca54c3SmrgIt might be nice to be able to use YUV formatted objects as Present
65517ca54c3Smrgsources.
65617ca54c3Smrg
65717ca54c3Smrg			     ❄ ❄ ❄  ❄  ❄ ❄ ❄
65817ca54c3Smrg
65917ca54c3SmrgAppendix A. Protocol Encoding
66017ca54c3Smrg
66117ca54c3SmrgSyntactic Conventions
66217ca54c3Smrg
66317ca54c3SmrgThis document uses the same syntactic conventions as the core X
66417ca54c3Smrgprotocol encoding document.
66517ca54c3Smrg
66617ca54c3Smrg
66717ca54c3SmrgA.1 Common Types
66817ca54c3Smrg┌───
66917ca54c3Smrg    PresentEventType
67017ca54c3Smrg	0	PresentConfigureNotify
67117ca54c3Smrg	1	PresentCompleteNotify
67217ca54c3Smrg	2	PresentIdleNotify
67317ca54c3Smrg└───
67417ca54c3Smrg
67517ca54c3Smrg┌───
67617ca54c3Smrg    PresentEventMask
67717ca54c3Smrg	1	PresentConfigureNotifyMask
67817ca54c3Smrg	2	PresentCompleteNotifyMask
67917ca54c3Smrg	4	PresentIdleNotifyMask
68017ca54c3Smrg└───
68117ca54c3Smrg
68217ca54c3Smrg┌───
68317ca54c3Smrg    PresentOption
68417ca54c3Smrg	1	PresentOptionAsync
68517ca54c3Smrg	2	PresentOptionCopy;
68617ca54c3Smrg	4	PresentOptionUST
68717ca54c3Smrg	8	PresentOptionSuboptimal
68868872e7fSmrg	16	PresentOptionAsyncMayTear
68917ca54c3Smrg└───
69017ca54c3Smrg
69117ca54c3Smrg┌───
69217ca54c3Smrg    PresentCapability
69317ca54c3Smrg	1	PresentCapabilityAsync
69417ca54c3Smrg	2	PresentCapabilityFence
69517ca54c3Smrg	4	PresentCapabilityUST
69668872e7fSmrg	8	PresentCapabilityAsyncMayTear
69717ca54c3Smrg└───
69817ca54c3Smrg
69917ca54c3Smrg┌───
70017ca54c3Smrg    PresentCompleteKind
70117ca54c3Smrg	0	PresentCompleteKindPixmap
70217ca54c3Smrg	1	PresentCompleteKindMSCNotify
70317ca54c3Smrg└───
70417ca54c3Smrg
70517ca54c3Smrg┌───
70617ca54c3Smrg    PresentCompleteMode
70717ca54c3Smrg	0	PresentCompleteModeCopy
70817ca54c3Smrg	1	PresentCompleteModeFlip
70917ca54c3Smrg	2	PresentCompleteModeSkip
71017ca54c3Smrg	3	PresentCompleteModeSuboptimalCopy
71117ca54c3Smrg└───
71217ca54c3Smrg
71317ca54c3Smrg┌───
71417ca54c3Smrg    PresentNotify
71517ca54c3Smrg	4	Window			window
71617ca54c3Smrg	4	CARD32			serial
71717ca54c3Smrg└───
71817ca54c3Smrg
71917ca54c3SmrgA.1.1 Common Types proposed for a later Present extension version
72017ca54c3Smrg
72117ca54c3Smrg┌───
72217ca54c3Smrg    PresentEventType
72317ca54c3Smrg	...
72417ca54c3Smrg	3	PresentRedirectNotify
72517ca54c3Smrg└───
72617ca54c3Smrg
72717ca54c3Smrg┌───
72817ca54c3Smrg    PresentEventMask
72917ca54c3Smrg	...
73017ca54c3Smrg	8	PresentSubredirectNotifyMask
73117ca54c3Smrg└───
73217ca54c3Smrg
73317ca54c3SmrgA.2 Protocol Requests
73417ca54c3Smrg
73517ca54c3Smrg┌───
73617ca54c3Smrg    PresentQueryVersion
73717ca54c3Smrg	1	CARD8			major opcode
73817ca54c3Smrg	1	0			Present opcode
73917ca54c3Smrg	2	3			length
74017ca54c3Smrg	4	CARD32			major version
74117ca54c3Smrg	4	CARD32			minor version
74217ca54c3Smrg74317ca54c3Smrg	1	1			Reply
74417ca54c3Smrg        1				unused
74517ca54c3Smrg	2	CARD16			sequence number
74617ca54c3Smrg	4	0			reply length
74717ca54c3Smrg	4	CARD32			major version
74817ca54c3Smrg        4	CARD32			minor version
74917ca54c3Smrg	16				unused	
75017ca54c3Smrg└───
75117ca54c3Smrg
75217ca54c3Smrg┌───
75317ca54c3Smrg    PresentPixmap
75417ca54c3Smrg	1	CARD8			major opcode
75517ca54c3Smrg	1	1			Present opcode
75617ca54c3Smrg	2	18+2n			length
75717ca54c3Smrg	4	Window			window
75817ca54c3Smrg	4	Pixmap			pixmap
75917ca54c3Smrg	4	CARD32			serial
76017ca54c3Smrg	4	Region			valid-area
76117ca54c3Smrg	4	Region			update-area
76217ca54c3Smrg	2	INT16			x-off
76317ca54c3Smrg	2	INT16			y-off
76417ca54c3Smrg	4	CRTC			target-crtc
76517ca54c3Smrg	4	SyncFence		wait-fence
76617ca54c3Smrg	4	SyncFence		idle-fence
76717ca54c3Smrg	4	CARD32			options
76817ca54c3Smrg	4				unused
76917ca54c3Smrg	8	CARD64			target-msc
77017ca54c3Smrg	8	CARD64			divisor
77117ca54c3Smrg	8	CARD64			remainder
77217ca54c3Smrg	8n	LISTofPresentNotify	notifies
77317ca54c3Smrg└───
77417ca54c3Smrg
77517ca54c3Smrg┌───
77617ca54c3Smrg    PresentNotifyMSC
77717ca54c3Smrg	1	CARD8			major opcode
77817ca54c3Smrg	1	2			Present opcode
77917ca54c3Smrg	2	10			length
78017ca54c3Smrg	4	Window			window
78117ca54c3Smrg	4	CARD32			serial
78217ca54c3Smrg	4				unused
78317ca54c3Smrg	8	CARD64			target-msc
78417ca54c3Smrg	8	CARD64			divisor
78517ca54c3Smrg	8	CARD64			remainder
78617ca54c3Smrg└───
78717ca54c3Smrg
78817ca54c3Smrg┌───
78917ca54c3Smrg    PresentSelectInput
79017ca54c3Smrg	1	CARD8			major opcode
79117ca54c3Smrg	1	3			Present opcode
79217ca54c3Smrg	2	4			length
79317ca54c3Smrg	4	EventID			event-id
79417ca54c3Smrg	4	Window			window
79517ca54c3Smrg	4	SETofPRESENTEVENTMASK	event-mask
79617ca54c3Smrg└───
79717ca54c3Smrg
79817ca54c3Smrg┌───
79917ca54c3Smrg    PresentQueryCapabilities
80017ca54c3Smrg	1	CARD8			major opcode
80117ca54c3Smrg	1	4			Present opcode
80217ca54c3Smrg	2	2			length
80317ca54c3Smrg	4	CRTC or Window		target
80417ca54c3Smrg80517ca54c3Smrg	1	1			Reply
80617ca54c3Smrg        1				unused
80717ca54c3Smrg	2	CARD16			sequence number
80817ca54c3Smrg	4	0			reply length
80917ca54c3Smrg	4	SETofPRESENTCAPABILITY	capabilities
81017ca54c3Smrg└───
81117ca54c3Smrg
812635a5eb8Smrg┌───
813635a5eb8Smrg    PresentPixmapSynced
814635a5eb8Smrg	1	CARD8			major opcode
815635a5eb8Smrg	1	5			Present opcode
816635a5eb8Smrg	2	22+2n			length
817635a5eb8Smrg	4	Window			window
818635a5eb8Smrg	4	Pixmap			pixmap
819635a5eb8Smrg	4	CARD32			serial
820635a5eb8Smrg	4	Region			valid-area
821635a5eb8Smrg	4	Region			update-area
822635a5eb8Smrg	2	INT16			x-off
823635a5eb8Smrg	2	INT16			y-off
824635a5eb8Smrg	4	CRTC			target-crtc
825635a5eb8Smrg	4	SYNCOBJ			acquire-syncobj
826635a5eb8Smrg	4	SYNCOBJ			release-syncobj
827635a5eb8Smrg	8	CARD64			acquire-point
828635a5eb8Smrg	8	CARD64			release-point
829635a5eb8Smrg	4	CARD32			options
830635a5eb8Smrg	4				unused
831635a5eb8Smrg	8	CARD64			target-msc
832635a5eb8Smrg	8	CARD64			divisor
833635a5eb8Smrg	8	CARD64			remainder
834635a5eb8Smrg	8n	LISTofPresentNotify	notifies
835635a5eb8Smrg└───
836635a5eb8Smrg
83717ca54c3SmrgA.3 Protocol Events
83817ca54c3Smrg
83917ca54c3Smrg┌───
84017ca54c3Smrg    PresentConfigureNotify
84117ca54c3Smrg	1	35			XGE
84217ca54c3Smrg	1	CARD8			Present extension opcode
84317ca54c3Smrg	2	CARD16			sequence number
84417ca54c3Smrg	4	2			length
84517ca54c3Smrg	2	0			PresentConfigureNotify
84617ca54c3Smrg	2				unused
84717ca54c3Smrg	4	CARD32			event id
84817ca54c3Smrg	4	Window			window
84917ca54c3Smrg	2	INT16			x
85017ca54c3Smrg	2	INT16			y
85117ca54c3Smrg	2	CARD16			width
85217ca54c3Smrg	2	CARD16			height
85317ca54c3Smrg	2	INT16			off x
85417ca54c3Smrg	2	INT16			off y
85517ca54c3Smrg
85617ca54c3Smrg	2	CARD16			pixmap width
85717ca54c3Smrg	2	CARD16			pixmap height
85817ca54c3Smrg	4	CARD32			pixmap flags
85917ca54c3Smrg└───
86017ca54c3Smrg
86117ca54c3Smrg┌───
86217ca54c3Smrg    PresentCompleteNotify
86317ca54c3Smrg	1	35			XGE
86417ca54c3Smrg	1	CARD8			Present extension opcode
86517ca54c3Smrg	2	CARD16			sequence number
86617ca54c3Smrg	4	2			length
86717ca54c3Smrg	2	1			PresentCompleteNotify
86817ca54c3Smrg	1	CARD8			kind
86917ca54c3Smrg	1	CARD8			mode
87017ca54c3Smrg	4	CARD32			event id
87117ca54c3Smrg	4	Window			window
87217ca54c3Smrg	4	CARD32			serial
87317ca54c3Smrg	8	CARD64			ust
87417ca54c3Smrg
87517ca54c3Smrg	8	CARD64			msc
87617ca54c3Smrg└───
87717ca54c3Smrg
87817ca54c3Smrg┌───
87917ca54c3Smrg    PresentIdleNotify
88017ca54c3Smrg	1	35			XGE
88117ca54c3Smrg	1	CARD8			Present extension opcode
88217ca54c3Smrg	2	CARD16			sequence number
88317ca54c3Smrg	4	0			length
88417ca54c3Smrg	2	2			PresentIdleNotify
88517ca54c3Smrg	2				unused
88617ca54c3Smrg	4	CARD32			event id
88717ca54c3Smrg	4	Window			window
88817ca54c3Smrg	4	CARD32			serial
88917ca54c3Smrg	4	Pixmap			pixmap
89017ca54c3Smrg	4	SyncFence		idle-fence
89117ca54c3Smrg└───
89217ca54c3Smrg
89317ca54c3SmrgA.3.1 Protocol Events proposed for later Present extension version
89417ca54c3Smrg
89517ca54c3Smrg┌───
89617ca54c3Smrg    PresentRedirectNotify
89717ca54c3Smrg	1	35			XGE
89817ca54c3Smrg	1	CARD8			Present extension opcode
89917ca54c3Smrg	2	CARD16			sequence number
90017ca54c3Smrg	4	18+2n			length
90117ca54c3Smrg	2	3			PresentRedirectNotify
90217ca54c3Smrg	1	BOOL			update-window
90317ca54c3Smrg	1				unused
90417ca54c3Smrg	4	CARD32			event id
90517ca54c3Smrg	4	Window			event-window
90617ca54c3Smrg	4	Window			window
90717ca54c3Smrg	4	Pixmap			pixmap
90817ca54c3Smrg	4	CARD32			serial
90917ca54c3Smrg
91017ca54c3Smrg	4	Region			valid-area
91117ca54c3Smrg	4	Region			update-area
91217ca54c3Smrg	8	Rectangle		valid-rect
91317ca54c3Smrg	8	Rectangle		update-rect
91417ca54c3Smrg	2	INT16			x-off
91517ca54c3Smrg	2	INT16			y-off
91617ca54c3Smrg	4	CRTC			target-crtc
91717ca54c3Smrg	4	SyncFence		wait-fence
91817ca54c3Smrg	4	SyncFence		idle-fence
91917ca54c3Smrg	4	CARD32			options
92017ca54c3Smrg	4				unused
92117ca54c3Smrg	8	CARD64			target-msc
92217ca54c3Smrg	8	CARD64			divisor
92317ca54c3Smrg	8	CARD64			remainder
92417ca54c3Smrg	8n	LISTofPRESENTNOTIFY	notifies
92517ca54c3Smrg└───
92617ca54c3Smrg
92717ca54c3SmrgA.4 Protocol Errors
92817ca54c3Smrg
92917ca54c3SmrgThe Present extension defines no errors.
93017ca54c3Smrg
93117ca54c3Smrg			     ❄ ❄ ❄  ❄  ❄ ❄ ❄
932