[PATCH 12/19] present: Adapt flip mode API hooks for window flip mode

Roman Gilg subdiff at gmail.com
Mon Jan 29 13:34:10 UTC 2018


Flipping pixmaps per window needs additional arguments in the
flip mode API. Add these as preperation for window flip mode.

Signed-off-by: Roman Gilg <subdiff at gmail.com>
---
 present/present_execute.c |  2 ++
 present/present_priv.h    | 10 +++++++---
 present/present_scmd.c    |  8 +++++---
 present/present_screen.c  |  2 +-
 present/present_vblank.c  |  2 +-
 5 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/present/present_execute.c b/present/present_execute.c
index e45e547..e0c755a 100644
--- a/present/present_execute.c
+++ b/present/present_execute.c
@@ -52,6 +52,7 @@ present_execute_wait(present_vblank_ptr vblank, uint64_t crtc_msc)
         vblank->requeue = FALSE;
         if (msc_is_after(vblank->target_msc, crtc_msc) &&
             Success == screen_priv->queue_vblank(screen,
+                                                 window,
                                                  vblank->crtc,
                                                  vblank->event_id,
                                                  vblank->target_msc))
@@ -77,6 +78,7 @@ present_execute_copy(present_vblank_ptr vblank, uint64_t crtc_msc)
     /* If present_flip failed, we may have to requeue for the target MSC */
     if (vblank->target_msc == crtc_msc + 1 &&
         Success == screen_priv->queue_vblank(screen,
+                                             window,
                                              vblank->crtc,
                                              vblank->event_id,
                                              vblank->target_msc)) {
diff --git a/present/present_priv.h b/present/present_priv.h
index 6a02c74..231170d 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -85,6 +85,7 @@ struct present_vblank {
 };
 
 typedef struct present_screen_priv present_screen_priv_rec, *present_screen_priv_ptr;
+typedef struct present_window_priv present_window_priv_rec, *present_window_priv_ptr;
 
 /*
  * Mode hooks
@@ -119,9 +120,11 @@ typedef int (*present_priv_pixmap_ptr)(WindowPtr window,
                                        present_notify_ptr notifies,
                                        int num_notifies);
 
-typedef void (*present_priv_create_event_id_ptr)(present_vblank_ptr vblank);
+typedef void (*present_priv_create_event_id_ptr)(present_window_priv_ptr window_priv,
+                                                 present_vblank_ptr vblank);
 
 typedef int (*present_priv_queue_vblank_ptr)(ScreenPtr screen,
+                                             WindowPtr window,
                                              RRCrtcPtr crtc,
                                              uint64_t event_id,
                                              uint64_t msc);
@@ -129,6 +132,7 @@ typedef void (*present_priv_flush_ptr)(WindowPtr window);
 typedef void (*present_priv_re_execute_ptr)(present_vblank_ptr vblank);
 
 typedef void (*present_priv_abort_vblank_ptr)(ScreenPtr screen,
+                                              WindowPtr window,
                                               RRCrtcPtr crtc,
                                               uint64_t event_id,
                                               uint64_t msc);
@@ -201,7 +205,7 @@ typedef struct present_event {
     int mask;
 } present_event_rec;
 
-typedef struct present_window_priv {
+struct present_window_priv {
     WindowPtr              window;
     present_event_ptr      events;
     RRCrtcPtr              crtc;        /* Last reported CRTC from get_ust_msc */
@@ -219,7 +223,7 @@ typedef struct present_window_priv {
     present_vblank_ptr     flip_pending;
     present_vblank_ptr     flip_active;
     uint64_t               unflip_event_id;
-} present_window_priv_rec, *present_window_priv_ptr;
+};
 
 #define PresentCrtcNeverSet     ((RRCrtcPtr) 1)
 
diff --git a/present/present_scmd.c b/present/present_scmd.c
index 73c9f52..ef7d8e9 100644
--- a/present/present_scmd.c
+++ b/present/present_scmd.c
@@ -47,7 +47,8 @@ static void
 present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc);
 
 static void
-present_scmd_create_event_id(present_vblank_ptr vblank)
+present_scmd_create_event_id(present_window_priv_ptr window_priv,
+                             present_vblank_ptr vblank)
 {
     vblank->event_id = ++present_event_id;
 }
@@ -195,6 +196,7 @@ present_flush(WindowPtr window)
 
 static int
 present_queue_vblank(ScreenPtr screen,
+                     WindowPtr window,
                      RRCrtcPtr crtc,
                      uint64_t event_id,
                      uint64_t msc)
@@ -737,7 +739,7 @@ present_scmd_pixmap(WindowPtr window,
     xorg_list_append(&vblank->event_queue, &present_exec_queue);
     vblank->queued = TRUE;
     if (msc_is_after(target_msc, crtc_msc)) {
-        ret = present_queue_vblank(screen, target_crtc, vblank->event_id, target_msc);
+        ret = present_queue_vblank(screen, window, target_crtc, vblank->event_id, target_msc);
         if (ret == Success)
             return Success;
 
@@ -750,7 +752,7 @@ present_scmd_pixmap(WindowPtr window,
 }
 
 static void
-present_scmd_abort_vblank(ScreenPtr screen, RRCrtcPtr crtc, uint64_t event_id, uint64_t msc)
+present_scmd_abort_vblank(ScreenPtr screen, WindowPtr window, RRCrtcPtr crtc, uint64_t event_id, uint64_t msc)
 {
     present_vblank_ptr  vblank;
 
diff --git a/present/present_screen.c b/present/present_screen.c
index d6c9a5e..b0cae0f 100644
--- a/present/present_screen.c
+++ b/present/present_screen.c
@@ -84,7 +84,7 @@ present_free_window_vblank(WindowPtr window)
     present_vblank_ptr          vblank, tmp;
 
     xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->vblank, window_list) {
-        screen_priv->abort_vblank(window->drawable.pScreen, vblank->crtc, vblank->event_id, vblank->target_msc);
+        screen_priv->abort_vblank(window->drawable.pScreen, window, vblank->crtc, vblank->event_id, vblank->target_msc);
         present_vblank_destroy(vblank);
     }
 }
diff --git a/present/present_vblank.c b/present/present_vblank.c
index 00bb65c..dbfedb4 100644
--- a/present/present_vblank.c
+++ b/present/present_vblank.c
@@ -76,7 +76,7 @@ present_vblank_create(WindowPtr window,
     vblank->window = window;
     vblank->pixmap = pixmap;
 
-    screen_priv->create_event_id(vblank);
+    screen_priv->create_event_id(window_priv, vblank);
 
     if (pixmap) {
         vblank->kind = PresentCompleteKindPixmap;
-- 
2.7.4



More information about the xorg-devel mailing list