dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Mario Kleiner <mario.kleiner.de@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: mario.kleiner.de@gmail.com, stable@vger.kernel.org,
	Ben Skeggs <bskeggs@redhat.com>,
	ville.syrjala@linux.intel.com, daniel.vetter@ffwll.ch
Subject: [PATCH 6/6] drm/nouveau/display: Enable vblank irqs after display engine is on again.
Date: Fri, 12 Feb 2016 20:30:32 +0100	[thread overview]
Message-ID: <1455305432-28770-7-git-send-email-mario.kleiner.de@gmail.com> (raw)
In-Reply-To: <1455305432-28770-1-git-send-email-mario.kleiner.de@gmail.com>

In the display resume path, move the calls to drm_vblank_on()
after the point when the display engine is running again.

Since changes were made to drm_update_vblank_count() in Linux 4.4+
to emulate hw vblank counters via vblank timestamping, the function
drm_vblank_on() now needs working high precision vblank timestamping
and therefore working scanout position queries at time of call.
These don't work before the display engine gets restarted, causing
miscalculation of vblank counter increments and thereby large forward
jumps in vblank count at display resume. These jumps can cause client
hangs on resume, or desktop hangs in the case of composited desktops.

Fix this Linux 4.4 regression by reordering calls accordingly.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: <stable@vger.kernel.org> # 4.4+
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: ville.syrjala@linux.intel.com
Cc: daniel.vetter@ffwll.ch
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/nouveau/nouveau_display.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
index 18676b8..1f8e51b 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -634,10 +634,6 @@ nouveau_display_resume(struct drm_device *dev, bool runtime)
 		nv_crtc->lut.depth = 0;
 	}
 
-	/* Make sure that drm and hw vblank irqs get resumed if needed. */
-	for (head = 0; head < dev->mode_config.num_crtc; head++)
-		drm_vblank_on(dev, head);
-
 	/* This should ensure we don't hit a locking problem when someone
 	 * wakes us up via a connector.  We should never go into suspend
 	 * while the display is on anyways.
@@ -647,6 +643,10 @@ nouveau_display_resume(struct drm_device *dev, bool runtime)
 
 	drm_helper_resume_force_mode(dev);
 
+	/* Make sure that drm and hw vblank irqs get resumed if needed. */
+	for (head = 0; head < dev->mode_config.num_crtc; head++)
+		drm_vblank_on(dev, head);
+
 	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
 		struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
 
-- 
1.9.1

  parent reply	other threads:[~2016-02-12 19:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-12 19:30 Respin: drm vblank regression fixes for Linux 4.4+ (v2) Mario Kleiner
2016-02-12 19:30 ` [PATCH 1/6] drm: No-Op redundant calls to drm_vblank_off() (v2) Mario Kleiner
2016-02-12 19:30 ` [PATCH 2/6] drm: Prevent vblank counter bumps > 1 with active vblank clients. (v2) Mario Kleiner
2016-02-12 19:30 ` [PATCH 3/6] drm: Fix drm_vblank_pre/post_modeset regression from Linux 4.4 Mario Kleiner
2016-02-24  8:59   ` Vlastimil Babka
2016-02-12 19:30 ` [PATCH 4/6] drm: Fix treatment of drm_vblank_offdelay in drm_vblank_on() (v2) Mario Kleiner
2016-02-12 19:30 ` [PATCH 5/6] drm/radeon/pm: Handle failure of drm_vblank_get Mario Kleiner
2016-02-12 19:30 ` Mario Kleiner [this message]
2016-02-14 18:28   ` [PATCH 6/6] drm/nouveau/display: Enable vblank irqs after display engine is on again Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455305432-28770-7-git-send-email-mario.kleiner.de@gmail.com \
    --to=mario.kleiner.de@gmail.com \
    --cc=bskeggs@redhat.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=stable@vger.kernel.org \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).