From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 5/5] drm/i915: Allow vblank interrupts during modeset and eliminate some vblank races Date: Tue, 4 Mar 2014 10:15:06 +0100 Message-ID: <20140304091506.GQ17001@phenom.ffwll.local> References: <1393009415-27651-1-git-send-email-ville.syrjala@linux.intel.com> <1393009415-27651-6-git-send-email-ville.syrjala@linux.intel.com> <20140228085620.GN3852@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-ea0-f182.google.com (mail-ea0-f182.google.com [209.85.215.182]) by gabe.freedesktop.org (Postfix) with ESMTP id 87C9FFC079 for ; Tue, 4 Mar 2014 01:15:10 -0800 (PST) Received: by mail-ea0-f182.google.com with SMTP id b10so199262eae.13 for ; Tue, 04 Mar 2014 01:15:09 -0800 (PST) Content-Disposition: inline In-Reply-To: <20140228085620.GN3852@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Fri, Feb 28, 2014 at 10:56:20AM +0200, Ville Syrj=E4l=E4 wrote: > On Fri, Feb 21, 2014 at 09:03:35PM +0200, ville.syrjala@linux.intel.com w= rote: > > From: Ville Syrj=E4l=E4 > > = > > Tell the drm core vblank code to reject drm_vblank_get()s only between > > drm_vblank_off() and drm_vblank_on() calls, and sprinkle the appropriate > > drm_vblank_on() calls to the .crtc_enable() hooks. At this time I kept > > the off calls in their current position, and added the on calls to the > > end of .crtc_enable(). Later on these will be moved inwards a bit to > > allow vblank interrupts during plane enable/disable steps. > > = > > We can kill of the drm_vblank_{pre,post}_modeset() calls since those are > > there simply to make drm_vblank_get() fail during a modeset. The way > > they do it is by grabbing a vblank reference, and after drm_vblank_off() > > gets called this will results in drm_vblank_get() failing due to the > > elevated refcount while vblank interrupts are disabled. Unfortunately > > this means there's no point during modeset where the behaviour can be > > restored back to the normal state until the vblank refcount drops to 0. > > There's no gurantee of that happening even after the modeset has > > completed, so simply dropping the drm_vblank_{pre,post}_modeset() calls > > is the best option. The new reject mechanism will take care of things > > in a much more consistent and race free manner. > > = > > Testcase: igt/kms_flip/{dpms,modeset}-vs-vblank-race > = > QA hit the new tests and filed a bug. > = > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=3D75593 I have another test request since you've just fixed this bug: Across suspend/resume the vblank state restoring through the pre/post_modeset hacks isn't just racy but flat-out doesn't work. Keith Packard stumbled over this when working on his present extension. So I think since you've (likely) also fixed this, we also should have a testcase for it. -Daniel -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch