From: Simon Farnsworth Subject: Re: [PATCH] Attempt to detect and recover from pageflipping stalls Date: Wed, 1 Sep 2010 18:34:45 +0100 Message-ID: <201009011834.45404.simon.farnsworth@onelan.co.uk> References: <1283360402-14599-1-git-send-email-simon.farnsworth@onelan.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from claranet-outbound-smtp06.uk.clara.net (claranet-outbound-smtp06.uk.clara.net [195.8.89.39]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B3969E915 for ; Wed, 1 Sep 2010 10:34:48 -0700 (PDT) Received: from host217-35-101-6.in-addr.btopenworld.com ([217.35.101.6]:57680 helo=f12simon.localnet) by relay06.mail.eu.clara.net (relay.clara.net [213.253.3.46]:1025) with esmtpa (authdaemon_plain:simon.farnsworth@onelan.com) id 1OqrCw-0004BJ-KE for intel-gfx@lists.freedesktop.org (return-path ); Wed, 01 Sep 2010 17:34:46 +0000 In-Reply-To: <1283360402-14599-1-git-send-email-simon.farnsworth@onelan.co.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Wednesday 1 September 2010, Simon Farnsworth wrote: > In an attempt to get to the bottom of bug #29798, Chris Wilson gave me > a patch that put some details in debugfs. With the clues gathered from > that patch, I was able to determine that the page flip is happening, > but that we're not seeing the IRQs we'd expect. > > Work around this by only permitting a pageflip to be outstanding for 3 > VBlank periods before we start examining the display registers to see > if the pageflip happened, but we weren't told about it. This converts > an apparent hang into a visual glitch. > And, as promised, it's buggy: > diff --git a/drivers/gpu/drm/i915/i915_irq.c > b/drivers/gpu/drm/i915/i915_irq.c index 16861b8..893cd77 100644 > --- a/drivers/gpu/drm/i915/i915_irq.c > +++ b/drivers/gpu/drm/i915/i915_irq.c > @@ -887,6 +887,54 @@ static void i915_handle_error(struct drm_device *dev, > bool wedged) queue_work(dev_priv->wq, &dev_priv->error_work); > } > > +static void i915_pageflip_stall_check(struct drm_device *dev, int pipe) > +{ > + drm_i915_private_t *dev_priv = dev->dev_private; > + struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe]; > + int plane = intel_crtc->plane; > + struct intel_crtc *intel_crtc = to_intel_crtc(crtc); These two lines got swapped when I was checking various possible null pointers. I can send a new version if required. -- Simon Farnsworth Software Engineer ONELAN Limited http://www.onelan.com/