[PATCH 12/13] drm/i915: Show the current i915_params in debugfs/i915_capabilites

Chris Wilson chris at chris-wilson.co.uk
Sat Feb 4 20:11:45 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>
Acked-by: Jani Nikula <jani.nikula at intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 3ae06568df7b..b57520d8b3b3 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -61,6 +61,24 @@ drm_add_fake_info_node(struct drm_minor *minor,
 	return 0;
 }
 
+__maybe_unused
+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));
+}
+
+__maybe_unused
+static void seq_param_int(struct seq_file *m, const char *name, param_int x)
+{
+	seq_printf(m, "i915.%s=%d\n", name, x);
+}
+
+__maybe_unused
+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 +87,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-trybot mailing list