[Intel-gfx] [PATCH v3 2/2] drm/i915: debugfs for register write taint
Ben Widawsky
ben at bwidawsk.net
Sat Apr 2 01:54:49 CEST 2011
Provide an interface to see which register ranges have been tainted by
the user's interaction.
Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
---
drivers/gpu/drm/i915/i915_debugfs.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 87c8e29..7142a0c 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1186,6 +1186,25 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data)
return 0;
}
+static int i915_user_tainted_info(struct seq_file *m, void *unused)
+{
+ struct drm_info_node *node = (struct drm_info_node *) m->private;
+ struct drm_device *dev = node->minor->dev;
+ drm_i915_private_t *dev_priv = dev->dev_private;
+ struct i915_register_range *range = dev_priv->register_map.map;
+ u32 range_count = dev_priv->register_map.length;
+
+ while(range_count--) {
+ if (range->user_tainted) {
+ seq_printf(m, "tainted register range 0x%08x->0x%08x\n",
+ range->base, range->size);
+ }
+ range++;
+ }
+
+ return 0;
+}
+
static int
i915_wedged_open(struct inode *inode,
struct file *filp)
@@ -1324,6 +1343,7 @@ static struct drm_info_list i915_debugfs_list[] = {
{"i915_sr_status", i915_sr_status, 0},
{"i915_opregion", i915_opregion, 0},
{"i915_gem_framebuffer", i915_gem_framebuffer_info, 0},
+ {"i915_user_tainted", i915_user_tainted_info, 0},
};
#define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list)
--
1.7.3.4
More information about the Intel-gfx
mailing list