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

Rodrigo Vivi rodrigo.vivi at intel.com
Mon Jan 12 10:14:36 PST 2015


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;
 
 	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



More information about the Intel-gfx mailing list