@@ -76,6 +76,13 @@ 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 void seq_param_charp(struct seq_file *m, const char *name, param_charp x)
+{
+ kernel_param_lock(THIS_MODULE);
+ seq_printf(m, "i915.%s=%s\n", name, x);
+ kernel_param_unlock(THIS_MODULE);
+}
+
static int i915_capabilities(struct seq_file *m, void *data)
{
struct drm_i915_private *dev_priv = node_to_i915(m->private);
@@ -567,6 +567,15 @@ static void err_param_uint(struct drm_i915_error_state_buf *m,
err_printf(m, "%s: %u\n", name, x);
}
+static void err_param_charp(struct drm_i915_error_state_buf *m,
+ const char *name,
+ param_charp x)
+{
+ kernel_param_lock(THIS_MODULE);
+ err_printf(m, "%s: %s\n", name, x);
+ kernel_param_unlock(THIS_MODULE);
+}
+
static void err_print_params(struct drm_i915_error_state_buf *m,
const struct i915_params *p)
{
@@ -65,6 +65,8 @@ struct i915_params i915 __read_mostly = {
.enable_gvt = false,
};
+module_param_named_unsafe(my_string, i915.my_string, charp, 0400);
+
module_param_named(modeset, i915.modeset, int, 0400);
MODULE_PARM_DESC(modeset,
"Use kernel modesetting [KMS] (0=disable, "
@@ -30,6 +30,7 @@
typedef bool param_bool;
typedef int param_int;
typedef unsigned int param_uint;
+typedef char *param_charp;
#define I915_PARAMS_FOR_EACH(func) \
func(param_int, modeset); \
@@ -54,6 +55,7 @@ typedef unsigned int param_uint;
func(param_int, mmio_debug); \
func(param_int, edp_vswing); \
func(param_uint, inject_load_failure); \
+ func(param_charp, my_string); \
/* leave bools at the end to not create holes */ \
func(param_bool, alpha_support); \
func(param_bool, enable_cmd_parser); \