[Intel-gfx] [PATCH 9/9] drm/i915: PSR: Expose wakeup time.

Daniel Vetter daniel at ffwll.ch
Wed Jan 14 16:55:47 PST 2015


On Mon, Jan 12, 2015 at 10:14:36AM -0800, Rodrigo Vivi wrote:
> This will be useful for automated test to know for how long to wait for PSR
> to comeback before time out.
>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 2 ++
>  drivers/gpu/drm/i915/i915_drv.h     | 1 +
>  drivers/gpu/drm/i915/intel_psr.c    | 5 +++--
>  3 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 0d11cbe..8823867 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -2250,6 +2250,8 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)
>
>   seq_printf(m, "Link standby: %s\n",
>     yesno((bool)dev_priv->psr.link_standby));
> + seq_printf(m, "Wakeup time: %d ms\n",
> +   dev_priv->psr.wakeup_time);
>
>   /* CHV PSR has no kind of performance counter */
>   if (HAS_PSR(dev) && HAS_DDI(dev)) {
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index b4f01b4..4b1d07d 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -790,6 +790,7 @@ struct i915_psr {
>   struct delayed_work work;
>   unsigned busy_frontbuffer_bits;
>   bool link_standby;
> + int wakeup_time;
>  };
>
>  enum intel_pch {
> diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
> index d1c2c31..3838921 100644
> --- a/drivers/gpu/drm/i915/intel_psr.c
> +++ b/drivers/gpu/drm/i915/intel_psr.c
> @@ -606,7 +606,8 @@ void intel_psr_flush(struct drm_device *dev,
>   bool link_on = dev_priv->psr.link_standby;
>   int tp = 100 * dev_priv->vbt.psr.tp2_tp3_wakeup_time +
>   100 * dev_priv->vbt.psr.tp1_wakeup_time;
> - int delay = tp && !link_on ? tp : 100;
> +
> + dev_priv->psr.wakeup_time = tp && !link_on ? tp : 100;

Recomputing this on every flush looks a bit strange. Especially since it
means we have this kind of one-time computations at different places. Imo
that should all be consolidated (probably best in the psr_enable
funcions). I'll wait for a resend for this and patch 8 (and the naming
unconfusion+kerneldoc patch), all others merged.

Thanks, Daniel
>
>   mutex_lock(&dev_priv->psr.lock);
>   if (!dev_priv->psr.enabled) {
> @@ -639,7 +640,7 @@ void intel_psr_flush(struct drm_device *dev,
>
>   if (!dev_priv->psr.active && !dev_priv->psr.busy_frontbuffer_bits)
>   schedule_delayed_work(&dev_priv->psr.work,
> -      msecs_to_jiffies(delay));
> +      msecs_to_jiffies(dev_priv->psr.wakeup_time));
>   mutex_unlock(&dev_priv->psr.lock);
>  }
>
> --
> 2.1.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


More information about the Intel-gfx mailing list