diff options
author | Mario Kleiner <mario.kleiner.de@gmail.com> | 2014-12-06 05:40:08 +0100 |
---|---|---|
committer | Julien Cristau <jcristau@debian.org> | 2014-12-09 17:42:02 +0100 |
commit | d1bd02fb6746a4393e2538bf605b610e1764a413 (patch) | |
tree | 9b5d30e8bc0ba90217963a4eaf310cfd92b591fa | |
parent | 77ef968c86b4ed1accd6f04ef7bc3d9700c22ed2 (diff) |
present: Fix use of vsynced pageflips and honor PresentOptionAsync. (v4)
Pageflips for Pixmap presents were not synchronized to vblank on
drivers with support for PresentCapabilityAsync, due to some
missing init for vblank->sync_flips. The PresentOptionAsync
flag was completely ignored for pageflipped presents.
Vsynced flips only worked by accident on the intel-ddx, as that
driver doesn't have PresentCapabilityAsync support.
On nouveau-ddx, which supports PresentCapabilityAsync, this
always caused non-vsynced pageflips with pretty ugly tearing.
This patch fixes the problem, as tested on top of XOrg 1.16.2
on nouveau and intel.
v4: Add additional PresentCapabilityAsync caps check, as
suggested by Eric Anholt.
Please also apply to XOrg 1.17 and XOrg 1.16.2 stable.
Applying on top of XOrg 1.16.2 requires cherry-picking
commit 2051514652481a83bd7cf22e57cb0fcd40333f33
which trivially fixes lack of support for protocol option
PresentOptionCopy - get two bug fixes for the price of one!
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit aae6460694ac3667abb8c34fdf3a7dae524827a4)
Signed-off-by: Julien Cristau <jcristau@debian.org>
-rw-r--r-- | present/present.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/present/present.c b/present/present.c index 5321c7a0b..8e4829e76 100644 --- a/present/present.c +++ b/present/present.c @@ -829,10 +829,13 @@ present_pixmap(WindowPtr window, vblank->notifies = notifies; vblank->num_notifies = num_notifies; - if (!screen_priv->info || !(screen_priv->info->capabilities & PresentCapabilityAsync)) + if (!(options & PresentOptionAsync)) vblank->sync_flip = TRUE; if (!(options & PresentOptionCopy) && + !((options & PresentOptionAsync) && + (!screen_priv->info || + !(screen_priv->info->capabilities & PresentCapabilityAsync))) && pixmap != NULL && present_check_flip (target_crtc, window, pixmap, vblank->sync_flip, valid, x_off, y_off)) { |