From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH 2/3] drm/i915: Decouple the stuck pageflip on modeset Date: Mon, 9 Jun 2014 16:09:02 +0300 Message-ID: <20140609130902.GQ27580@intel.com> References: <1401466596-30185-1-git-send-email-chris@chris-wilson.co.uk> <1401466596-30185-2-git-send-email-chris@chris-wilson.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 49FA86E545 for ; Mon, 9 Jun 2014 06:09:08 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1401466596-30185-2-git-send-email-chris@chris-wilson.co.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Fri, May 30, 2014 at 05:16:35PM +0100, Chris Wilson wrote: > If we successfully confuse the hardware, and cause it to drop a queued > pageflip, we wait for 60s and issue a warning before continuing on with > the modeset. However, this leaves the pending pageflip still stuck > indefinitely. Pretend to userspace that it does complete, and let us > start afresh following the modeset. > = > Signed-off-by: Chris Wilson > Cc: Daniel Vetter > Cc: Ville Syrj=E4l=E4 > --- > drivers/gpu/drm/i915/intel_display.c | 18 +++++++++++++++--- > 1 file changed, 15 insertions(+), 3 deletions(-) > = > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/= intel_display.c > index 764b277e5937..54b69838e2de 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -3329,9 +3329,21 @@ void intel_crtc_wait_for_pending_flips(struct drm_= crtc *crtc) > = > WARN_ON(waitqueue_active(&dev_priv->pending_flip_queue)); > = > - WARN_ON(wait_event_timeout(dev_priv->pending_flip_queue, > - !intel_crtc_has_pending_flip(crtc), > - 60*HZ) =3D=3D 0); > + if (WARN_ON(wait_event_timeout(dev_priv->pending_flip_queue, > + !intel_crtc_has_pending_flip(crtc), > + 60*HZ) =3D=3D 0)) { > + struct intel_crtc *intel_crtc =3D to_intel_crtc(crtc); > + unsigned long flags; > + > + spin_lock_irqsave(&dev->event_lock, flags); > + if (intel_crtc->unpin_work) { > + WARN_ONCE(1, "Removing stuck page flip\n"); > + drm_vblank_put(dev, intel_crtc->pipe); > + page_flip_completed(dev_priv, intel_crtc, intel_crtc->unpin_work); > + intel_crtc->unpin_work =3D NULL; > + } > + spin_unlock_irqrestore(&dev->event_lock, flags); > + } Seems like a decent idea. Reviewed-by: Ville Syrj=E4l=E4 Though my comment (to the other patch) about moving drm_vblank_put() into page_flip_completed() still seems valid. > = > mutex_lock(&dev->struct_mutex); > intel_finish_fb(crtc->primary->fb); > -- = > 2.0.0.rc4 -- = Ville Syrj=E4l=E4 Intel OTC