[PATCH xserver v2 13/22] present: Add driver facing window flip mode hooks

Roman Gilg subdiff at gmail.com
Wed Feb 28 16:36:55 UTC 2018


To enable special functionality of window flips introduce for window flips
a separate set of driver facing function hooks.

Signed-off-by: Roman Gilg <subdiff at gmail.com>
---
 present/present.h      | 43 +++++++++++++++++++++++++++++++++++++++++++
 present/present_priv.h |  1 +
 2 files changed, 44 insertions(+)

diff --git a/present/present.h b/present/present.h
index aab2e16..b87d5bd 100644
--- a/present/present.h
+++ b/present/present.h
@@ -36,6 +36,7 @@ typedef RRCrtcPtr (*present_get_crtc_ptr) (WindowPtr window);
 /* Return the current ust/msc for 'crtc'
  */
 typedef int (*present_get_ust_msc_ptr) (RRCrtcPtr crtc, uint64_t *ust, uint64_t *msc);
+typedef int (*present_wnmd_get_ust_msc_ptr) (WindowPtr window, uint64_t *ust, uint64_t *msc);
 
 /* Queue callback on 'crtc' for time 'msc'. Call present_event_notify with 'event_id'
  * at or after 'msc'. Return false if it didn't happen (which might occur if 'crtc'
@@ -44,12 +45,20 @@ typedef int (*present_get_ust_msc_ptr) (RRCrtcPtr crtc, uint64_t *ust, uint64_t
 typedef Bool (*present_queue_vblank_ptr) (RRCrtcPtr crtc,
                                           uint64_t event_id,
                                           uint64_t msc);
+typedef Bool (*present_wnmd_queue_vblank_ptr) (WindowPtr window,
+                                               RRCrtcPtr crtc,
+                                               uint64_t event_id,
+                                               uint64_t msc);
 
 /* Abort pending vblank. The extension is no longer interested in
  * 'event_id' which was to be notified at 'msc'. If possible, the
  * driver is free to de-queue the notification.
  */
 typedef void (*present_abort_vblank_ptr) (RRCrtcPtr crtc, uint64_t event_id, uint64_t msc);
+typedef void (*present_wnmd_abort_vblank_ptr) (WindowPtr window,
+                                               RRCrtcPtr crtc,
+                                               uint64_t event_id,
+                                               uint64_t msc);
 
 /* Flush pending drawing on 'window' to the hardware.
  */
@@ -75,6 +84,19 @@ typedef Bool (*present_flip_ptr) (RRCrtcPtr crtc,
                                   uint64_t target_msc,
                                   PixmapPtr pixmap,
                                   Bool sync_flip);
+/* Flip pixmap for window, return false if it didn't happen.
+ *
+ * Like present_flip_ptr, additionaly with:
+ *
+ * 'window' used for synchronization.
+ *
+ */
+typedef Bool (*present_wnmd_flip_ptr) (WindowPtr window,
+                                       RRCrtcPtr crtc,
+                                       uint64_t event_id,
+                                       uint64_t target_msc,
+                                       PixmapPtr pixmap,
+                                       Bool sync_flip);
 
 /* "unflip" back to the regular screen scanout buffer
  *
@@ -83,6 +105,12 @@ typedef Bool (*present_flip_ptr) (RRCrtcPtr crtc,
 typedef void (*present_unflip_ptr) (ScreenPtr screen,
                                     uint64_t event_id);
 
+/* Doing flips has been discontinued.
+ *
+ * Inform driver for potential cleanup on its side.
+ */
+typedef void (*present_wnmd_flips_stop_ptr) (WindowPtr window);
+
 #define PRESENT_SCREEN_INFO_VERSION        0
 
 typedef struct present_screen_info {
@@ -100,6 +128,21 @@ typedef struct present_screen_info {
 
 } present_screen_info_rec, *present_screen_info_ptr;
 
+typedef struct present_wnmd_info {
+    uint32_t                            version;
+
+    present_get_crtc_ptr                get_crtc;
+    present_wnmd_get_ust_msc_ptr        get_ust_msc;
+    present_wnmd_queue_vblank_ptr       queue_vblank;
+    present_wnmd_abort_vblank_ptr       abort_vblank;
+    present_flush_ptr                   flush;
+    uint32_t                            capabilities;
+    present_check_flip_ptr              check_flip;
+    present_wnmd_flip_ptr               flip;
+    present_wnmd_flips_stop_ptr         flips_stop;
+
+} present_wnmd_info_rec, *present_wnmd_info_ptr;
+
 /*
  * Called when 'event_id' occurs. 'ust' and 'msc' indicate when the
  * event actually happened
diff --git a/present/present_priv.h b/present/present_priv.h
index 2900e9a..a732126 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -158,6 +158,7 @@ struct present_screen_priv {
     Bool                        flip_sync;
 
     present_screen_info_ptr     info;
+    present_wnmd_info_ptr       wnmd_info;
 
     /* Mode hooks */
     present_priv_query_capabilities_ptr query_capabilities;
-- 
2.7.4



More information about the xorg-devel mailing list