From: Mario Kleiner <mario.kleiner.de@gmail.com>
To: ville.syrjala@linux.intel.com, dri-devel@lists.freedesktop.org
Cc: Dave Airlie <airlied@redhat.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 12/14] drm: Pass 'flags' from the caller to .get_scanout_position()
Date: Mon, 13 Jan 2014 01:02:56 +0100 [thread overview]
Message-ID: <52D32D30.5090801@gmail.com> (raw)
In-Reply-To: <1383069978-12476-13-git-send-email-ville.syrjala@linux.intel.com>
On 29/10/13 19:06, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Preparation for moving the early vblank IRQ logic into
> radeon_get_crtc_scanoutpos().
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Tiny compile fix needed for this one. The function prototype for
radeon_get_crtc_scanoutpos() is also defined in radeon_drv.c, so it
needs the same update as the one in radeon_mode.h
Other than that
Reviewed-by: mario.kleiner.de@gmail.com
-mario
> ---
> drivers/gpu/drm/drm_irq.c | 2 +-
> drivers/gpu/drm/i915/i915_irq.c | 3 ++-
> drivers/gpu/drm/radeon/radeon_display.c | 7 ++++---
> drivers/gpu/drm/radeon/radeon_mode.h | 1 +
> drivers/gpu/drm/radeon/radeon_pm.c | 2 +-
> include/drm/drmP.h | 2 ++
> 6 files changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> index b5c4d42..b39255f 100644
> --- a/drivers/gpu/drm/drm_irq.c
> +++ b/drivers/gpu/drm/drm_irq.c
> @@ -585,7 +585,7 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc,
> /* Get vertical and horizontal scanout position vpos, hpos,
> * and bounding timestamps stime, etime, pre/post query.
> */
> - vbl_status = dev->driver->get_scanout_position(dev, crtc, &vpos,
> + vbl_status = dev->driver->get_scanout_position(dev, crtc, flags, &vpos,
> &hpos, &stime, &etime);
>
> /* Get correction for CLOCK_MONOTONIC -> CLOCK_REALTIME if
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index f6b3206..70daf3c 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -657,7 +657,8 @@ static bool intel_pipe_in_vblank_locked(struct drm_device *dev, enum pipe pipe)
> }
>
> static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,
> - int *vpos, int *hpos, ktime_t *stime, ktime_t *etime)
> + unsigned int flags, int *vpos, int *hpos,
> + ktime_t *stime, ktime_t *etime)
> {
> struct drm_i915_private *dev_priv = dev->dev_private;
> struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
> diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
> index ccd8751..3581570 100644
> --- a/drivers/gpu/drm/radeon/radeon_display.c
> +++ b/drivers/gpu/drm/radeon/radeon_display.c
> @@ -305,7 +305,7 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id)
> * to complete in this vblank?
> */
> if (update_pending &&
> - (DRM_SCANOUTPOS_VALID & radeon_get_crtc_scanoutpos(rdev->ddev, crtc_id,
> + (DRM_SCANOUTPOS_VALID & radeon_get_crtc_scanoutpos(rdev->ddev, crtc_id, 0,
> &vpos, &hpos, NULL, NULL)) &&
> ((vpos >= (99 * rdev->mode_info.crtcs[crtc_id]->base.hwmode.crtc_vdisplay)/100) ||
> (vpos < 0 && !ASIC_IS_AVIVO(rdev)))) {
> @@ -1544,6 +1544,7 @@ bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
> *
> * \param dev Device to query.
> * \param crtc Crtc to query.
> + * \param flags Flags from caller (DRM_CALLED_FROM_VBLIRQ or 0).
> * \param *vpos Location where vertical scanout position should be stored.
> * \param *hpos Location where horizontal scanout position should go.
> * \param *stime Target location for timestamp taken immediately before
> @@ -1565,8 +1566,8 @@ bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
> * unknown small number of scanlines wrt. real scanout position.
> *
> */
> -int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, int *vpos, int *hpos,
> - ktime_t *stime, ktime_t *etime)
> +int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc, unsigned int flags,
> + int *vpos, int *hpos, ktime_t *stime, ktime_t *etime)
> {
> u32 stat_crtc = 0, vbl = 0, position = 0;
> int vbl_start, vbl_end, vtotal, ret = 0;
> diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h
> index 3bfa910..c4016dc 100644
> --- a/drivers/gpu/drm/radeon/radeon_mode.h
> +++ b/drivers/gpu/drm/radeon/radeon_mode.h
> @@ -758,6 +758,7 @@ extern int radeon_crtc_cursor_move(struct drm_crtc *crtc,
> int x, int y);
>
> extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, int crtc,
> + unsigned int flags,
> int *vpos, int *hpos, ktime_t *stime,
> ktime_t *etime);
>
> diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
> index 98bf63b..a394049 100644
> --- a/drivers/gpu/drm/radeon/radeon_pm.c
> +++ b/drivers/gpu/drm/radeon/radeon_pm.c
> @@ -1468,7 +1468,7 @@ static bool radeon_pm_in_vbl(struct radeon_device *rdev)
> */
> for (crtc = 0; (crtc < rdev->num_crtc) && in_vbl; crtc++) {
> if (rdev->pm.active_crtcs & (1 << crtc)) {
> - vbl_status = radeon_get_crtc_scanoutpos(rdev->ddev, crtc, &vpos, &hpos, NULL, NULL);
> + vbl_status = radeon_get_crtc_scanoutpos(rdev->ddev, crtc, 0, &vpos, &hpos, NULL, NULL);
> if ((vbl_status & DRM_SCANOUTPOS_VALID) &&
> !(vbl_status & DRM_SCANOUTPOS_INVBL))
> in_vbl = false;
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index 14d4046..13c7942 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -840,6 +840,7 @@ struct drm_driver {
> *
> * \param dev DRM device.
> * \param crtc Id of the crtc to query.
> + * \param flags Flags from the caller (DRM_CALLED_FROM_VBLIRQ or 0).
> * \param *vpos Target location for current vertical scanout position.
> * \param *hpos Target location for current horizontal scanout position.
> * \param *stime Target location for timestamp taken immediately before
> @@ -862,6 +863,7 @@ struct drm_driver {
> *
> */
> int (*get_scanout_position) (struct drm_device *dev, int crtc,
> + unsigned int flags,
> int *vpos, int *hpos, ktime_t *stime,
> ktime_t *etime);
>
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2014-01-13 0:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-29 18:06 [PATCH 00/14] drm: Some more vblank timestampi changes ville.syrjala
2013-10-29 18:06 ` [PATCH 01/14] drm: Pass the display mode to drm_calc_timestamping_constants() ville.syrjala
2013-10-29 18:06 ` [PATCH 02/14] drm: Pass the display mode to drm_calc_vbltimestamp_from_scanoutpos() ville.syrjala
2013-10-29 18:06 ` [PATCH 03/14] drm/i915: Kill hwmode save/restore ville.syrjala
2013-10-29 18:06 ` [PATCH 04/14] drm/i915: Call drm_calc_timestamping_constants() earlier ville.syrjala
2013-10-29 18:06 ` [PATCH 05/14] drm: Improve drm_calc_timestamping_constants() documentation ville.syrjala
2013-10-29 18:06 ` [PATCH 06/14] drm: Simplify the math in drm_calc_timestamping_constants() ville.syrjala
2013-10-29 18:06 ` [PATCH 07/14] drm/radeon: Populate crtc_clock in radeon_atom_get_tv_timings() ville.syrjala
2013-10-29 18:06 ` [PATCH 08/14] drm: Use crtc_clock in drm_calc_timestamping_constants() ville.syrjala
2013-10-29 18:06 ` [PATCH 09/14] drm: Change {pixel,line,frame}dur_ns from s64 to int ville.syrjala
2013-10-29 18:06 ` [PATCH 10/14] drm/i915: Fix scanoutpos calculations for interlaced modes ville.syrjala
2013-10-29 18:06 ` [PATCH 11/14] drm: Fix vblank timestamping constants " ville.syrjala
2013-10-29 18:06 ` [PATCH 12/14] drm: Pass 'flags' from the caller to .get_scanout_position() ville.syrjala
2014-01-13 0:02 ` Mario Kleiner [this message]
2013-10-29 18:06 ` [PATCH 13/14] drm/radeon: Move the early vblank IRQ fixup to radeon_get_crtc_scanoutpos() ville.syrjala
2014-01-13 0:22 ` Mario Kleiner
2013-10-29 18:06 ` [PATCH 14/14] drm/i915: Add a kludge for DSL incrementing too late and ISR not working ville.syrjala
2013-11-06 3:46 ` [PATCH 00/14] drm: Some more vblank timestampi changes Dave Airlie
2013-11-29 13:36 ` Ville Syrjälä
2013-11-30 12:51 ` Mario Kleiner
2014-01-12 23:58 ` Mario Kleiner
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=52D32D30.5090801@gmail.com \
--to=mario.kleiner.de@gmail.com \
--cc=airlied@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.