summaryrefslogtreecommitdiff
path: root/present
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-02-24 16:52:58 +0900
committerAdam Jackson <ajax@redhat.com>2016-02-25 10:18:00 -0500
commite7a35b9e16aa12970908f5d55371bb1b862f8f24 (patch)
tree76b0f2afa301ba6254436638ed9891f068ea49a0 /present
parent1a9f8c4623c4e6b6955cb6d5f44d29c244dfd32a (diff)
present: Requeue if flip driver hook fails and target MSC not reached
For flipping, we wait for the MSC before the target MSC and then call the driver flip hook. If the latter fails, we have to wait for the target MSC before falling back to a copy, or else it's executed too early. Fixes glxgears running at unbounded framerate (not synchronized to the refresh rate) in fullscreen if the driver flip hook fails. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'present')
-rw-r--r--present/present.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/present/present.c b/present/present.c
index 17ec52632..7f9fc17c3 100644
--- a/present/present.c
+++ b/present/present.c
@@ -712,6 +712,20 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
if (window == screen_priv->flip_window)
present_unflip(screen);
}
+
+ /* If present_flip failed, we may have to requeue for the target MSC */
+ if (msc_is_after(vblank->target_msc, crtc_msc) &&
+ Success == present_queue_vblank(screen,
+ vblank->crtc,
+ vblank->event_id,
+ vblank->target_msc)) {
+ xorg_list_add(&vblank->event_queue, &present_exec_queue);
+ xorg_list_append(&vblank->window_list,
+ &present_get_window_priv(window, TRUE)->vblank);
+ vblank->queued = TRUE;
+ return;
+ }
+
present_copy_region(&window->drawable, vblank->pixmap, vblank->update, vblank->x_off, vblank->y_off);
/* present_copy_region sticks the region into a scratch GC,