intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/5] drm/i915: Generate i915_params {} using a macro
@ 2017-02-02  8:55 Chris Wilson
  2017-02-02  8:55 ` [PATCH v2 2/5] drm/i915: Convert i915_params to use shortnames for its types Chris Wilson
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Chris Wilson @ 2017-02-02  8:55 UTC (permalink / raw)
  To: intel-gfx

I want to print the struct from the error state and so would like to use
the existing struct definition as the template ala DEV_INFO*

v2: Use MEMBER() rather than p().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_params.h | 81 ++++++++++++++++++++------------------
 1 file changed, 43 insertions(+), 38 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index 8e433de04679..9a8c60342a82 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -27,46 +27,51 @@
 
 #include <linux/cache.h> /* for __read_mostly */
 
+#define I915_PARAMS_FOR_EACH(func) \
+	func(int, modeset); \
+	func(int, panel_ignore_lid); \
+	func(int, semaphores); \
+	func(int, lvds_channel_mode); \
+	func(int, panel_use_ssc); \
+	func(int, vbt_sdvo_panel_type); \
+	func(int, enable_rc6); \
+	func(int, enable_dc); \
+	func(int, enable_fbc); \
+	func(int, enable_ppgtt); \
+	func(int, enable_execlists); \
+	func(int, enable_psr); \
+	func(unsigned int, alpha_support); \
+	func(int, disable_power_well); \
+	func(int, enable_ips); \
+	func(int, invert_brightness); \
+	func(int, enable_guc_loading); \
+	func(int, enable_guc_submission); \
+	func(int, guc_log_level); \
+	func(int, use_mmio_flip); \
+	func(int, mmio_debug); \
+	func(int, edp_vswing); \
+	func(unsigned int, inject_load_failure); \
+	/* leave bools at the end to not create holes */ \
+	func(bool, enable_cmd_parser); \
+	func(bool, enable_hangcheck); \
+	func(bool, fastboot); \
+	func(bool, prefault_disable); \
+	func(bool, load_detect_test); \
+	func(bool, force_reset_modeset_test); \
+	func(bool, reset); \
+	func(bool, error_capture); \
+	func(bool, disable_display); \
+	func(bool, verbose_state_checks); \
+	func(bool, nuclear_pageflip); \
+	func(bool, enable_dp_mst); \
+	func(bool, enable_dpcd_backlight); \
+	func(bool, enable_gvt)
+
+#define MEMBER(T, member) T member
 struct i915_params {
-	int modeset;
-	int panel_ignore_lid;
-	int semaphores;
-	int lvds_channel_mode;
-	int panel_use_ssc;
-	int vbt_sdvo_panel_type;
-	int enable_rc6;
-	int enable_dc;
-	int enable_fbc;
-	int enable_ppgtt;
-	int enable_execlists;
-	int enable_psr;
-	unsigned int alpha_support;
-	int disable_power_well;
-	int enable_ips;
-	int invert_brightness;
-	int enable_guc_loading;
-	int enable_guc_submission;
-	int guc_log_level;
-	int use_mmio_flip;
-	int mmio_debug;
-	int edp_vswing;
-	unsigned int inject_load_failure;
-	/* leave bools at the end to not create holes */
-	bool enable_cmd_parser;
-	bool enable_hangcheck;
-	bool fastboot;
-	bool prefault_disable;
-	bool load_detect_test;
-	bool force_reset_modeset_test;
-	bool reset;
-	bool error_capture;
-	bool disable_display;
-	bool verbose_state_checks;
-	bool nuclear_pageflip;
-	bool enable_dp_mst;
-	bool enable_dpcd_backlight;
-	bool enable_gvt;
+	I915_PARAMS_FOR_EACH(MEMBER);
 };
+#undef MEMBER
 
 extern struct i915_params i915 __read_mostly;
 
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 2/5] drm/i915: Convert i915_params to use shortnames for its types
  2017-02-02  8:55 [PATCH v2 1/5] drm/i915: Generate i915_params {} using a macro Chris Wilson
@ 2017-02-02  8:55 ` Chris Wilson
  2017-02-06  8:39   ` Joonas Lahtinen
  2017-02-02  8:55 ` [PATCH v2 3/5] drm/i915: Use bool i915_param.alpha_support Chris Wilson
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: Chris Wilson @ 2017-02-02  8:55 UTC (permalink / raw)
  To: intel-gfx

In order to specialise a pretty printer for different types of module
parameters using macro construction, the type names must be a single
word. Use typedefs to construct the parameters using the modparams type
shortnames.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_params.h | 78 ++++++++++++++++++++------------------
 1 file changed, 41 insertions(+), 37 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index 9a8c60342a82..668f88a79842 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -27,45 +27,49 @@
 
 #include <linux/cache.h> /* for __read_mostly */
 
+typedef bool param_bool;
+typedef int param_int;
+typedef unsigned int param_uint;
+
 #define I915_PARAMS_FOR_EACH(func) \
-	func(int, modeset); \
-	func(int, panel_ignore_lid); \
-	func(int, semaphores); \
-	func(int, lvds_channel_mode); \
-	func(int, panel_use_ssc); \
-	func(int, vbt_sdvo_panel_type); \
-	func(int, enable_rc6); \
-	func(int, enable_dc); \
-	func(int, enable_fbc); \
-	func(int, enable_ppgtt); \
-	func(int, enable_execlists); \
-	func(int, enable_psr); \
-	func(unsigned int, alpha_support); \
-	func(int, disable_power_well); \
-	func(int, enable_ips); \
-	func(int, invert_brightness); \
-	func(int, enable_guc_loading); \
-	func(int, enable_guc_submission); \
-	func(int, guc_log_level); \
-	func(int, use_mmio_flip); \
-	func(int, mmio_debug); \
-	func(int, edp_vswing); \
-	func(unsigned int, inject_load_failure); \
+	func(param_int, modeset); \
+	func(param_int, panel_ignore_lid); \
+	func(param_int, semaphores); \
+	func(param_int, lvds_channel_mode); \
+	func(param_int, panel_use_ssc); \
+	func(param_int, vbt_sdvo_panel_type); \
+	func(param_int, enable_rc6); \
+	func(param_int, enable_dc); \
+	func(param_int, enable_fbc); \
+	func(param_int, enable_ppgtt); \
+	func(param_int, enable_execlists); \
+	func(param_int, enable_psr); \
+	func(param_uint, alpha_support); \
+	func(param_int, disable_power_well); \
+	func(param_int, enable_ips); \
+	func(param_int, invert_brightness); \
+	func(param_int, enable_guc_loading); \
+	func(param_int, enable_guc_submission); \
+	func(param_int, guc_log_level); \
+	func(param_int, use_mmio_flip); \
+	func(param_int, mmio_debug); \
+	func(param_int, edp_vswing); \
+	func(param_uint, inject_load_failure); \
 	/* leave bools at the end to not create holes */ \
-	func(bool, enable_cmd_parser); \
-	func(bool, enable_hangcheck); \
-	func(bool, fastboot); \
-	func(bool, prefault_disable); \
-	func(bool, load_detect_test); \
-	func(bool, force_reset_modeset_test); \
-	func(bool, reset); \
-	func(bool, error_capture); \
-	func(bool, disable_display); \
-	func(bool, verbose_state_checks); \
-	func(bool, nuclear_pageflip); \
-	func(bool, enable_dp_mst); \
-	func(bool, enable_dpcd_backlight); \
-	func(bool, enable_gvt)
+	func(param_bool, enable_cmd_parser); \
+	func(param_bool, enable_hangcheck); \
+	func(param_bool, fastboot); \
+	func(param_bool, prefault_disable); \
+	func(param_bool, load_detect_test); \
+	func(param_bool, force_reset_modeset_test); \
+	func(param_bool, reset); \
+	func(param_bool, error_capture); \
+	func(param_bool, disable_display); \
+	func(param_bool, verbose_state_checks); \
+	func(param_bool, nuclear_pageflip); \
+	func(param_bool, enable_dp_mst); \
+	func(param_bool, enable_dpcd_backlight); \
+	func(param_bool, enable_gvt)
 
 #define MEMBER(T, member) T member
 struct i915_params {
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 3/5] drm/i915: Use bool i915_param.alpha_support
  2017-02-02  8:55 [PATCH v2 1/5] drm/i915: Generate i915_params {} using a macro Chris Wilson
  2017-02-02  8:55 ` [PATCH v2 2/5] drm/i915: Convert i915_params to use shortnames for its types Chris Wilson
@ 2017-02-02  8:55 ` Chris Wilson
  2017-02-03 19:29   ` Vivi, Rodrigo
  2017-02-02  8:55 ` [PATCH v2 4/5] drm/i915: Capture module parameters for the GPU error state Chris Wilson
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: Chris Wilson @ 2017-02-02  8:55 UTC (permalink / raw)
  To: intel-gfx; +Cc: Jani Nikula, Daniel Vetter, Rodrigo Vivi

The alpha_support module option can only take one of two values, so
assign it to a boolean type. The only advantage is in pretty printing
via /sys/module/i915/parameters/alpha_support and elsewhere.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_params.c | 2 +-
 drivers/gpu/drm/i915/i915_params.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index 0e280fbd52f1..c2679fa7ed11 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -145,7 +145,7 @@ MODULE_PARM_DESC(enable_psr, "Enable PSR "
 		 "(0=disabled, 1=enabled - link mode chosen per-platform, 2=force link-standby mode, 3=force link-off mode) "
 		 "Default: -1 (use per-chip default)");
 
-module_param_named_unsafe(alpha_support, i915.alpha_support, int, 0400);
+module_param_named_unsafe(alpha_support, i915.alpha_support, bool, 0400);
 MODULE_PARM_DESC(alpha_support,
 	"Enable alpha quality driver support for latest hardware. "
 	"See also CONFIG_DRM_I915_ALPHA_SUPPORT.");
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index 668f88a79842..87ac6ed995d3 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -44,7 +44,6 @@ typedef unsigned int param_uint;
 	func(param_int, enable_ppgtt); \
 	func(param_int, enable_execlists); \
 	func(param_int, enable_psr); \
-	func(param_uint, alpha_support); \
 	func(param_int, disable_power_well); \
 	func(param_int, enable_ips); \
 	func(param_int, invert_brightness); \
@@ -56,6 +55,7 @@ typedef unsigned int param_uint;
 	func(param_int, edp_vswing); \
 	func(param_uint, inject_load_failure); \
 	/* leave bools at the end to not create holes */ \
+	func(param_bool, alpha_support); \
 	func(param_bool, enable_cmd_parser); \
 	func(param_bool, enable_hangcheck); \
 	func(param_bool, fastboot); \
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 4/5] drm/i915: Capture module parameters for the GPU error state
  2017-02-02  8:55 [PATCH v2 1/5] drm/i915: Generate i915_params {} using a macro Chris Wilson
  2017-02-02  8:55 ` [PATCH v2 2/5] drm/i915: Convert i915_params to use shortnames for its types Chris Wilson
  2017-02-02  8:55 ` [PATCH v2 3/5] drm/i915: Use bool i915_param.alpha_support Chris Wilson
@ 2017-02-02  8:55 ` Chris Wilson
  2017-02-02  8:55 ` [PATCH v2 5/5] drm/i915: Show the current i915_params in debugfs/i915_capabilites Chris Wilson
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2017-02-02  8:55 UTC (permalink / raw)
  To: intel-gfx

They include useful material such as what mode the VM address space is
running in, what submission mode, extra quirks, etc.

v2: Undef the right macro, use type specific pretty printers

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> #v1
---
 drivers/gpu/drm/i915/i915_drv.h       |  1 +
 drivers/gpu/drm/i915/i915_gpu_error.c | 48 ++++++++++++++++++++++++++++++-----
 2 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 15b6c75ebade..5bcde9395126 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -904,6 +904,7 @@ struct drm_i915_error_state {
 	u32 reset_count;
 	u32 suspend_count;
 	struct intel_device_info device_info;
+	struct i915_params params;
 
 	/* Generic register state */
 	u32 eir;
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 5283fe815a4d..58b6296372bf 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -546,6 +546,35 @@ static void err_print_capabilities(struct drm_i915_error_state_buf *m,
 #undef PRINT_FLAG
 }
 
+static void err_param_bool(struct drm_i915_error_state_buf *m,
+			   const char *name,
+			   param_bool x)
+{
+	err_printf(m, "%s: %s\n", name, yesno(x));
+}
+
+static void err_param_int(struct drm_i915_error_state_buf *m,
+			  const char *name,
+			  param_int x)
+{
+	err_printf(m, "%s: %d\n", name, x);
+}
+
+static void err_param_uint(struct drm_i915_error_state_buf *m,
+			   const char *name,
+			   param_uint x)
+{
+	err_printf(m, "%s: %u\n", name, x);
+}
+
+static void err_print_params(struct drm_i915_error_state_buf *m,
+			     const struct i915_params *p)
+{
+#define PRINT(T, x) err_##T(m, #x, p->x);
+	I915_PARAMS_FOR_EACH(PRINT);
+#undef PRINT
+}
+
 int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 			    const struct i915_error_state_file_priv *error_priv)
 {
@@ -568,7 +597,6 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 		   error->boottime.tv_sec, error->boottime.tv_usec);
 	err_printf(m, "Uptime: %ld s %ld us\n",
 		   error->uptime.tv_sec, error->uptime.tv_usec);
-	err_print_capabilities(m, &error->device_info);
 
 	for (i = 0; i < ARRAY_SIZE(error->engine); i++) {
 		if (error->engine[i].hangcheck_stalled &&
@@ -588,6 +616,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 	err_printf(m, "PCI Subsystem: %04x:%04x\n",
 		   pdev->subsystem_vendor,
 		   pdev->subsystem_device);
+
 	err_printf(m, "IOMMU enabled?: %d\n", error->iommu);
 
 	if (HAS_CSR(dev_priv)) {
@@ -730,6 +759,9 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 	if (error->display)
 		intel_display_print_error_state(m, dev_priv, error->display);
 
+	err_print_capabilities(m, &error->device_info);
+	err_print_params(m, &error->params);
+
 out:
 	if (m->bytes == 0 && m->err)
 		return m->err;
@@ -1587,6 +1619,14 @@ static int capture(void *data)
 {
 	struct drm_i915_error_state *error = data;
 
+	do_gettimeofday(&error->time);
+	error->boottime = ktime_to_timeval(ktime_get_boottime());
+	error->uptime =
+		ktime_to_timeval(ktime_sub(ktime_get(),
+					   error->i915->gt.last_init_time));
+
+	error->params = i915;
+
 	i915_capture_gen_state(error->i915, error);
 	i915_capture_reg_state(error->i915, error);
 	i915_gem_record_fences(error->i915, error);
@@ -1595,12 +1635,6 @@ static int capture(void *data)
 	i915_capture_pinned_buffers(error->i915, error);
 	i915_gem_capture_guc_log_buffer(error->i915, error);
 
-	do_gettimeofday(&error->time);
-	error->boottime = ktime_to_timeval(ktime_get_boottime());
-	error->uptime =
-		ktime_to_timeval(ktime_sub(ktime_get(),
-					   error->i915->gt.last_init_time));
-
 	error->overlay = intel_overlay_capture_error_state(error->i915);
 	error->display = intel_display_capture_error_state(error->i915);
 
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 5/5] drm/i915: Show the current i915_params in debugfs/i915_capabilites
  2017-02-02  8:55 [PATCH v2 1/5] drm/i915: Generate i915_params {} using a macro Chris Wilson
                   ` (2 preceding siblings ...)
  2017-02-02  8:55 ` [PATCH v2 4/5] drm/i915: Capture module parameters for the GPU error state Chris Wilson
@ 2017-02-02  8:55 ` Chris Wilson
  2017-02-02  9:24 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/5] drm/i915: Generate i915_params {} using a macro Patchwork
  2017-02-02  9:37 ` [PATCH v2 1/5] " Jani Nikula
  5 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2017-02-02  8:55 UTC (permalink / raw)
  To: intel-gfx

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@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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* ✓ Fi.CI.BAT: success for series starting with [v2,1/5] drm/i915: Generate i915_params {} using a macro
  2017-02-02  8:55 [PATCH v2 1/5] drm/i915: Generate i915_params {} using a macro Chris Wilson
                   ` (3 preceding siblings ...)
  2017-02-02  8:55 ` [PATCH v2 5/5] drm/i915: Show the current i915_params in debugfs/i915_capabilites Chris Wilson
@ 2017-02-02  9:24 ` Patchwork
  2017-02-02  9:37 ` [PATCH v2 1/5] " Jani Nikula
  5 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2017-02-02  9:24 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [v2,1/5] drm/i915: Generate i915_params {} using a macro
URL   : https://patchwork.freedesktop.org/series/18973/
State : success

== Summary ==

Series 18973v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/18973/revisions/1/mbox/


fi-bdw-5557u     total:247  pass:233  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050     total:247  pass:208  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:247  pass:225  dwarn:0   dfail:0   fail:0   skip:22 
fi-bxt-t5700     total:78   pass:65   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900     total:247  pass:220  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:247  pass:216  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:247  pass:228  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r     total:247  pass:228  dwarn:0   dfail:0   fail:0   skip:19 
fi-ivb-3520m     total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770      total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u     total:247  pass:224  dwarn:0   dfail:0   fail:2   skip:21 
fi-skl-6260u     total:247  pass:234  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hq    total:247  pass:227  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k     total:247  pass:222  dwarn:4   dfail:0   fail:0   skip:21 
fi-skl-6770hq    total:247  pass:234  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m     total:247  pass:216  dwarn:0   dfail:0   fail:0   skip:31 
fi-snb-2600      total:247  pass:215  dwarn:0   dfail:0   fail:0   skip:32 

a0cc425b0034c42eb3830f7dd612ac2a132a874c drm-tip: 2017y-02m-01d-17h-17m-34s UTC integration manifest
4f19807 drm/i915: Show the current i915_params in debugfs/i915_capabilites
8819d2b drm/i915: Capture module parameters for the GPU error state
9afd98b drm/i915: Use bool i915_param.alpha_support
9e99506 drm/i915: Convert i915_params to use shortnames for its types
e80e338 drm/i915: Generate i915_params {} using a macro

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3671/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 1/5] drm/i915: Generate i915_params {} using a macro
  2017-02-02  8:55 [PATCH v2 1/5] drm/i915: Generate i915_params {} using a macro Chris Wilson
                   ` (4 preceding siblings ...)
  2017-02-02  9:24 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/5] drm/i915: Generate i915_params {} using a macro Patchwork
@ 2017-02-02  9:37 ` Jani Nikula
  2017-02-02 10:04   ` Chris Wilson
  5 siblings, 1 reply; 10+ messages in thread
From: Jani Nikula @ 2017-02-02  9:37 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

On Thu, 02 Feb 2017, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> I want to print the struct from the error state and so would like to use
> the existing struct definition as the template ala DEV_INFO*
>
> v2: Use MEMBER() rather than p().
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

I've been telling everyone who complains about testing specific firmware
blob versions to add a module parameter to specify and override the
default filename. AFAICT this series does not make string parameters any
harder, but please do double check. I think they expect a static
allocation for the string buffer too, so the struct assignment should be
fine as well.

On the series,

Acked-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/i915_params.h | 81 ++++++++++++++++++++------------------
>  1 file changed, 43 insertions(+), 38 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
> index 8e433de04679..9a8c60342a82 100644
> --- a/drivers/gpu/drm/i915/i915_params.h
> +++ b/drivers/gpu/drm/i915/i915_params.h
> @@ -27,46 +27,51 @@
>  
>  #include <linux/cache.h> /* for __read_mostly */
>  
> +#define I915_PARAMS_FOR_EACH(func) \
> +	func(int, modeset); \
> +	func(int, panel_ignore_lid); \
> +	func(int, semaphores); \
> +	func(int, lvds_channel_mode); \
> +	func(int, panel_use_ssc); \
> +	func(int, vbt_sdvo_panel_type); \
> +	func(int, enable_rc6); \
> +	func(int, enable_dc); \
> +	func(int, enable_fbc); \
> +	func(int, enable_ppgtt); \
> +	func(int, enable_execlists); \
> +	func(int, enable_psr); \
> +	func(unsigned int, alpha_support); \
> +	func(int, disable_power_well); \
> +	func(int, enable_ips); \
> +	func(int, invert_brightness); \
> +	func(int, enable_guc_loading); \
> +	func(int, enable_guc_submission); \
> +	func(int, guc_log_level); \
> +	func(int, use_mmio_flip); \
> +	func(int, mmio_debug); \
> +	func(int, edp_vswing); \
> +	func(unsigned int, inject_load_failure); \
> +	/* leave bools at the end to not create holes */ \
> +	func(bool, enable_cmd_parser); \
> +	func(bool, enable_hangcheck); \
> +	func(bool, fastboot); \
> +	func(bool, prefault_disable); \
> +	func(bool, load_detect_test); \
> +	func(bool, force_reset_modeset_test); \
> +	func(bool, reset); \
> +	func(bool, error_capture); \
> +	func(bool, disable_display); \
> +	func(bool, verbose_state_checks); \
> +	func(bool, nuclear_pageflip); \
> +	func(bool, enable_dp_mst); \
> +	func(bool, enable_dpcd_backlight); \
> +	func(bool, enable_gvt)
> +
> +#define MEMBER(T, member) T member
>  struct i915_params {
> -	int modeset;
> -	int panel_ignore_lid;
> -	int semaphores;
> -	int lvds_channel_mode;
> -	int panel_use_ssc;
> -	int vbt_sdvo_panel_type;
> -	int enable_rc6;
> -	int enable_dc;
> -	int enable_fbc;
> -	int enable_ppgtt;
> -	int enable_execlists;
> -	int enable_psr;
> -	unsigned int alpha_support;
> -	int disable_power_well;
> -	int enable_ips;
> -	int invert_brightness;
> -	int enable_guc_loading;
> -	int enable_guc_submission;
> -	int guc_log_level;
> -	int use_mmio_flip;
> -	int mmio_debug;
> -	int edp_vswing;
> -	unsigned int inject_load_failure;
> -	/* leave bools at the end to not create holes */
> -	bool enable_cmd_parser;
> -	bool enable_hangcheck;
> -	bool fastboot;
> -	bool prefault_disable;
> -	bool load_detect_test;
> -	bool force_reset_modeset_test;
> -	bool reset;
> -	bool error_capture;
> -	bool disable_display;
> -	bool verbose_state_checks;
> -	bool nuclear_pageflip;
> -	bool enable_dp_mst;
> -	bool enable_dpcd_backlight;
> -	bool enable_gvt;
> +	I915_PARAMS_FOR_EACH(MEMBER);
>  };
> +#undef MEMBER
>  
>  extern struct i915_params i915 __read_mostly;

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 1/5] drm/i915: Generate i915_params {} using a macro
  2017-02-02  9:37 ` [PATCH v2 1/5] " Jani Nikula
@ 2017-02-02 10:04   ` Chris Wilson
  0 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2017-02-02 10:04 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

On Thu, Feb 02, 2017 at 11:37:06AM +0200, Jani Nikula wrote:
> On Thu, 02 Feb 2017, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > I want to print the struct from the error state and so would like to use
> > the existing struct definition as the template ala DEV_INFO*
> >
> > v2: Use MEMBER() rather than p().
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> 
> I've been telling everyone who complains about testing specific firmware
> blob versions to add a module parameter to specify and override the
> default filename. AFAICT this series does not make string parameters any
> harder, but please do double check. I think they expect a static
> allocation for the string buffer too, so the struct assignment should be
> fine as well.

charp which is the dynamically allocated string might be easier,
certainly for 0400 parameters.

Hmm. Except for copying into the error state, 0600 charp will take a bit
more work (another iterator to kstrdup). 

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 86649610b9eb..2d32dacebeb3 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -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);
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index b8f2b671fc0a..35602935dba8 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -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)
 {
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index f1fa51190dc6..f9cc170577c2 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -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, "
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index 87ac6ed995d3..bc5aea9e3fb6 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -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); \

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 3/5] drm/i915: Use bool i915_param.alpha_support
  2017-02-02  8:55 ` [PATCH v2 3/5] drm/i915: Use bool i915_param.alpha_support Chris Wilson
@ 2017-02-03 19:29   ` Vivi, Rodrigo
  0 siblings, 0 replies; 10+ messages in thread
From: Vivi, Rodrigo @ 2017-02-03 19:29 UTC (permalink / raw)
  To: chris@chris-wilson.co.uk
  Cc: Nikula, Jani, daniel.vetter@ffwll.ch,
	intel-gfx@lists.freedesktop.org

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

On Thu, 2017-02-02 at 08:55 +0000, Chris Wilson wrote:
> The alpha_support module option can only take one of two values, so
> assign it to a boolean type. The only advantage is in pretty printing
> via /sys/module/i915/parameters/alpha_support and elsewhere.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/i915/i915_params.c | 2 +-
>  drivers/gpu/drm/i915/i915_params.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
> index 0e280fbd52f1..c2679fa7ed11 100644
> --- a/drivers/gpu/drm/i915/i915_params.c
> +++ b/drivers/gpu/drm/i915/i915_params.c
> @@ -145,7 +145,7 @@ MODULE_PARM_DESC(enable_psr, "Enable PSR "
>  		 "(0=disabled, 1=enabled - link mode chosen per-platform, 2=force link-standby mode, 3=force link-off mode) "
>  		 "Default: -1 (use per-chip default)");
>  
> -module_param_named_unsafe(alpha_support, i915.alpha_support, int, 0400);
> +module_param_named_unsafe(alpha_support, i915.alpha_support, bool, 0400);
>  MODULE_PARM_DESC(alpha_support,
>  	"Enable alpha quality driver support for latest hardware. "
>  	"See also CONFIG_DRM_I915_ALPHA_SUPPORT.");
> diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
> index 668f88a79842..87ac6ed995d3 100644
> --- a/drivers/gpu/drm/i915/i915_params.h
> +++ b/drivers/gpu/drm/i915/i915_params.h
> @@ -44,7 +44,6 @@ typedef unsigned int param_uint;
>  	func(param_int, enable_ppgtt); \
>  	func(param_int, enable_execlists); \
>  	func(param_int, enable_psr); \
> -	func(param_uint, alpha_support); \
>  	func(param_int, disable_power_well); \
>  	func(param_int, enable_ips); \
>  	func(param_int, invert_brightness); \
> @@ -56,6 +55,7 @@ typedef unsigned int param_uint;
>  	func(param_int, edp_vswing); \
>  	func(param_uint, inject_load_failure); \
>  	/* leave bools at the end to not create holes */ \
> +	func(param_bool, alpha_support); \
>  	func(param_bool, enable_cmd_parser); \
>  	func(param_bool, enable_hangcheck); \
>  	func(param_bool, fastboot); \

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 2/5] drm/i915: Convert i915_params to use shortnames for its types
  2017-02-02  8:55 ` [PATCH v2 2/5] drm/i915: Convert i915_params to use shortnames for its types Chris Wilson
@ 2017-02-06  8:39   ` Joonas Lahtinen
  0 siblings, 0 replies; 10+ messages in thread
From: Joonas Lahtinen @ 2017-02-06  8:39 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

On to, 2017-02-02 at 08:55 +0000, Chris Wilson wrote:
> In order to specialise a pretty printer for different types of module
> parameters using macro construction, the type names must be a single
> word. Use typedefs to construct the parameters using the modparams type
> shortnames.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

We have __builtin_strcmp, so should not be needed.

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-02-06  8:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-02  8:55 [PATCH v2 1/5] drm/i915: Generate i915_params {} using a macro Chris Wilson
2017-02-02  8:55 ` [PATCH v2 2/5] drm/i915: Convert i915_params to use shortnames for its types Chris Wilson
2017-02-06  8:39   ` Joonas Lahtinen
2017-02-02  8:55 ` [PATCH v2 3/5] drm/i915: Use bool i915_param.alpha_support Chris Wilson
2017-02-03 19:29   ` Vivi, Rodrigo
2017-02-02  8:55 ` [PATCH v2 4/5] drm/i915: Capture module parameters for the GPU error state Chris Wilson
2017-02-02  8:55 ` [PATCH v2 5/5] drm/i915: Show the current i915_params in debugfs/i915_capabilites Chris Wilson
2017-02-02  9:24 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/5] drm/i915: Generate i915_params {} using a macro Patchwork
2017-02-02  9:37 ` [PATCH v2 1/5] " Jani Nikula
2017-02-02 10:04   ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).