present: add PresentOptionAsyncMayTear

This commit is contained in:
Xaver Hugl 2022-08-30 12:22:35 +02:00
parent 6c3a7302fc
commit 5a3d5d624e
2 changed files with 40 additions and 9 deletions

View file

@ -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

View file

@ -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
└───
┌───