From: Chris Wilson Subject: Re: [RFC][PATCH] drm/i915: Fix races in gen4 page flip interrupt handling Date: Tue, 19 Feb 2013 10:37:18 +0000 Message-ID: <20130219103718.GA8388@cantiga.alporthouse.com> References: <1361200566-30940-1-git-send-email-ville.syrjala@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 8D58BE64A0 for ; Tue, 19 Feb 2013 02:37:28 -0800 (PST) Content-Disposition: inline In-Reply-To: <1361200566-30940-1-git-send-email-ville.syrjala@linux.intel.com> 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: ville.syrjala@linux.intel.com Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Mon, Feb 18, 2013 at 05:16:06PM +0200, ville.syrjala@linux.intel.com wro= te: > From: Ville Syrj=E4l=E4 > = > Use the gen3 logic for handling page flip interrupts on gen4. We're just missing the other piece of the puzzle: =3D0 cantiga:~/git/linux (master)$ git diff | cat diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_ir= q.c index c844790..15218bf 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -2544,6 +2544,8 @@ static int i965_irq_postinstall(struct drm_device *de= v) I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT); = enable_mask =3D ~dev_priv->irq_mask; + enable_mask &=3D ~(I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT | + I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT); enable_mask |=3D I915_USER_INTERRUPT; = if (IS_G4X(dev)) With that, Reviewed-by: Chris Wilson Tested-by: Chris Wilson > Unfortuantely this kills the stall_check since that looks like it can > easily trigger too early. With the current logic the stall check would > kick in on the first vblank after the flip has been submitted to the > ring. If the CS takes longer than that to process the commands in the > ring, the stall check will cause the page flip to be complete too > early. That doesn't sound like a very good idea. Something better > should be deviced if we still need the stall check. Indeed. I hope that we've fixed up the races that necessiated the stall check! But if we can think of a similarly cheap sanity check, that would be a useful addition in future. But for now we have to do something before Ben complains about us breaking his vim debugging, so mark it unused. -Chris -- = Chris Wilson, Intel Open Source Technology Centre