summaryrefslogtreecommitdiff
path: root/present
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-02-14 09:58:44 +0000
committerHans de Goede <hdegoede@redhat.com>2016-06-17 11:21:30 +0200
commitbab0f450a719a11799491043b82c2f293fed27fe (patch)
tree6d1c9aaceb560b54ab2c279769efd9d3a63087e7 /present
parentfbe660b7652b945bdd8e3eb0780179d83cc7de96 (diff)
present: Fix presentation of flips out of order
The flip queue currently only holds events submitted to the driver for flipping, awaiting the completion notifier. It is short. We therefore can speed up interrupt processing by keeping the small number of events ready to be flipped on the end of the flip queue. By appending the events to the flip_queue in the order that they become ready, we also resolve one issue causing Present to display frames out of order. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-and-tested-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'present')
-rw-r--r--present/present.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/present/present.c b/present/present.c
index 2ae7d3a80..cebd2f786 100644
--- a/present/present.c
+++ b/present/present.c
@@ -353,10 +353,10 @@ present_re_execute(present_vblank_ptr vblank)
static void
present_flip_try_ready(ScreenPtr screen)
{
- present_vblank_ptr vblank, tmp;
+ present_vblank_ptr vblank;
- xorg_list_for_each_entry_safe(vblank, tmp, &present_exec_queue, event_queue) {
- if (vblank->flip_ready) {
+ xorg_list_for_each_entry(vblank, &present_flip_queue, event_queue) {
+ if (vblank->queued) {
present_re_execute(vblank);
return;
}
@@ -656,6 +656,8 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
DebugPresent(("\tr %lld %p (pending %p unflip %lld)\n",
vblank->event_id, vblank,
screen_priv->flip_pending, screen_priv->unflip_event_id));
+ xorg_list_del(&vblank->event_queue);
+ xorg_list_append(&vblank->event_queue, &present_flip_queue);
vblank->flip_ready = TRUE;
return;
}
@@ -994,6 +996,7 @@ present_abort_vblank(ScreenPtr screen, RRCrtcPtr crtc, uint64_t event_id, uint64
xorg_list_for_each_entry(vblank, &present_flip_queue, event_queue) {
if (vblank->event_id == event_id) {
xorg_list_del(&vblank->event_queue);
+ vblank->queued = FALSE;
return;
}
}