summaryrefslogtreecommitdiff
path: root/present
diff options
context:
space:
mode:
authorRoman Gilg <subdiff@gmail.com>2018-03-13 16:00:46 +0100
committerAdam Jackson <ajax@redhat.com>2018-03-28 14:36:33 -0400
commit7b071b4e440313254398f06eb59b1596a6d3e8fe (patch)
tree954136ddaebfdad9cc78c2747a2d6386c61cedf1 /present
parent92b91b8cf34a38de39281044d8441b6cabe87a85 (diff)
present: Adapt flip mode API hooks for window flip mode
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@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'present')
-rw-r--r--present/present_execute.c2
-rw-r--r--present/present_priv.h10
-rw-r--r--present/present_scmd.c8
-rw-r--r--present/present_screen.c2
-rw-r--r--present/present_vblank.c2
5 files changed, 16 insertions, 8 deletions
diff --git a/present/present_execute.c b/present/present_execute.c
index c9b5678c5..8d1ef4a8c 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 5e1bc3c3f..f69747191 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -87,6 +87,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
@@ -123,9 +124,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);
@@ -133,6 +136,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);
@@ -206,7 +210,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 */
@@ -223,7 +227,7 @@ typedef struct present_window_priv {
present_vblank_ptr flip_pending;
present_vblank_ptr flip_active;
-} 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 18ce619a6..0803a0c0b 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;
}
@@ -204,6 +205,7 @@ present_flush(WindowPtr window)
static int
present_queue_vblank(ScreenPtr screen,
+ WindowPtr window,
RRCrtcPtr crtc,
uint64_t event_id,
uint64_t msc)
@@ -751,7 +753,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;
@@ -764,7 +766,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 d6c9a5e39..b0cae0fd1 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 fac639b22..7662c4dd9 100644
--- a/present/present_vblank.c
+++ b/present/present_vblank.c
@@ -77,7 +77,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;