From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH 2/2] drm/i915: i8xx also does not like multiple oustanding pageflips Date: Wed, 04 Aug 2010 21:06:46 +0100 Message-ID: <89k83a$95utrd@azsmga001.ch.intel.com> References: <1280949730-5288-1-git-send-email-daniel.vetter@ffwll.ch> <1280949730-5288-3-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id E96B19E75B for ; Wed, 4 Aug 2010 13:06:50 -0700 (PDT) In-Reply-To: <1280949730-5288-3-git-send-email-daniel.vetter@ffwll.ch> 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 Cc: Daniel Vetter , stabel@kernel.org List-Id: intel-gfx@lists.freedesktop.org On Wed, 4 Aug 2010 21:22:10 +0200, Daniel Vetter wrote: > My i855GM suffers from a 80k/s interrupt storm without this. > So add 2nd gen to the list of things that don't like more than > one outstanding pageflip request. > > Furthermore I've changed the busy loop into a ringbuffer wait. > Busy-loops that don't check whether the chip died are simply evil. > And performance should actually improve, because there's usually > a decent amount of rendering queued on the gpu, hopefully rendering > that MI_WAIT into a noop by the time it's executed. > > The current code holds dev->struct_mutex while executing this loop, > hence stalling all other gem activity anyway. > > Signed-off-by: Daniel Vetter > Cc: stabel@kernel.org > --- > drivers/gpu/drm/i915/intel_display.c | 13 ++++++++----- > 1 files changed, 8 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > index 8135ee0..7b6035e 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -4916,14 +4916,17 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, > work->pending_flip_obj = obj; > > if (intel_crtc->plane) > - flip_mask = I915_DISPLAY_PLANE_B_FLIP_PENDING_INTERRUPT; > + flip_mask = MI_WAIT_FOR_PLANE_B_FLIP; > else > - flip_mask = I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT; > + flip_mask = MI_WAIT_FOR_PLANE_A_FLIP; > > /* Wait for any previous flip to finish */ > - if (IS_GEN3(dev)) > - while (I915_READ(ISR) & flip_mask) > - ; > + if (IS_GEN3(dev) || IS_GEN2(dev)) { > + BEGIN_LP_RING(2); > + OUT_RING(MI_WAIT_FOR_EVENT | flip_mask); > + OUT_RING(0); > + ADVANCE_LP_RING(); > + } If you move the if(intel_crtc->plane) inside the gen2/3 block, then I'll test it on my netbooks. :) Starting to look like intel_overlay.c ;-) -- Chris Wilson, Intel Open Source Technology Centre