dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Sean Paul <seanpaul@chromium.org>,
	Sam Ravnborg <sam@ravnborg.org>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/atomic-helper: Bump vblank timeout to 100 ms
Date: Tue, 30 Apr 2019 16:43:30 +0200	[thread overview]
Message-ID: <20190430144329.GZ3271@phenom.ffwll.local> (raw)
In-Reply-To: <20190430104419.GD24299@intel.com>

On Tue, Apr 30, 2019 at 01:44:19PM +0300, Ville Syrjälä wrote:
> On Tue, Apr 30, 2019 at 11:37:46AM +0200, Linus Walleij wrote:
> > The 50 ms default timeout waiting for vblanks is too small
> > for the first vblank from the ST-Ericsson MCDE display
> > controller over DSI. Presumably this is because the DSI
> > display is command-mode only and the state machine will
> > take some time setting up its state for the first display
> > update, and we hit a timeout. 100 ms makes it pass without
> > problems.
> > 
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> > ---
> > After a quite prolonged hunting for the cause of missed
> > vblanks in the MCDE driver I finally realized it timed
> > out because it was simply taking some time on the first
> > vblank. 50 ms makes sense on 60Hz monitors for sure,
> > but an embedded DSI state machine can be slow, as it
> > turns out.
> > 
> > Tell me if this should be a per-driver variable and I
> > will think of something.
> > ---
> >  drivers/gpu/drm/drm_atomic_helper.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> > index 40ac19848034..f0aa7b195d79 100644
> > --- a/drivers/gpu/drm/drm_atomic_helper.c
> > +++ b/drivers/gpu/drm/drm_atomic_helper.c
> > @@ -1424,7 +1424,7 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
> >  		ret = wait_event_timeout(dev->vblank[i].queue,
> >  				old_state->crtcs[i].last_vblank_count !=
> >  					drm_crtc_vblank_count(crtc),
> > -				msecs_to_jiffies(50));
> > +				msecs_to_jiffies(100));
> 
> 50ms is pretty tight for 24Hz as well. I suppose we could make this
> depend on the expected frame/field duration, but it's generally
> indicative of a programming error of some sort, so as long as it's
> long enough I think we're good.
> 
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Yeah makes sense to bump this a bit. An uber-fancy version would look at
the programmed refresh rate and maybe give the driver extra slack for the
first frame after a modeset. But this is good enough.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> 
> >  
> >  		WARN(!ret, "[CRTC:%d:%s] vblank wait timed out\n",
> >  		     crtc->base.id, crtc->name);
> > -- 
> > 2.20.1
> 
> -- 
> Ville Syrjälä
> Intel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2019-04-30 14:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30  9:37 [PATCH] drm/atomic-helper: Bump vblank timeout to 100 ms Linus Walleij
2019-04-30 10:44 ` Ville Syrjälä
2019-04-30 14:43   ` Daniel Vetter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190430144329.GZ3271@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sam@ravnborg.org \
    --cc=seanpaul@chromium.org \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox