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: Tue, 10 Jun 2014 14:29:25 +0300 Message-ID: <20140610112925.GY27580@intel.com> References: <1402394642-6263-1-git-send-email-chris@chris-wilson.co.uk> <1402394642-6263-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 mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 107536E670 for ; Tue, 10 Jun 2014 04:30:32 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1402394642-6263-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 Tue, Jun 10, 2014 at 11:04:01AM +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. > = > v2: Rebase after refactor > = > Signed-off-by: Chris Wilson > Cc: Daniel Vetter > Cc: Ville Syrj=E4l=E4 Reviewed-by: Ville Syrj=E4l=E4 still stands. > --- > drivers/gpu/drm/i915/intel_display.c | 16 +++++++++++++--- > 1 file changed, 13 insertions(+), 3 deletions(-) > = > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/= intel_display.c > index b87b4ce..9ecc6bf 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -3363,9 +3363,19 @@ 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"); > + page_flip_completed(intel_crtc); > + } > + spin_unlock_irqrestore(&dev->event_lock, flags); > + } > = > mutex_lock(&dev->struct_mutex); > intel_finish_fb(crtc->primary->fb); > -- = > 1.7.9.5 -- = Ville Syrj=E4l=E4 Intel OTC