@@ -61,6 +61,21 @@ drm_add_fake_info_node(struct drm_minor *minor,
61
61
return 0 ;
62
62
}
63
63
64
+ static __always_inline void seq_print_param (struct seq_file * m ,
65
+ const char * name ,
66
+ const char * type ,
67
+ const void * x )
68
+ {
69
+ if (!__builtin_strcmp (type , "bool" ))
70
+ seq_printf (m , "i915.%s=%s\n" , name , yesno (* (const bool * )x ));
71
+ else if (!__builtin_strcmp (type , "int" ))
72
+ seq_printf (m , "i915.%s=%d\n" , name , * (const int * )x );
73
+ else if (!__builtin_strcmp (type , "unsigned int" ))
74
+ seq_printf (m , "i915.%s=%u\n" , name , * (const unsigned int * )x );
75
+ else
76
+ BUILD_BUG ();
77
+ }
78
+
64
79
static int i915_capabilities (struct seq_file * m , void * data )
65
80
{
66
81
struct drm_i915_private * dev_priv = node_to_i915 (m -> private );
@@ -69,10 +84,17 @@ static int i915_capabilities(struct seq_file *m, void *data)
69
84
seq_printf (m , "gen: %d\n" , INTEL_GEN (dev_priv ));
70
85
seq_printf (m , "platform: %s\n" , intel_platform_name (info -> platform ));
71
86
seq_printf (m , "pch: %d\n" , INTEL_PCH_TYPE (dev_priv ));
87
+
72
88
#define PRINT_FLAG (x ) seq_printf(m, #x ": %s\n", yesno(info->x))
73
89
DEV_INFO_FOR_EACH_FLAG (PRINT_FLAG );
74
90
#undef PRINT_FLAG
75
91
92
+ kernel_param_lock (THIS_MODULE );
93
+ #define PRINT_PARAM (T , x ) seq_print_param(m, #x, #T, &i915.x);
94
+ I915_PARAMS_FOR_EACH (PRINT_PARAM );
95
+ #undef PRINT_PARAM
96
+ kernel_param_unlock (THIS_MODULE );
97
+
76
98
return 0 ;
77
99
}
78
100
0 commit comments