summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXaver Hugl <xaver.hugl@gmail.com>2022-08-30 12:22:35 +0200
committerXaver Hugl <xaver.hugl@gmail.com>2023-05-24 14:05:16 +0200
commit5a3d5d624e08cd8fcbe7f4da594dd458f45127d0 (patch)
treea69b24bb34cc34fe10dd87002e0d25d629c61024
parent6c3a7302fcc7ecf05960ad1794c5effeda5d4945 (diff)
present: add PresentOptionAsyncMayTear
-rw-r--r--include/X11/extensions/presenttokens.h12
-rw-r--r--presentproto.txt37
2 files changed, 40 insertions, 9 deletions
diff --git a/include/X11/extensions/presenttokens.h b/include/X11/extensions/presenttokens.h
index 9211207..806cbe5 100644
--- a/include/X11/extensions/presenttokens.h
+++ b/include/X11/extensions/presenttokens.h
@@ -45,11 +45,15 @@
#define PresentOptionCopy (1 << 1)
#define PresentOptionUST (1 << 2)
#define PresentOptionSuboptimal (1 << 3)
+#define PresentOptionAsyncMayTear (1 << 4)
#define PresentAllOptions (PresentOptionAsync | \
PresentOptionCopy | \
PresentOptionUST | \
- PresentOptionSuboptimal)
+ PresentOptionSuboptimal | \
+ PresentOptionAsyncMayTear)
+
+#define PresentAllAsyncOptions (PresentOptionAsync | PresentOptionAsyncMayTear)
/* Present capabilities */
@@ -57,10 +61,14 @@
#define PresentCapabilityAsync 1
#define PresentCapabilityFence 2
#define PresentCapabilityUST 4
+#define PresentCapabilityAsyncMayTear 8
#define PresentAllCapabilities (PresentCapabilityAsync | \
PresentCapabilityFence | \
- PresentCapabilityUST)
+ PresentCapabilityUST | \
+ PresentCapabilityAsyncMayTear)
+
+#define PresentAllAsyncCapabilities (PresentCapabilityAsync | PresentCapabilityAsyncMayTear)
/* Events */
#define PresentConfigureNotify 0
diff --git a/presentproto.txt b/presentproto.txt
index fe12f41..18b7a98 100644
--- a/presentproto.txt
+++ b/presentproto.txt
@@ -57,11 +57,13 @@ PRESENTEVENTMASK { PresentConfigureNotifyMask,
PRESENTOPTION { PresentOptionAsync,
PresentOptionCopy,
PresentOptionUST,
- PresentOptionSuboptimal }
+ PresentOptionSuboptimal,
+ PresentOptionAsyncMayTear }
PRESENTCAPABILITY { PresentCapabilityAsync,
PresentCapabilityFence,
- PresentCapabilityUST }
+ PresentCapabilityUST,
+ PresentCapabilityAsyncMayTear }
PRESENTCOMPLETEKIND { PresentCompleteKindPixmap,
PresentCompleteKindMSCNotify }
@@ -215,7 +217,16 @@ The name of this extension is "Present"
If 'options' contains PresentOptionAsync, and the 'target-msc'
is less than or equal to the current msc for 'window', then
the operation will be performed as soon as possible, not
- necessarily waiting for the next vertical blank interval.
+ necessarily waiting for the next vertical blank interval. If
+ the target-crtc does not support PresentCapabilityAsyncMayTear,
+ this may result in tearing.
+
+ If the target-crtc supports PresentCapabilityAsyncMayTear,
+ 'options' contains PresentOptionAsyncMayTear, and the 'target-msc'
+ is less than or equal to the current msc for 'window', then
+ the operation will be performed as soon as possible, not
+ necessarily waiting for the next vertical blank interval, and
+ possibly resulting in tearing.
If 'options' contains PresentOptionCopy, then 'pixmap' will be
idle, and 'idle-fence' triggered as soon as the operation occurs.
@@ -315,13 +326,23 @@ The name of this extension is "Present"
'target' is a WINDOW, then the target CRTC is selected by the
X server from among the CRTCs on the screen specified by the window.
- PresentCapabilityAsync means that the target device can flip
- the scanout buffer mid-frame instead of waiting for a vertical
- blank interval. The precise latency between the flip request
- and the actual scanout transition is not defined by this
+ PresentCapabilityAsyncMayTear means that the target device may be
+ able to flip the scanout buffer mid-frame instead of waiting for
+ a vertical blank interval. The precise latency between the flip
+ request and the actual scanout transition is not defined by this
specification, but is intended to be no more than a few
scanlines.
+ If PresentCapabilityAsyncMayTear is not supported,
+ PresentCapabilityAsync means the same as
+ PresentCapabilityAsyncMayTear described above.
+
+ If PresentCapabilityAsyncMayTear is supported,
+ PresentCapabilityAsync means that even if there is already a flip
+ pending in the target device, it may be possible to replace that
+ flip before the next vertical blank interval. The scanout buffer
+ does not change mid-frame though, i.e. there is no tearing.
+
PresentCapabilityFence means that the target device can take
advantage of SyncFences in the Present operations to improve
GPU throughput. The driver must operate correctly in the
@@ -584,6 +605,7 @@ A.1 Common Types
2 PresentOptionCopy;
4 PresentOptionUST
8 PresentOptionSuboptimal
+ 16 PresentOptionAsyncMayTear
└───
┌───
@@ -591,6 +613,7 @@ A.1 Common Types
1 PresentCapabilityAsync
2 PresentCapabilityFence
4 PresentCapabilityUST
+ 8 PresentCapabilityAsyncMayTear
└───
┌───