[RFC presentproto v3 02/11] Add capability and option for IdleFence

Louis-Francis Ratté-Boulianne lfrb at collabora.com
Mon Nov 6 21:42:51 UTC 2017


If the server has that capability, and the client is using this
option, the idle fence given to PresentPixamp can be modified to
point to an out-fence created by the driver.

Bump version to 1.2.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb at collabora.com>
---
 configure.ac     |  2 +-
 presentproto.txt | 27 +++++++++++++++++++++++----
 presenttokens.h  | 10 +++++++---
 3 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index ff3fdb8..0662aff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 AC_PREREQ([2.60])
-AC_INIT([PresentProto], [1.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AC_INIT([PresentProto], [1.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 
 # Require xorg-macros: XORG_DEFAULT_OPTIONS
diff --git a/presentproto.txt b/presentproto.txt
index d6fcd10..35df35d 100644
--- a/presentproto.txt
+++ b/presentproto.txt
@@ -1,5 +1,5 @@
 			The Present Extension
-			     Version 1.1
+			     Version 1.2
 			      2017-09-27
       
 			    Keith Packard
@@ -57,11 +57,13 @@ PRESENTEVENTMASK { PresentConfigureNotifyMask,
 PRESENTOPTION { PresentOptionAsync,
                 PresentOptionCopy,
 		PresentOptionUST,
-		PresentOptionSuboptimal }
+		PresentOptionSuboptimal,
+		PresentOptionIdleFence }
 
 PRESENTCAPABILITY { PresentCapabilityAsync,
 		    PresentCapabilityFence,
-		    PresentCapabilityUST }
+		    PresentCapabilityUST,
+		    PresentCapabilityIdleFence }
 
 PRESENTCOMPLETEKIND { PresentCompleteKindPixmap,
 		      PresentCompleteKindMSCNotify }
@@ -203,6 +205,11 @@ The name of this extension is "Present"
 	associated CRTC, then clients should use fences to improve
 	overall systme performance. If PresentCapabilityFence is not
 	set, then using fences offers no benefit, but also no cost.
+	If PresentOptionIdleFence is part of the options flags, the
+	'idle-fence' should be used as a DMA out-fence and will be
+	created by the X server. The client is then responsible to
+	fetch the DMA fence fd once the PresentIdleNotify event has
+	been received.
 
 	If 'target-msc' is greater than the current msc for 'window',
 	the presentation will occur at (or after) the 'target-msc'
@@ -338,6 +345,13 @@ The name of this extension is "Present"
 	defined by the extension, but is expected to be on the order
 	of milliseconds or less.
 
+	PresentCapabilityIdleFence means that the target device can
+	handle idle fence backed by DMA fences. Clients calling
+	PresentPixmap with the PresentOptionIdleFence flag are expected
+	to provide an new id as the 'idle-fence'. If the device can
+	provide an out-fence, it will be sent as part of the
+	PresentIdleNotify event.
+
 
 7.1 Requests proposed for a later Present extension version
 
@@ -519,6 +533,8 @@ The name of this extension is "Present"
 	1.1: Added PresentCompleteModeSuboptimalCopy flag and
 	     PresentOptionSuboptimal option
 
+	1.2: Added CapabilityIdleFence and OptionIdleFence
+
 			     ❄ ❄ ❄  ❄  ❄ ❄ ❄
 
 
@@ -538,7 +554,8 @@ the Present extension to display application contents.
 The DRI3 extension provides a way to share direct rendered pixel data
 with the X server as X pixmaps. When used in conjunction with Present,
 they provide a complete direct rendering solution for OpenGL or other
-APIs.
+APIs. Support for DMA fences from DRI3 is needed to properly handle
+PresentCapabilityIdleFence and PresentOptionIdleFence.
 
 10.3 DRI2
 
@@ -584,6 +601,7 @@ A.1 Common Types
 	2	PresentOptionCopy;
 	4	PresentOptionUST
 	8	PresentOptionSuboptimal
+	16	PresentOptionIdleFence
 └───
 
 ┌───
@@ -591,6 +609,7 @@ A.1 Common Types
 	1	PresentCapabilityAsync
 	2	PresentCapabilityFence
 	4	PresentCapabilityUST
+	8	PresentCapabilityIdleFence
 └───
 
 ┌───
diff --git a/presenttokens.h b/presenttokens.h
index 10ac5a7..4e6a9c6 100644
--- a/presenttokens.h
+++ b/presenttokens.h
@@ -25,7 +25,7 @@
 
 #define PRESENT_NAME			"Present"
 #define PRESENT_MAJOR			1
-#define PRESENT_MINOR			1
+#define PRESENT_MINOR			2
 
 #define PresentNumberErrors		0
 #define PresentNumberEvents		0
@@ -45,11 +45,13 @@
 #define PresentOptionCopy               (1 << 1)
 #define PresentOptionUST                (1 << 2)
 #define PresentOptionSuboptimal         (1 << 3)
+#define PresentOptionIdleFence          (1 << 4)
 
 #define PresentAllOptions       (PresentOptionAsync | \
                                  PresentOptionCopy | \
                                  PresentOptionUST | \
-                                 PresentOptionSuboptimal)
+                                 PresentOptionSuboptimal | \
+                                 PresentOptionIdleFence)
 
 /* Present capabilities */
 
@@ -57,10 +59,12 @@
 #define PresentCapabilityAsync          1
 #define PresentCapabilityFence          2
 #define PresentCapabilityUST            4
+#define PresentCapabilityIdleFence      8
 
 #define PresentAllCapabilities  (PresentCapabilityAsync | \
                                  PresentCapabilityFence | \
-                                 PresentCapabilityUST)
+                                 PresentCapabilityUST | \
+                                 PresentCapabilityIdleFence)
 
 /* Events */
 #define PresentConfigureNotify	0
-- 
2.13.0



More information about the xorg-devel mailing list