[PATCH 13/19] present: Add driver facing window flip mode hooks

Roman Gilg subdiff at gmail.com
Mon Jan 29 13:34:11 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..fcf7675 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
  *
@@ -82,6 +104,12 @@ typedef Bool (*present_flip_ptr) (RRCrtcPtr crtc,
  */
 typedef void (*present_unflip_ptr) (ScreenPtr screen,
                                     uint64_t event_id);
+/* "unflip" back to the regular window scanout buffer
+ *
+ * present_event_notify should be called with 'event_id' when the unflip occurs.
+ */
+typedef void (*present_wnmd_unflip_ptr) (WindowPtr window,
+                                         uint64_t event_id);
 
 #define PRESENT_SCREEN_INFO_VERSION        0
 
@@ -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_unflip_ptr             unflip;
+
+} 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 231170d..9656380 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