From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 11/9] drm/i915: Opt out of vblank disable timer on >gen2 Date: Mon, 26 May 2014 21:27:57 +0200 Message-ID: <20140526192757.GE14357@phenom.ffwll.local> References: <20140526130228.GH14357@phenom.ffwll.local> <1401114408-23475-1-git-send-email-ville.syrjala@linux.intel.com> <1401114408-23475-2-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 mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by gabe.freedesktop.org (Postfix) with ESMTP id EC1E06E385 for ; Mon, 26 May 2014 12:28:28 -0700 (PDT) Received: by mail-wg0-f44.google.com with SMTP id a1so8290436wgh.15 for ; Mon, 26 May 2014 12:28:00 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1401114408-23475-2-git-send-email-ville.syrjala@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: ville.syrjala@linux.intel.com Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Mon, May 26, 2014 at 05:26:48PM +0300, ville.syrjala@linux.intel.com wro= te: > From: Ville Syrj=E4l=E4 > = > Now that the vblank races are plugged, we can opt out of using > the vblank disable timer and just let vblank interrupts get > disabled immediately when the last reference is dropped. > = > Gen2 is the exception since it has no hardware frame counter. > = > Signed-off-by: Ville Syrj=E4l=E4 I've forgotten to mention (I think so at least) that I'd like to have a new kms_flip subtest which alternates vblank events with longer hrtimer sleeps and still enables all the precise vblank counter/ts checks we have. That should give us tons of flip-flopping of the vblank counter. After all videos run at 25fps, so are about the worst case for this (since the enable vblank for the 1 frame vblank wait and the for the pageflip, disabling it each time in between) and we very much don't want to fail this. Bonus points if you add a 2nd thread which races against the first one for added fun (in a 2nd subtest). -Daniel > --- > drivers/gpu/drm/i915/i915_irq.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > = > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_= irq.c > index 28bae6e..4b2e7af 100644 > --- a/drivers/gpu/drm/i915/i915_irq.c > +++ b/drivers/gpu/drm/i915/i915_irq.c > @@ -4364,6 +4364,14 @@ void intel_irq_init(struct drm_device *dev) > dev->max_vblank_count =3D 0xffffff; /* only 24 bits of frame count */ > } > = > + /* > + * Opt out of the vblank disable timer on everything except gen2. > + * Gen2 doesn't have a hardware frame counter and so depends on > + * vblank interrupts to produce sane vblank seuquence numbers. > + */ > + if (!IS_GEN2(dev)) > + dev->vblank_disable_immediate =3D true; > + > if (drm_core_check_feature(dev, DRIVER_MODESET)) { > dev->driver->get_vblank_timestamp =3D i915_get_vblank_timestamp; > dev->driver->get_scanout_position =3D i915_get_crtc_scanoutpos; > -- = > 1.8.5.5 > = -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch