[PATCH xorgproto v8 02/14] presentproto: PresentCompleteModeSuboptimalCopy flag

Daniel Stone daniels at collabora.com
Wed Feb 28 01:16:28 UTC 2018


From: Louis-Francis Ratté-Boulianne <lfrb at collabora.com>

If the Complete event has this mode, the client is not using
the more optimal format/modifier for the buffer allocation. The
client must explicitely inform the server that it understands
this mode by adding the PresentOptionSuboptimal flag when calling
PresentPixmap.

Its main usage as of now is to allow clients to re-fetch DRI3
format modifiers as some modifiers might allow direct scanout.

Bump presentproto version to 1.2.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb at collabora.com>
Reviewed-by: Daniel Stone <daniels at collabora.com>
---
 include/X11/extensions/presenttokens.h | 13 +++++++-----
 meson.build                            |  2 +-
 presentproto.pc.in                     |  2 +-
 presentproto.txt                       | 36 ++++++++++++++++++++++++----------
 4 files changed, 36 insertions(+), 17 deletions(-)

diff --git a/include/X11/extensions/presenttokens.h b/include/X11/extensions/presenttokens.h
index acb7576..9211207 100644
--- a/include/X11/extensions/presenttokens.h
+++ b/include/X11/extensions/presenttokens.h
@@ -25,7 +25,7 @@
 
 #define PRESENT_NAME			"Present"
 #define PRESENT_MAJOR			1
-#define PRESENT_MINOR			0
+#define PRESENT_MINOR			2
 
 #define PresentNumberErrors		0
 #define PresentNumberEvents		0
@@ -44,10 +44,12 @@
 #define PresentOptionAsync              (1 << 0)
 #define PresentOptionCopy               (1 << 1)
 #define PresentOptionUST                (1 << 2)
+#define PresentOptionSuboptimal         (1 << 3)
 
 #define PresentAllOptions       (PresentOptionAsync | \
                                  PresentOptionCopy | \
-                                 PresentOptionUST)
+                                 PresentOptionUST | \
+                                 PresentOptionSuboptimal)
 
 /* Present capabilities */
 
@@ -94,8 +96,9 @@
 
 /* Complete Modes */
 
-#define PresentCompleteModeCopy         0
-#define PresentCompleteModeFlip         1
-#define PresentCompleteModeSkip         2
+#define PresentCompleteModeCopy           0
+#define PresentCompleteModeFlip           1
+#define PresentCompleteModeSkip           2
+#define PresentCompleteModeSuboptimalCopy 3
 
 #endif
diff --git a/meson.build b/meson.build
index cb92280..6fb1541 100644
--- a/meson.build
+++ b/meson.build
@@ -36,7 +36,7 @@ pcs = [
         ['glproto',             '1.4.17'],
         ['inputproto',          '2.3.2'],
         ['kbproto',             '1.0.7'],
-        ['presentproto',        '1.1'],
+        ['presentproto',        '1.2'],
         ['randrproto',          '1.6.0'],
         ['recordproto',         '1.14.2'],
         ['renderproto',         '0.11.1'],
diff --git a/presentproto.pc.in b/presentproto.pc.in
index 9a32fa8..6ec4b7d 100644
--- a/presentproto.pc.in
+++ b/presentproto.pc.in
@@ -5,5 +5,5 @@ includedir=@includedir@
  
 Name: PresentProto
 Description: Present extension headers
-Version: 1.1
+Version: 1.2
 Cflags: -I${includedir}
diff --git a/presentproto.txt b/presentproto.txt
index fdaf658..6ba55ae 100644
--- a/presentproto.txt
+++ b/presentproto.txt
@@ -1,6 +1,6 @@
 			The Present Extension
-			     Version 1.0
-			       2013-6-6
+			     Version 1.2
+			      2018-02-26
       
 			    Keith Packard
 			  keithp at keithp.com
@@ -24,6 +24,7 @@ change and is provided only as an aid to further Present development.
 Eric Anholt <eric at anholt.net>
 Owen Taylor <otaylor at redhat.com>
 James Jones <jajones at nvidia.com>
+Louis-Francis Ratté-Boulianne <lfrb at collabora.com>
 
 			     ❄ ❄ ❄  ❄  ❄ ❄ ❄ 
 
@@ -55,7 +56,8 @@ PRESENTEVENTMASK { PresentConfigureNotifyMask,
 
 PRESENTOPTION { PresentOptionAsync,
                 PresentOptionCopy,
-		PresentOptionUST }
+		PresentOptionUST,
+		PresentOptionSuboptimal }
 
 PRESENTCAPABILITY { PresentCapabilityAsync,
 		    PresentCapabilityFence,
@@ -66,7 +68,8 @@ PRESENTCOMPLETEKIND { PresentCompleteKindPixmap,
 
 PRESENTCOMPLETEMODE { PresentCompleteModeCopy,
 		      PresentCompleteModeFlip,
-		      PresentCompleteModeSkip }
+		      PresentCompleteModeSkip,
+		      PresentCompleteModeSuboptimalCopy }
 
 The Present extension also uses the Sync extension Fence data type to
 provide synchronization for pixmaps.
@@ -226,6 +229,10 @@ The name of this extension is "Present"
 	server will take the target UST time and convert it to a
 	suitable target MSC value.
 
+	If 'options' contains PresentOptionSuboptimal, then the
+	PresentCompleteNotify event can have mode
+	PresentCompleteModeSuboptimalCopy as the client supports it.
+
 	After the presentation occurs, a PresentCompleteNotify event
 	with kind PresentCompleteKindPixmap will be generated, both to
 	'window' as well as all members of 'notifies'.
@@ -408,12 +415,16 @@ The name of this extension is "Present"
 	'mode' is PresentCompleteModeCopy when the source pixmap
 	contents are taken from the pixmap and the pixmap is idle
 	immediately after the presentation completes. 'mode' is
-	PresentCompleteModeFlip when the pixmap remains in-use even
-	after the presentation completes. It will become idle no later
-	than when the next PresentPixmap operation targeting the same
-	window by any client completes. If the presentation operation
-	was skipped because some later operation made it irrelevant,
-	then 'mode' will be PresentCompleteModeSkip.
+	PresentCompleteModeSuboptimalCopy when the source pixmap
+	contents are copied but it would be possible to flip the
+	pixmap if the buffer format/modifier was different (options
+	given to PresentPixmap must contain PresentOptionSuboptimal).
+	'mode' is PresentCompleteModeFlip when the pixmap remains in-use
+	even after the presentation completes. It will become idle no
+	later than when the next PresentPixmap operation targeting the
+	same window by any client completes. If the presentation
+	operation was skipped because some later operation made it
+	irrelevant, then 'mode' will be PresentCompleteModeSkip.
 
 	'serial' is the value provided in the generating PresentPixmap
 	request.
@@ -505,6 +516,9 @@ The name of this extension is "Present"
 
 	1.0: First published version
 
+	1.2: Added PresentCompleteModeSuboptimalCopy flag and
+	     PresentOptionSuboptimal option
+
 			     ❄ ❄ ❄  ❄  ❄ ❄ ❄
 
 
@@ -569,6 +583,7 @@ A.1 Common Types
 	1	PresentOptionAsync
 	2	PresentOptionCopy;
 	4	PresentOptionUST
+	8	PresentOptionSuboptimal
 └───
 
 ┌───
@@ -589,6 +604,7 @@ A.1 Common Types
 	0	PresentCompleteModeCopy
 	1	PresentCompleteModeFlip
 	2	PresentCompleteModeSkip
+	3	PresentCompleteModeSuboptimalCopy
 └───
 
 ┌───
-- 
2.14.3



More information about the xorg-devel mailing list