aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorMika Kuoppala <mika.kuoppala@linux.intel.com>2015-02-05 11:41:48 -0500
committerJani Nikula <jani.nikula@intel.com>2015-02-09 07:29:36 -0500
commitebbc7546d2099c94ff2ea940ae5ce740e512a66d (patch)
treef3cd76d630f13eac99b037919591bd522b15f9ea /drivers/gpu
parentd180d2bbb66579e3bf449642b8ec2a76f4014fcd (diff)
drm/i915: Take runtime pm reference on hangcheck_info
We read the coherent current seqno and actual head from ring. For hardware access we need to take runtime_pm reference. Get hardware specific values with runtime reference held and print them first to emphasize hw state vs bookkeepping. v2: Reorder output according to hw access (Chris) remove superfluous locking (Daniel) Testcase: igt/pm_rpm/debugfs-read Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88910 Tested-by: Ding Heng <hengx.ding@intel.com> (v1) Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 211d4949a675..96e811fe24ca 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1223,8 +1223,11 @@ out:
1223static int i915_hangcheck_info(struct seq_file *m, void *unused) 1223static int i915_hangcheck_info(struct seq_file *m, void *unused)
1224{ 1224{
1225 struct drm_info_node *node = m->private; 1225 struct drm_info_node *node = m->private;
1226 struct drm_i915_private *dev_priv = to_i915(node->minor->dev); 1226 struct drm_device *dev = node->minor->dev;
1227 struct drm_i915_private *dev_priv = dev->dev_private;
1227 struct intel_engine_cs *ring; 1228 struct intel_engine_cs *ring;
1229 u64 acthd[I915_NUM_RINGS];
1230 u32 seqno[I915_NUM_RINGS];
1228 int i; 1231 int i;
1229 1232
1230 if (!i915.enable_hangcheck) { 1233 if (!i915.enable_hangcheck) {
@@ -1232,6 +1235,15 @@ static int i915_hangcheck_info(struct seq_file *m, void *unused)
1232 return 0; 1235 return 0;
1233 } 1236 }
1234 1237
1238 intel_runtime_pm_get(dev_priv);
1239
1240 for_each_ring(ring, dev_priv, i) {
1241 seqno[i] = ring->get_seqno(ring, false);
1242 acthd[i] = intel_ring_get_active_head(ring);
1243 }
1244
1245 intel_runtime_pm_put(dev_priv);
1246
1235 if (delayed_work_pending(&dev_priv->gpu_error.hangcheck_work)) { 1247 if (delayed_work_pending(&dev_priv->gpu_error.hangcheck_work)) {
1236 seq_printf(m, "Hangcheck active, fires in %dms\n", 1248 seq_printf(m, "Hangcheck active, fires in %dms\n",
1237 jiffies_to_msecs(dev_priv->gpu_error.hangcheck_work.timer.expires - 1249 jiffies_to_msecs(dev_priv->gpu_error.hangcheck_work.timer.expires -
@@ -1242,14 +1254,14 @@ static int i915_hangcheck_info(struct seq_file *m, void *unused)
1242 for_each_ring(ring, dev_priv, i) { 1254 for_each_ring(ring, dev_priv, i) {
1243 seq_printf(m, "%s:\n", ring->name); 1255 seq_printf(m, "%s:\n", ring->name);
1244 seq_printf(m, "\tseqno = %x [current %x]\n", 1256 seq_printf(m, "\tseqno = %x [current %x]\n",
1245 ring->hangcheck.seqno, ring->get_seqno(ring, false)); 1257 ring->hangcheck.seqno, seqno[i]);
1246 seq_printf(m, "\taction = %d\n", ring->hangcheck.action);
1247 seq_printf(m, "\tscore = %d\n", ring->hangcheck.score);
1248 seq_printf(m, "\tACTHD = 0x%08llx [current 0x%08llx]\n", 1258 seq_printf(m, "\tACTHD = 0x%08llx [current 0x%08llx]\n",
1249 (long long)ring->hangcheck.acthd, 1259 (long long)ring->hangcheck.acthd,
1250 (long long)intel_ring_get_active_head(ring)); 1260 (long long)acthd[i]);
1251 seq_printf(m, "\tmax ACTHD = 0x%08llx\n", 1261 seq_printf(m, "\tmax ACTHD = 0x%08llx\n",
1252 (long long)ring->hangcheck.max_acthd); 1262 (long long)ring->hangcheck.max_acthd);
1263 seq_printf(m, "\tscore = %d\n", ring->hangcheck.score);
1264 seq_printf(m, "\taction = %d\n", ring->hangcheck.action);
1253 } 1265 }
1254 1266
1255 return 0; 1267 return 0;