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>
This commit is contained in:
parent
92b91b8cf3
commit
7b071b4e44
|
@ -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)) {
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user