dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/core: Add drm_accurate_vblank_count_and_time.
Date: Wed, 30 Mar 2016 15:41:26 +0200	[thread overview]
Message-ID: <56FBD786.3020602@linux.intel.com> (raw)
In-Reply-To: <20160330131316.GK4329@intel.com>

Op 30-03-16 om 15:13 schreef Ville Syrjälä:
> On Tue, Mar 29, 2016 at 03:38:55PM +0200, Maarten Lankhorst wrote:
>> This function is useful for gen2 intel devices which have no frame
>> counter, but need a way to determine the current vblank count without
>> racing with the vblank interrupt handler.
>>
>> intel_pipe_update_start checks if no vblank interrupt will occur
>> during vblank evasion, but cannot check whether the vblank handler has
>> run to completion. This function uses the timestamps to determine
>> when the last vblank has happened, and interpolates from there.
> Didn't really read it in detail, but on a glance it seems too
> complicated to me. All we should really need is something like this:
>
> drm_vblank_get();
> drm_update_vblank_count();
> accurate = drm_vblank_count();
>
Updating from non vblank irq context might cause the vblank clock to drift, or at least contend the vblank lock.

This is why I call drm_vblank_count_and_time, and then interpolate as if update_vblank_count was called on the result.

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

  reply	other threads:[~2016-03-30 13:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29 13:38 [PATCH] drm/core: Add drm_accurate_vblank_count_and_time Maarten Lankhorst
2016-03-30 13:13 ` Ville Syrjälä
2016-03-30 13:41   ` Maarten Lankhorst [this message]
2016-03-30 13:45     ` Ville Syrjälä
2016-04-11  9:42       ` [PATCH v2] drm/core: Add drm_accurate_vblank_count_and_time, v2 Maarten Lankhorst
2016-04-11 14:43         ` Ville Syrjälä
2016-04-11 15:06           ` Maarten Lankhorst
2016-04-11 15:17             ` Ville Syrjälä
2016-04-12 14:32               ` [PATCH v3] drm/core: Add drm_accurate_vblank_count, v3 Maarten Lankhorst
2016-04-12 15:03                 ` Ville Syrjälä
2016-04-12 16:43                 ` [Intel-gfx] " kbuild test robot

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=56FBD786.3020602@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.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