[Intel-gfx] [PATCH v2 5/5] drm/i915: Show the current i915_params in debugfs/i915_capabilites
Chris Wilson
chris at chris-wilson.co.uk
Thu Feb 2 08:55:13 UTC 2017
Alongside the hw capabilities, it is useful to know which of those have
been overridden by the user setting module parameters.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_debugfs.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 3ae06568df7b..1568cc4286c0 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -61,6 +61,21 @@ drm_add_fake_info_node(struct drm_minor *minor,
return 0;
}
+static void seq_param_bool(struct seq_file *m, const char *name, param_bool x)
+{
+ seq_printf(m, "i915.%s=%s\n", name, yesno(x));
+}
+
+static void seq_param_int(struct seq_file *m, const char *name, param_int x)
+{
+ seq_printf(m, "i915.%s=%d\n", name, x);
+}
+
+static void seq_param_uint(struct seq_file *m, const char *name, param_uint x)
+{
+ seq_printf(m, "i915.%s=%u\n", name, x);
+}
+
static int i915_capabilities(struct seq_file *m, void *data)
{
struct drm_i915_private *dev_priv = node_to_i915(m->private);
@@ -69,10 +84,15 @@ static int i915_capabilities(struct seq_file *m, void *data)
seq_printf(m, "gen: %d\n", INTEL_GEN(dev_priv));
seq_printf(m, "platform: %s\n", intel_platform_name(info->platform));
seq_printf(m, "pch: %d\n", INTEL_PCH_TYPE(dev_priv));
+
#define PRINT_FLAG(x) seq_printf(m, #x ": %s\n", yesno(info->x))
DEV_INFO_FOR_EACH_FLAG(PRINT_FLAG);
#undef PRINT_FLAG
+#define PRINT(T, x) seq_##T(m, #x, i915.x);
+ I915_PARAMS_FOR_EACH(PRINT);
+#undef PRINT
+
return 0;
}
--
2.11.0
More information about the Intel-gfx
mailing list