From: vathsala nagaraju <vathsala.nagaraju@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: rodrigo.vivi@intel.com
Subject: [PATCH 3/3] drm/i915/psr: adds psr2 status to debugfs
Date: Thu, 11 Aug 2016 13:07:52 +0530 [thread overview]
Message-ID: <1470901072-17525-4-git-send-email-vathsala.nagaraju@intel.com> (raw)
In-Reply-To: <1470901072-17525-1-git-send-email-vathsala.nagaraju@intel.com>
Reads from EDP_PSR2_CTL for psr2 and reports
live state of psr2
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: vathsala nagaraju <vathsala.nagaraju@intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 36 ++++++++++++++++++++++++++++++++----
drivers/gpu/drm/i915/i915_reg.h | 2 ++
2 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 83f40e8..cfe238c 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2673,9 +2673,12 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)
seq_printf(m, "Re-enable work scheduled: %s\n",
yesno(work_busy(&dev_priv->psr.work.work)));
- if (HAS_DDI(dev))
- enabled = I915_READ(EDP_PSR_CTL) & EDP_PSR_ENABLE;
- else {
+ if (HAS_DDI(dev)) {
+ if (dev_priv->psr.psr2_support)
+ enabled = I915_READ(EDP_PSR2_CTL) & EDP_PSR2_ENABLE;
+ else
+ enabled = I915_READ(EDP_PSR_CTL) & EDP_PSR_ENABLE;
+ } else {
for_each_pipe(dev_priv, pipe) {
stat[pipe] = I915_READ(VLV_PSRSTAT(pipe)) &
VLV_EDP_PSR_CURR_STATE_MASK;
@@ -2684,7 +2687,6 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)
enabled = true;
}
}
-
seq_printf(m, "Main link in standby mode: %s\n",
yesno(dev_priv->psr.link_standby));
@@ -2708,6 +2710,32 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)
seq_printf(m, "Performance_Counter: %u\n", psrperf);
}
+
+ if (dev_priv->psr.psr2_support) {
+ static const char * const live_status[] = {
+ "idle",
+ "CAPTURE",
+ "CAPTURE_Fs",
+ "SLEEP",
+ "BUFON_FW",
+ "ML_UP",
+ "SU_STANDBY",
+ "FAST_SLEEP",
+ "DEEP_SLEEP",
+ "BUF_ON",
+ "TG_ON" };
+ u8 pos = (I915_READ(EDP_PSR2_STATUS_CTL) &
+ EDP_PSR2_STATUS_STATE_MASK) >>
+ EDP_PSR2_STATUS_STATE_SHIFT;
+
+ seq_printf(m, "PSR2_STATUS_EDP: %x\n",
+ I915_READ(EDP_PSR2_STATUS_CTL));
+
+ if (pos <= EDP_PSR2_STATUS_TG_ON)
+ seq_printf(m, "PSR2 live state %s\n",
+ live_status[pos]);
+ }
+
mutex_unlock(&dev_priv->psr.lock);
intel_runtime_pm_put(dev_priv);
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 49682f5..969d754 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3326,6 +3326,8 @@ enum {
#define EDP_PSR2_STATUS_CTL _MMIO(0x6f940)
#define EDP_PSR2_STATUS_STATE_MASK (0xf<<28)
#define EDP_PSR2_STATUS_STATE_IDLE 0
+#define EDP_PSR2_STATUS_STATE_SHIFT 28
+#define EDP_PSR2_STATUS_TG_ON 0xa
/* VGA port control */
#define ADPA _MMIO(0x61100)
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-08-11 7:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-11 7:37 [PATCH 0/3] Enable PSR2 for idle screen vathsala nagaraju
2016-08-11 7:37 ` [PATCH 1/3] drm/i915/psr:Adds Y-cordinate to skl_psr_setup_vsc vathsala nagaraju
2016-08-11 8:00 ` Ville Syrjälä
2016-08-12 5:18 ` vathsala nagaraju
2016-08-12 6:32 ` Ville Syrjälä
2016-09-19 5:41 ` vathsala nagaraju
2016-08-11 7:37 ` [PATCH 2/3] drm/i915/psr: enable PSR2 for idle screen vathsala nagaraju
2016-08-11 7:37 ` vathsala nagaraju [this message]
2016-08-11 8:04 ` ✗ Ro.CI.BAT: failure for Enable " Patchwork
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=1470901072-17525-4-git-send-email-vathsala.nagaraju@intel.com \
--to=vathsala.nagaraju@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=rodrigo.vivi@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;
as well as URLs for NNTP newsgroup(s).