From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com ([134.134.136.65]:52464 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760059AbdKPQOK (ORCPT ); Thu, 16 Nov 2017 11:14:10 -0500 Date: Thu, 16 Nov 2017 18:14:06 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Benjamin Gaignard Cc: Daniel Vetter , stable@vger.kernel.org, "dri-devel@lists.freedesktop.org" , "Szyprowski, Marek" Subject: Re: [PATCH] drm/vblank: Tune drm_crtc_accurate_vblank_count() WARN down to a debug Message-ID: <20171116161406.GU10981@intel.com> References: <20171023152540.15364-1-ville.syrjala@linux.intel.com> <20171030091826.ar3i5qwtip2n7yt7@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: stable-owner@vger.kernel.org List-ID: On Thu, Nov 16, 2017 at 03:19:35PM +0100, Benjamin Gaignard wrote: > 2017-10-30 10:19 GMT+01:00 Daniel Vetter : > > On Tue, Oct 24, 2017 at 11:01:32AM +0200, Benjamin Gaignard wrote: > >> 2017-10-23 17:25 GMT+02:00 Ville Syrjala : > >> > From: Ville Syrj�l� > >> > > >> > Since commit 632c6e4edef1 ("drm/vblank: Fix flip event vblank count") > >> > even drivers that don't implement accurate vblank timestamps will end > >> > up using drm_crtc_accurate_vblank_count(). That leads to a WARN every > >> > time drm_crtc_arm_vblank_event() gets called. The could be as often > >> > as every frame for each active crtc. > >> > > >> > Considering drm_crtc_accurate_vblank_count() is never any worse than > >> > the drm_vblank_count() we used previously, let's just skip the WARN > >> > unless DRM_UT_VBL is enabled. That way people won't be bothered by > >> > this unless they're debugging vblank code. And let's also change it > >> > to WARN_ONCE() so that even when you're debugging vblank code you > >> > won't get drowned by constant WARNs. > >> > > >> > Cc: stable@vger.kernel.org > >> > Cc: Daniel Vetter > >> > Cc: "Szyprowski, Marek" > >> > Cc: Andrzej Hajda > >> > Reported-by: Andrzej Hajda > >> > Fixes: 632c6e4edef1 ("drm/vblank: Fix flip event vblank count") > >> > Signed-off-by: Ville Syrj�l� > >> > >> I have tested it on sti and stm driver, it fix the problem, thanks. > >> > >> Acked-by: Benjamin Gaignard > >> > >> > --- > >> > drivers/gpu/drm/drm_vblank.c | 4 ++-- > >> > 1 file changed, 2 insertions(+), 2 deletions(-) > >> > > >> > diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c > >> > index 13722c373a6a..c81c297995c6 100644 > >> > --- a/drivers/gpu/drm/drm_vblank.c > >> > +++ b/drivers/gpu/drm/drm_vblank.c > >> > @@ -299,8 +299,8 @@ u32 drm_crtc_accurate_vblank_count(struct drm_crtc *crtc) > >> > u32 vblank; > >> > unsigned long flags; > >> > > >> > - WARN(!dev->driver->get_vblank_timestamp, > >> > - "This function requires support for accurate vblank timestamps."); > >> > + WARN_ONCE(drm_debug & DRM_UT_VBL && !dev->driver->get_vblank_timestamp, > >> > + "This function requires support for accurate vblank timestamps."); > > > > Somewhat a bikeshed, but if we e.g. enable debugging in a CI or piglit > > run, then this could change the results. I'd go with a if () > > DRM_DEBUG_VBLANK. Either way: > > > > Reviewed-by: Daniel Vetter > > > > Does something is missing to merge this fix in drm-misc ? > Without it I got warning at each frame. Pushed... 9 days ago it seems. -- Ville Syrj�l� Intel OTC