public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: ville.syrjala@linux.intel.com
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 10/11] drm: Use vblank timestamps to guesstimate how many vblanks were missed
Date: Wed, 30 Sep 2015 16:42:09 +0200	[thread overview]
Message-ID: <20150930144209.GA13408@ulmo.nvidia.com> (raw)
In-Reply-To: <1442259832-23424-11-git-send-email-ville.syrjala@linux.intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 1573 bytes --]

On Mon, Sep 14, 2015 at 10:43:51PM +0300, ville.syrjala@linux.intel.com wrote:
[...]
> @@ -167,7 +238,7 @@ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe,
>  	if (!rc)
>  		t_vblank = (struct timeval) {0, 0};
>  
> -	store_vblank(dev, pipe, diff, &t_vblank);
> +	store_vblank(dev, pipe, diff, &t_vblank, cur_vblank);

I think clearing the t_vblank is now wrong here. This breaks weston on
Tegra (and I think all other drivers that don't implement hardware
VBLANK timestamps). The reason is that if ->get_vblank_timestamp() isn't
implemented, rc will always be false at this point, hence resulting in a
zero VBLANK timestamp being reported to userspace.

In fact the comment, reproduced here because it's not in the patch
context:

	/*
	 * Only reinitialize corresponding vblank timestamp if high-precision query
	 * available and didn't fail. Otherwise reinitialize delayed at next vblank
	 * interrupt and assign 0 for now, to mark the vblanktimestamp as invalid.
	 */

is no longer accurate because this function is now called at the VBLANK
interrupt. If you want to keep invalidating timestamps for drivers that
implement VBLANK timestamp queries I think the condition needs to be
changed to something like:

	if (dev->get_vblank_timestamp && !rc)

and the comment updated to reflect the truth. Alternatively this code
can be removed, though I guess having the monotonic timestamp fallback
would be kind of missing the point.

I've tested either change and they both restore weston on Tegra.

Thierry

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2015-09-30 14:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-14 19:43 [PATCH 00/11] drm: vblank fixes and timestamp based missed vblank guesttimation ville.syrjala
2015-09-14 19:43 ` [PATCH 01/11] drm: s/int crtc/unsigned int pipe/ straggles ville.syrjala
2015-09-15  7:29   ` Thierry Reding
2015-09-22  9:05     ` Daniel Vetter
2015-09-14 19:43 ` [PATCH 02/11] drm: Move timestamping constants into drm_vblank_crtc ville.syrjala
2015-09-16 13:21   ` Maarten Lankhorst
2015-09-14 19:43 ` [PATCH 03/11] drm: Stop using linedur_ns and pixeldur_ns for vblank timestamps ville.syrjala
2015-09-14 19:43 ` [PATCH 04/11] drm: Kill pixeldur_ns ville.syrjala
2015-09-14 19:43 ` [PATCH 05/11] drm/i915: Fix vblank count variable types ville.syrjala
2015-09-14 19:43 ` [PATCH 06/11] drm: Pass flags to drm_update_vblank_count() ville.syrjala
2015-09-14 19:43 ` [PATCH 07/11] drm: Limit the number of .get_vblank_counter() retries ville.syrjala
2015-09-14 19:43 ` [PATCH 08/11] drm: Clean up drm_calc_vbltimestamp_from_scanoutpos() vbl_status ville.syrjala
2015-09-14 19:43 ` [PATCH 09/11] drm: store_vblank() is never called with NULL timestamp ville.syrjala
2015-09-14 19:43 ` [PATCH 10/11] drm: Use vblank timestamps to guesstimate how many vblanks were missed ville.syrjala
2015-09-28  2:57   ` Michel Dänzer
2015-09-30 14:42   ` Thierry Reding [this message]
2015-09-14 19:43 ` [PATCH 11/11] drm: Fix vblank timestamp races ville.syrjala
2015-09-22  9:10   ` Daniel Vetter
2015-09-22 11:15     ` Maarten Lankhorst
2015-09-22 11:31       ` Daniel Vetter
2015-09-22 12:36     ` Ville Syrjälä
2015-09-22 12:57       ` Daniel Vetter

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=20150930144209.GA13408@ulmo.nvidia.com \
    --to=thierry.reding@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.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