dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 14/16] drm/irq: Add drm_crtc_vblank_count_and_time()
Date: Thu, 24 Sep 2015 20:27:37 +0200	[thread overview]
Message-ID: <20150924182737.GA3383@phenom.ffwll.local> (raw)
In-Reply-To: <1443112538-9616-14-git-send-email-thierry.reding@gmail.com>

On Thu, Sep 24, 2015 at 06:35:36PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> This function is the KMS native variant of drm_vblank_count_and_time().
> It takes a struct drm_crtc * instead of a struct drm_device * and an
> index of the CRTC.
> 
> Eventually the goal is to access vblank data through the CRTC only so
> that the per-CRTC data can be moved to struct drm_crtc.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Applied to drm-misc, thanks.
-Daniel

> ---
>  drivers/gpu/drm/drm_irq.c | 23 +++++++++++++++++++++++
>  include/drm/drmP.h        |  2 ++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> index 525bd82ab514..d81e3724cca3 100644
> --- a/drivers/gpu/drm/drm_irq.c
> +++ b/drivers/gpu/drm/drm_irq.c
> @@ -909,6 +909,8 @@ EXPORT_SYMBOL(drm_crtc_vblank_count);
>   * vblank events since the system was booted, including lost events due to
>   * modesetting activity. Returns corresponding system timestamp of the time
>   * of the vblank interval that corresponds to the current vblank counter value.
> + *
> + * This is the legacy version of drm_crtc_vblank_count_and_time().
>   */
>  u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe,
>  			      struct timeval *vblanktime)
> @@ -936,6 +938,27 @@ u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe,
>  }
>  EXPORT_SYMBOL(drm_vblank_count_and_time);
>  
> +/**
> + * drm_crtc_vblank_count_and_time - retrieve "cooked" vblank counter value
> + *     and the system timestamp corresponding to that vblank counter value
> + * @crtc: which counter to retrieve
> + * @vblanktime: Pointer to struct timeval to receive the vblank timestamp.
> + *
> + * Fetches the "cooked" vblank count value that represents the number of
> + * vblank events since the system was booted, including lost events due to
> + * modesetting activity. Returns corresponding system timestamp of the time
> + * of the vblank interval that corresponds to the current vblank counter value.
> + *
> + * This is the native KMS version of drm_vblank_count_and_time().
> + */
> +u32 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc,
> +				   struct timeval *vblanktime)
> +{
> +	return drm_vblank_count_and_time(crtc->dev, drm_crtc_index(crtc),
> +					 vblanktime);
> +}
> +EXPORT_SYMBOL(drm_crtc_vblank_count_and_time);
> +
>  static void send_vblank_event(struct drm_device *dev,
>  		struct drm_pending_vblank_event *e,
>  		unsigned long seq, struct timeval *now)
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index ce693a1366c1..53960444a423 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -889,6 +889,8 @@ extern u32 drm_vblank_count(struct drm_device *dev, unsigned int pipe);
>  extern u32 drm_crtc_vblank_count(struct drm_crtc *crtc);
>  extern u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe,
>  				     struct timeval *vblanktime);
> +extern u32 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc,
> +					  struct timeval *vblanktime);
>  extern void drm_send_vblank_event(struct drm_device *dev, unsigned int pipe,
>  				  struct drm_pending_vblank_event *e);
>  extern void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
> -- 
> 2.5.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

  reply	other threads:[~2015-09-24 18:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24 16:35 [PATCH 01/16] drm/gma500: Sanity-check pipe index Thierry Reding
2015-09-24 16:35 ` [PATCH 02/16] drm/bochs: Store correct CRTC index in events Thierry Reding
2015-09-24 16:35 ` [PATCH 03/16] drm/imx: Make pipe number unsigned Thierry Reding
2015-09-24 16:35 ` [PATCH 04/16] drm/imx: Drop pipe field from struct imx_drm_crtc Thierry Reding
2015-09-25  7:26   ` Philipp Zabel
2015-09-24 16:35 ` [PATCH 05/16] drm/imx: Store correct CRTC index in events Thierry Reding
2015-09-24 16:35 ` [PATCH 06/16] drm/rockchip: " Thierry Reding
2015-09-24 16:35 ` [PATCH 07/16] drm/sti: " Thierry Reding
2015-10-01 14:06   ` Vincent ABRIOU
2015-09-24 16:35 ` [PATCH 08/16] drm/irq: Rename drm_crtc -> crtc Thierry Reding
2015-09-24 18:17   ` Daniel Vetter
2015-09-24 16:35 ` [PATCH 09/16] drm/irq: Use unsigned int pipe in public API Thierry Reding
2015-09-24 19:21   ` Russell King - ARM Linux
2015-09-24 20:20     ` Ville Syrjälä
2015-09-25  7:39       ` Laurent Pinchart
2015-09-25 12:26       ` Thierry Reding
2015-10-01 14:46   ` Vincent ABRIOU
2015-10-06 10:52   ` Ville Syrjälä
2015-09-24 16:35 ` [PATCH 10/16] drm/gma500: Use unsigned int pipe consistently Thierry Reding
2015-09-24 16:35 ` [PATCH 11/16] drm/imx: Use unsigned int for CRTC index Thierry Reding
2015-09-24 16:35 ` [PATCH 12/16] drm/msm: Use unsigned int pipe consistently Thierry Reding
2015-09-24 16:35 ` [PATCH 13/16] drm: Move ->get_scanout_position() to struct drm_crtc_funcs Thierry Reding
2015-09-24 18:22   ` Daniel Vetter
2015-09-24 16:35 ` [PATCH 14/16] drm/irq: Add drm_crtc_vblank_count_and_time() Thierry Reding
2015-09-24 18:27   ` Daniel Vetter [this message]
2015-09-24 16:35 ` [PATCH 15/16] drm/armada: Use drm_crtc_vblank_*() API Thierry Reding
2015-09-24 16:35 ` [PATCH 16/16] drm/sti: " Thierry Reding
2015-10-01 14:49   ` Vincent ABRIOU

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=20150924182737.GA3383@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=thierry.reding@gmail.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