From: Eric Anholt Subject: Re: [PATCH 2/2] present: Fix use of vsynced pageflips and honor PresentOptionAsync. (v3) Date: Thu, 04 Dec 2014 15:56:08 -0800 Message-ID: <871tofkm07.fsf@eliezer.anholt.net> References: <1417547329-9352-1-git-send-email-mario.kleiner.de@gmail.com> <1417547329-9352-4-git-send-email-mario.kleiner.de@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0086785908==" Return-path: In-Reply-To: <1417547329-9352-4-git-send-email-mario.kleiner.de@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Mario Kleiner , keithp@keithp.com, axel.davy@ens.frmario.kleiner.de@gmail.com, jamey@minilop.net, chris@chris-wilson.co.uk, skeggsb@gmail.com Cc: maarten.lankhorst@canonical.com, intel-gfx@lists.freedesktop.org, xorg-devel@lists.x.org, Theo0x48@gmail.com, jcristau@debian.org List-Id: intel-gfx@lists.freedesktop.org --===============0086785908== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Mario Kleiner writes: > 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. > > Please also apply to XOrg 1.17 and XOrg 1.16.2 stable. > > Applying on top of XOrg 1.16.2 may require 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 > --- > present/present.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/present/present.c b/present/present.c > index e5d3fd5..be1c9f1 100644 > --- a/present/present.c > +++ b/present/present.c > @@ -834,7 +834,7 @@ present_pixmap(WindowPtr window, > vblank->notifies =3D notifies; > vblank->num_notifies =3D num_notifies; >=20=20 > - if (!screen_priv->info || !(screen_priv->info->capabilities & Presen= tCapabilityAsync)) > + if (!(options & PresentOptionAsync)) > vblank->sync_flip =3D TRUE; I think I'd like to see a hunk like this in with this patch, so that each driver doesn't need to have the cap check: diff --git a/present/present.c b/present/present.c index a9f2214..ed0d734 100644 =2D-- a/present/present.c +++ b/present/present.c @@ -838,6 +838,9 @@ present_pixmap(WindowPtr window, vblank->sync_flip =3D TRUE; =20 if (!(options & PresentOptionCopy) && + !((options & PresentOptionAsync) && + (!screen_priv->info || + !(screen_priv->info->capabilities & PresentCapabilityAsync))) && pixmap !=3D NULL && present_check_flip (target_crtc, window, pixmap, vblank->sync_flip= , valid, x_off, y_off)) { Seem reasonable? If you wanted to squash this in, then this is: Reviewed-by: Eric Anholt (So's patch 1/2, regardless). --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJUgPSYAAoJELXWKTbR/J7oecYP/jqWxcwM9vCV679cEbX0UGv9 6dUKD0f/DUc45VjvPl9jJHJirG0HYCJtTxlUlXYgc1QDlUa58v9HJbhDdQqT9tq8 fm/X63OsdFyXyl3hJ6KI4Fbx85SJqsR9ovEsPRC/0+x6oghTtkt7vtDUitMvmO6u aLcsGaxChWxKyEhrn6bO6NEbHaBSJeqD7t/bSxjZ+Hi0cuKJqNIP6GoThva+UE9Z IPSPh5PPBNbyrc0jr06bJIn2/gN0ojFKyVXahZvqGJOz94oBxn62IpJaA1FVUT1n jmoef7g9HS+YXj1wYwAdkYBgHVxH+NuJLbdDH2wU6nOTvaQZ67EXw9kbE2uzJ9OG Fu+RuXrGimvwcQveSu31NPleCASBUyohhWqdxdlayyRixlvkU5UUCZb9qAd4g3/Z EVtpX4h7L8RVGwp519VZsxWyFHn5p0DMovJwkdc1sMKFRVWeRIJlh6VS+jOnwEdv LhTwJjCZPypNYFsScILEMjDBPMv0FqTOH1HiOK9gUG0ztx5if9egcO9u5mDJve2o gIN70imm4rY6Boh2ezng3aEfJa62hEiqr5N8e1wrkqP1O200q7Qtq5PF0N5EV2V+ RzfY28eItgPPJdrLLIfyS2FBS9mcAD2on9oIZ7YmSAnIpWan5BLUIKpGTzedvqXk MIvBWzxR5n/gt2SwPUM8 =1P/V -----END PGP SIGNATURE----- --=-=-=-- --===============0086785908== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9pbnRlbC1nZngK --===============0086785908==--