From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH] drm/nouveau: Fix pre-nv50 pageflip events (v4) Date: Tue, 10 Nov 2015 17:41:39 +0100 Message-ID: <20151110164139.GA27962@ulmo> References: <1447173451-27890-1-git-send-email-thierry.reding@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0982347388==" Return-path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id DDE6D6E88B for ; Tue, 10 Nov 2015 08:41:41 -0800 (PST) Received: by wmvv187 with SMTP id v187so17172871wmv.1 for ; Tue, 10 Nov 2015 08:41:40 -0800 (PST) In-Reply-To: <1447173451-27890-1-git-send-email-thierry.reding@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: David Airlie Cc: Daniel Vetter , dri-devel@lists.freedesktop.org, Ikey Doherty , Ben Skeggs , russianneuromancer@ya.ru, Daniel Vetter , Thierry Reding List-Id: dri-devel@lists.freedesktop.org --===============0982347388== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 10, 2015 at 05:37:31PM +0100, Thierry Reding wrote: > From: Daniel Vetter >=20 > Apparently pre-nv50 pageflip events happen before the actual vblank > period. Therefore that functionality got semi-disabled in >=20 > commit af4870e406126b7ac0ae7c7ce5751f25ebe60f28 > Author: Mario Kleiner > Date: Tue May 13 00:42:08 2014 +0200 >=20 > drm/nouveau/kms/nv04-nv40: fix pageflip events via special case. >=20 > Unfortunately that hack got uprooted in >=20 > commit cc1ef118fc099295ae6aabbacc8af94d8d8885eb > Author: Thierry Reding > Date: Wed Aug 12 17:00:31 2015 +0200 >=20 > drm/irq: Make pipe unsigned and name consistent >=20 > Triggering a warning when trying to sample the vblank timestamp for a > non-existing pipe. There's a few ways to fix this: >=20 > - Open-code the old behaviour, which just enshrines this slight > breakage of the userspace ABI. >=20 > - Revert Mario's commit and again inflict broken timestamps, again not > pretty. >=20 > - Fix this for real by delaying the pageflip TS until the next vblank > interrupt, thereby making it accurate. >=20 > This patch implements the third option. Since having a page flip > interrupt that happens when the pageflip gets armed and not when it > completes in the next vblank seems to be fairly common (older i915 hw > works very similarly) create a new helper to arm vblank events for > such drivers. >=20 > v2 (Mario Kleiner): > - Fix function prototypes in drmP.h > - Add missing vblank_put() for pageflip completion without > pageflip event. > - Initialize sequence number for queued pageflip event to avoid > trouble in drm_handle_vblank_events(). > - Remove dead code and spelling fix. >=20 > v3 (Mario Kleiner): > - Add a signed-off-by and cc stable tag per Ilja's advice. >=20 > v4 (Thierry Reding): > - Fix kerneldoc typo, discovered by Michel D=C3=A4nzer > - Rearrange tags and changelog >=20 > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=3D106431 > Cc: Thierry Reding > Cc: Mario Kleiner > Cc: Ben Skeggs > Cc: Ilia Mirkin > Signed-off-by: Daniel Vetter > Reviewed-by: Mario Kleiner > Cc: stable@vger.kernel.org # v4.3 > Signed-off-by: Mario Kleiner > Signed-off-by: Thierry Reding > --- > drivers/gpu/drm/drm_irq.c | 54 +++++++++++++++++++++++++= +++++- > drivers/gpu/drm/nouveau/nouveau_display.c | 19 ++++++----- > include/drm/drmP.h | 4 +++ > 3 files changed, 68 insertions(+), 9 deletions(-) Hi Dave, It'd be great if you could queue this up for fixes, since it gets rid of a WARN_ON() that is triggered on a number of cards in v4.3. I realize that this is a tad big for stable, but it's the right way to fix this. If you'd prefer something smaller, I think we can fix the regression using a one-line band-aid and then apply this one on top for v4.4. Thierry --GvXjxJ+pjyke8COw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJWQh5AAAoJEN0jrNd/PrOhc28QAKKJS/1+viA/GeW55z6gVmCV dCuuG0aZ8iRzEqmkt2H5U5oXat+Od1/WkHNqdU1rjC7cABE8My8r29nSn8sRlKZm bocWDB8C33ICo3cReh6nwpAAM6W5f0CcyWgAqd05GLqTY3UHd48UQurAdINp04M9 LV0YoKCqvuD+YeWKGXuMILDqmiSMsPTePwEMx4t4HjCqQosoL+sZZeysdJ/JSeX9 tWzGfEKm8YtU1bBJf8xlIvcJoHs1M+VqrZbanC7tMqYSnrAKjd1v8wUJ7QtWFXf1 mLL+uRWrzX6JDGredd7HMUhFjsFg8lraK1S3gDOYRf+nH3sKBbFZx/v8Y/PIq1oM WzjAU0oBakXvFBgvc+yHzE/uf09GE3hEKnZvV5iUixIfBoyZB8JZUZEjxwVA7+JM 6YAFfxkjql3v4vThGcrFUpyuUkgetf9gzJqERzRx5c4jHNJAwREpUhFn7a0wuKs1 ZdwTfnAZck2+CDdfgrj3Og5w5Ax6IOzOVtuJ71dGsUbpNF3wqItpfdVHfkZ0K26T dAUlv5ybzf2oxsyAmJEiSN1RMv6oXq/cJArlP8XCD/vd5/qrSm7VQp7fy0JLGSfl QiGnoVbD1NNjdt9Q17SW/pgTHlJC1uwwOcGszlJK3fpCm78bDyhzGG4jT0mN3VdV H09j0vFrIifAdChW/aai =e0qF -----END PGP SIGNATURE----- --GvXjxJ+pjyke8COw-- --===============0982347388== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9kcmktZGV2ZWwK --===============0982347388==--