* [PATCH 0/3] drm/i915: Misc improvements around module params
@ 2017-06-08 15:07 Michal Wajdeczko
2017-06-08 15:07 ` [PATCH 1/3] drm/i915: Rename i915.panel_use_ssc field to lvds_use_ssc Michal Wajdeczko
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Michal Wajdeczko @ 2017-06-08 15:07 UTC (permalink / raw)
To: intel-gfx
Earlier RFC proposed to extend param macros with default values.
This series goes step further.
Michal Wajdeczko (3):
drm/i915: Rename i915.panel_use_ssc field to lvds_use_ssc
drm/i915: Extend PARAMS_FOR_EACH macro with more data
drm/i915/debugfs: Highlight modified i915 params
drivers/gpu/drm/i915/i915_debugfs.c | 53 ++++++--
drivers/gpu/drm/i915/i915_gpu_error.c | 10 +-
drivers/gpu/drm/i915/i915_params.c | 232 ++--------------------------------
drivers/gpu/drm/i915/i915_params.h | 181 ++++++++++++++++++++------
drivers/gpu/drm/i915/intel_display.c | 4 +-
5 files changed, 195 insertions(+), 285 deletions(-)
--
2.7.4
_______________________________________________
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
* [PATCH 1/3] drm/i915: Rename i915.panel_use_ssc field to lvds_use_ssc
2017-06-08 15:07 [PATCH 0/3] drm/i915: Misc improvements around module params Michal Wajdeczko
@ 2017-06-08 15:07 ` Michal Wajdeczko
2017-06-08 16:03 ` Ville Syrjälä
2017-06-08 15:07 ` [PATCH 2/3] drm/i915: Extend PARAMS_FOR_EACH macro with more data Michal Wajdeczko
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Michal Wajdeczko @ 2017-06-08 15:07 UTC (permalink / raw)
To: intel-gfx
This is the only field from i915_params struct which name does not match
the the name of the param that it is associated with. Lets fix that now
as this will unblock us with further improvements around params defs.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_params.c | 4 ++--
drivers/gpu/drm/i915/i915_params.h | 2 +-
drivers/gpu/drm/i915/intel_display.c | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index b6a7e36..072aaaf 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -30,7 +30,7 @@ struct i915_params i915 __read_mostly = {
.panel_ignore_lid = 1,
.semaphores = -1,
.lvds_channel_mode = 0,
- .panel_use_ssc = -1,
+ .lvds_use_ssc = -1,
.vbt_sdvo_panel_type = -1,
.enable_rc6 = -1,
.enable_dc = -1,
@@ -105,7 +105,7 @@ MODULE_PARM_DESC(lvds_channel_mode,
"Specify LVDS channel mode "
"(0=probe BIOS [default], 1=single-channel, 2=dual-channel)");
-module_param_named_unsafe(lvds_use_ssc, i915.panel_use_ssc, int, 0600);
+module_param_named_unsafe(lvds_use_ssc, i915.lvds_use_ssc, int, 0600);
MODULE_PARM_DESC(lvds_use_ssc,
"Use Spread Spectrum Clock with panels [LVDS/eDP] "
"(default: auto from VBT)");
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index 34148cc..5fa62c2 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -32,7 +32,7 @@
func(int, panel_ignore_lid); \
func(int, semaphores); \
func(int, lvds_channel_mode); \
- func(int, panel_use_ssc); \
+ func(int, lvds_use_ssc); \
func(int, vbt_sdvo_panel_type); \
func(int, enable_rc6); \
func(int, enable_dc); \
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 25390dd..fdd2576 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6345,8 +6345,8 @@ intel_link_compute_m_n(int bits_per_pixel, int nlanes,
static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv)
{
- if (i915.panel_use_ssc >= 0)
- return i915.panel_use_ssc != 0;
+ if (i915.lvds_use_ssc >= 0)
+ return i915.lvds_use_ssc != 0;
return dev_priv->vbt.lvds_use_ssc
&& !(dev_priv->quirks & QUIRK_LVDS_SSC_DISABLE);
}
--
2.7.4
_______________________________________________
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 2/3] drm/i915: Extend PARAMS_FOR_EACH macro with more data
2017-06-08 15:07 [PATCH 0/3] drm/i915: Misc improvements around module params Michal Wajdeczko
2017-06-08 15:07 ` [PATCH 1/3] drm/i915: Rename i915.panel_use_ssc field to lvds_use_ssc Michal Wajdeczko
@ 2017-06-08 15:07 ` Michal Wajdeczko
2017-06-08 15:07 ` [PATCH 3/3] drm/i915/debugfs: Highlight modified i915 params Michal Wajdeczko
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Michal Wajdeczko @ 2017-06-08 15:07 UTC (permalink / raw)
To: intel-gfx
Currently our PARAMS_FOR_EACH macro contains only param type and name.
We use this macro to define struct members, but later on we initialize
this struct using handcrafted code, which leads in some cases to use
mismatched value vs. type. Let's extend our root macro with param
default value to keep them in sync. Also drop ; from the macro to allow
more flexible usages.
v2: Add unsafe tag (Chris)
Add all other data to allow complete automation (Michal)
As we now have all data in the param macro, we can automatically
add 'default' info to the description and avoid any mismatches.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_debugfs.c | 6 +-
drivers/gpu/drm/i915/i915_gpu_error.c | 10 +-
drivers/gpu/drm/i915/i915_params.c | 232 ++--------------------------------
drivers/gpu/drm/i915/i915_params.h | 181 ++++++++++++++++++++------
4 files changed, 155 insertions(+), 274 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index a6ba210..7a2f0b8 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -44,9 +44,9 @@ static __always_inline void seq_print_param(struct seq_file *m,
seq_printf(m, "i915.%s=%s\n", name, yesno(*(const bool *)x));
else if (!__builtin_strcmp(type, "int"))
seq_printf(m, "i915.%s=%d\n", name, *(const int *)x);
- else if (!__builtin_strcmp(type, "unsigned int"))
+ else if (!__builtin_strcmp(type, "uint"))
seq_printf(m, "i915.%s=%u\n", name, *(const unsigned int *)x);
- else if (!__builtin_strcmp(type, "char *"))
+ else if (!__builtin_strcmp(type, "charp"))
seq_printf(m, "i915.%s=%s\n", name, *(const char **)x);
else
BUILD_BUG();
@@ -66,7 +66,7 @@ static int i915_capabilities(struct seq_file *m, void *data)
#undef PRINT_FLAG
kernel_param_lock(THIS_MODULE);
-#define PRINT_PARAM(T, x) seq_print_param(m, #x, #T, &i915.x);
+#define PRINT_PARAM(T, X, V, M, S, B, D) seq_print_param(m, #X, #T, &i915.X);
I915_PARAMS_FOR_EACH(PRINT_PARAM);
#undef PRINT_PARAM
kernel_param_unlock(THIS_MODULE);
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index e18f350..ea6c0b1 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -555,9 +555,9 @@ static __always_inline void err_print_param(struct drm_i915_error_state_buf *m,
err_printf(m, "i915.%s=%s\n", name, yesno(*(const bool *)x));
else if (!__builtin_strcmp(type, "int"))
err_printf(m, "i915.%s=%d\n", name, *(const int *)x);
- else if (!__builtin_strcmp(type, "unsigned int"))
+ else if (!__builtin_strcmp(type, "uint"))
err_printf(m, "i915.%s=%u\n", name, *(const unsigned int *)x);
- else if (!__builtin_strcmp(type, "char *"))
+ else if (!__builtin_strcmp(type, "charp"))
err_printf(m, "i915.%s=%s\n", name, *(const char **)x);
else
BUILD_BUG();
@@ -566,7 +566,7 @@ static __always_inline void err_print_param(struct drm_i915_error_state_buf *m,
static void err_print_params(struct drm_i915_error_state_buf *m,
const struct i915_params *p)
{
-#define PRINT(T, x) err_print_param(m, #x, #T, &p->x);
+#define PRINT(T, X, V, M, S, B, D) err_print_param(m, #X, #T, &p->X);
I915_PARAMS_FOR_EACH(PRINT);
#undef PRINT
}
@@ -860,7 +860,7 @@ void __i915_gpu_state_free(struct kref *error_ref)
kfree(error->overlay);
kfree(error->display);
-#define FREE(T, x) free_param(#T, &error->params.x);
+#define FREE(T, X, V, M, S, B, D) free_param(#T, &error->params.X);
I915_PARAMS_FOR_EACH(FREE);
#undef FREE
@@ -1694,7 +1694,7 @@ static int capture(void *data)
error->i915->gt.last_init_time));
error->params = i915;
-#define DUP(T, x) dup_param(#T, &error->params.x);
+#define DUP(T, X, V, M, S, B, D) dup_param(#T, &error->params.X);
I915_PARAMS_FOR_EACH(DUP);
#undef DUP
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index 072aaaf..fb9984b 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -26,230 +26,14 @@
#include "i915_drv.h"
struct i915_params i915 __read_mostly = {
- .modeset = -1,
- .panel_ignore_lid = 1,
- .semaphores = -1,
- .lvds_channel_mode = 0,
- .lvds_use_ssc = -1,
- .vbt_sdvo_panel_type = -1,
- .enable_rc6 = -1,
- .enable_dc = -1,
- .enable_fbc = -1,
- .enable_execlists = -1,
- .enable_hangcheck = true,
- .enable_ppgtt = -1,
- .enable_psr = -1,
- .alpha_support = IS_ENABLED(CONFIG_DRM_I915_ALPHA_SUPPORT),
- .disable_power_well = -1,
- .enable_ips = 1,
- .fastboot = 0,
- .prefault_disable = 0,
- .load_detect_test = 0,
- .force_reset_modeset_test = 0,
- .reset = true,
- .error_capture = true,
- .invert_brightness = 0,
- .disable_display = 0,
- .enable_cmd_parser = true,
- .use_mmio_flip = 0,
- .mmio_debug = 0,
- .verbose_state_checks = 1,
- .nuclear_pageflip = 0,
- .edp_vswing = 0,
- .enable_guc_loading = 0,
- .enable_guc_submission = 0,
- .guc_log_level = -1,
- .guc_firmware_path = NULL,
- .huc_firmware_path = NULL,
- .enable_dp_mst = true,
- .inject_load_failure = 0,
- .enable_dpcd_backlight = false,
- .enable_gvt = false,
+#define MEMBER(Type, Name, Value, Mode, Unsafe, Brief, Detailed) .Name = Value,
+ I915_PARAMS_FOR_EACH(MEMBER)
+#undef MEMBER
};
-module_param_named(modeset, i915.modeset, int, 0400);
-MODULE_PARM_DESC(modeset,
- "Use kernel modesetting [KMS] (0=disable, "
- "1=on, -1=force vga console preference [default])");
+#define PARAM(Type, Name, Value, Mode, Unsafe, Brief, Detailed) \
+ module_param_named##Unsafe(Name, i915.Name, Type, Mode); \
+ MODULE_PARM_DESC(Name, "" Brief " " Detailed "[default: " #Value "]");
+I915_PARAMS_FOR_EACH(PARAM)
+#undef PARAM
-module_param_named_unsafe(panel_ignore_lid, i915.panel_ignore_lid, int, 0600);
-MODULE_PARM_DESC(panel_ignore_lid,
- "Override lid status (0=autodetect, 1=autodetect disabled [default], "
- "-1=force lid closed, -2=force lid open)");
-
-module_param_named_unsafe(semaphores, i915.semaphores, int, 0400);
-MODULE_PARM_DESC(semaphores,
- "Use semaphores for inter-ring sync "
- "(default: -1 (use per-chip defaults))");
-
-module_param_named_unsafe(enable_rc6, i915.enable_rc6, int, 0400);
-MODULE_PARM_DESC(enable_rc6,
- "Enable power-saving render C-state 6. "
- "Different stages can be selected via bitmask values "
- "(0 = disable; 1 = enable rc6; 2 = enable deep rc6; 4 = enable deepest rc6). "
- "For example, 3 would enable rc6 and deep rc6, and 7 would enable everything. "
- "default: -1 (use per-chip default)");
-
-module_param_named_unsafe(enable_dc, i915.enable_dc, int, 0400);
-MODULE_PARM_DESC(enable_dc,
- "Enable power-saving display C-states. "
- "(-1=auto [default]; 0=disable; 1=up to DC5; 2=up to DC6)");
-
-module_param_named_unsafe(enable_fbc, i915.enable_fbc, int, 0600);
-MODULE_PARM_DESC(enable_fbc,
- "Enable frame buffer compression for power savings "
- "(default: -1 (use per-chip default))");
-
-module_param_named_unsafe(lvds_channel_mode, i915.lvds_channel_mode, int, 0400);
-MODULE_PARM_DESC(lvds_channel_mode,
- "Specify LVDS channel mode "
- "(0=probe BIOS [default], 1=single-channel, 2=dual-channel)");
-
-module_param_named_unsafe(lvds_use_ssc, i915.lvds_use_ssc, int, 0600);
-MODULE_PARM_DESC(lvds_use_ssc,
- "Use Spread Spectrum Clock with panels [LVDS/eDP] "
- "(default: auto from VBT)");
-
-module_param_named_unsafe(vbt_sdvo_panel_type, i915.vbt_sdvo_panel_type, int, 0400);
-MODULE_PARM_DESC(vbt_sdvo_panel_type,
- "Override/Ignore selection of SDVO panel mode in the VBT "
- "(-2=ignore, -1=auto [default], index in VBT BIOS table)");
-
-module_param_named_unsafe(reset, i915.reset, bool, 0600);
-MODULE_PARM_DESC(reset, "Attempt GPU resets (default: true)");
-
-#if IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR)
-module_param_named(error_capture, i915.error_capture, bool, 0600);
-MODULE_PARM_DESC(error_capture,
- "Record the GPU state following a hang. "
- "This information in /sys/class/drm/card<N>/error is vital for "
- "triaging and debugging hangs.");
-#endif
-
-module_param_named_unsafe(enable_hangcheck, i915.enable_hangcheck, bool, 0644);
-MODULE_PARM_DESC(enable_hangcheck,
- "Periodically check GPU activity for detecting hangs. "
- "WARNING: Disabling this can cause system wide hangs. "
- "(default: true)");
-
-module_param_named_unsafe(enable_ppgtt, i915.enable_ppgtt, int, 0400);
-MODULE_PARM_DESC(enable_ppgtt,
- "Override PPGTT usage. "
- "(-1=auto [default], 0=disabled, 1=aliasing, 2=full, 3=full with extended address space)");
-
-module_param_named_unsafe(enable_execlists, i915.enable_execlists, int, 0400);
-MODULE_PARM_DESC(enable_execlists,
- "Override execlists usage. "
- "(-1=auto [default], 0=disabled, 1=enabled)");
-
-module_param_named_unsafe(enable_psr, i915.enable_psr, int, 0600);
-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, bool, 0400);
-MODULE_PARM_DESC(alpha_support,
- "Enable alpha quality driver support for latest hardware. "
- "See also CONFIG_DRM_I915_ALPHA_SUPPORT.");
-
-module_param_named_unsafe(disable_power_well, i915.disable_power_well, int, 0400);
-MODULE_PARM_DESC(disable_power_well,
- "Disable display power wells when possible "
- "(-1=auto [default], 0=power wells always on, 1=power wells disabled when possible)");
-
-module_param_named_unsafe(enable_ips, i915.enable_ips, int, 0600);
-MODULE_PARM_DESC(enable_ips, "Enable IPS (default: true)");
-
-module_param_named(fastboot, i915.fastboot, bool, 0600);
-MODULE_PARM_DESC(fastboot,
- "Try to skip unnecessary mode sets at boot time (default: false)");
-
-module_param_named_unsafe(prefault_disable, i915.prefault_disable, bool, 0600);
-MODULE_PARM_DESC(prefault_disable,
- "Disable page prefaulting for pread/pwrite/reloc (default:false). "
- "For developers only.");
-
-module_param_named_unsafe(load_detect_test, i915.load_detect_test, bool, 0600);
-MODULE_PARM_DESC(load_detect_test,
- "Force-enable the VGA load detect code for testing (default:false). "
- "For developers only.");
-
-module_param_named_unsafe(force_reset_modeset_test, i915.force_reset_modeset_test, bool, 0600);
-MODULE_PARM_DESC(force_reset_modeset_test,
- "Force a modeset during gpu reset for testing (default:false). "
- "For developers only.");
-
-module_param_named_unsafe(invert_brightness, i915.invert_brightness, int, 0600);
-MODULE_PARM_DESC(invert_brightness,
- "Invert backlight brightness "
- "(-1 force normal, 0 machine defaults, 1 force inversion), please "
- "report PCI device ID, subsystem vendor and subsystem device ID "
- "to dri-devel@lists.freedesktop.org, if your machine needs it. "
- "It will then be included in an upcoming module version.");
-
-module_param_named(disable_display, i915.disable_display, bool, 0400);
-MODULE_PARM_DESC(disable_display, "Disable display (default: false)");
-
-module_param_named_unsafe(enable_cmd_parser, i915.enable_cmd_parser, bool, 0400);
-MODULE_PARM_DESC(enable_cmd_parser,
- "Enable command parsing (true=enabled [default], false=disabled)");
-
-module_param_named_unsafe(use_mmio_flip, i915.use_mmio_flip, int, 0600);
-MODULE_PARM_DESC(use_mmio_flip,
- "use MMIO flips (-1=never, 0=driver discretion [default], 1=always)");
-
-module_param_named(mmio_debug, i915.mmio_debug, int, 0600);
-MODULE_PARM_DESC(mmio_debug,
- "Enable the MMIO debug code for the first N failures (default: off). "
- "This may negatively affect performance.");
-
-module_param_named(verbose_state_checks, i915.verbose_state_checks, bool, 0600);
-MODULE_PARM_DESC(verbose_state_checks,
- "Enable verbose logs (ie. WARN_ON()) in case of unexpected hw state conditions.");
-
-module_param_named_unsafe(nuclear_pageflip, i915.nuclear_pageflip, bool, 0400);
-MODULE_PARM_DESC(nuclear_pageflip,
- "Force enable atomic functionality on platforms that don't have full support yet.");
-
-/* WA to get away with the default setting in VBT for early platforms.Will be removed */
-module_param_named_unsafe(edp_vswing, i915.edp_vswing, int, 0400);
-MODULE_PARM_DESC(edp_vswing,
- "Ignore/Override vswing pre-emph table selection from VBT "
- "(0=use value from vbt [default], 1=low power swing(200mV),"
- "2=default swing(400mV))");
-
-module_param_named_unsafe(enable_guc_loading, i915.enable_guc_loading, int, 0400);
-MODULE_PARM_DESC(enable_guc_loading,
- "Enable GuC firmware loading "
- "(-1=auto, 0=never [default], 1=if available, 2=required)");
-
-module_param_named_unsafe(enable_guc_submission, i915.enable_guc_submission, int, 0400);
-MODULE_PARM_DESC(enable_guc_submission,
- "Enable GuC submission "
- "(-1=auto, 0=never [default], 1=if available, 2=required)");
-
-module_param_named(guc_log_level, i915.guc_log_level, int, 0400);
-MODULE_PARM_DESC(guc_log_level,
- "GuC firmware logging level (-1:disabled (default), 0-3:enabled)");
-
-module_param_named_unsafe(guc_firmware_path, i915.guc_firmware_path, charp, 0400);
-MODULE_PARM_DESC(guc_firmware_path,
- "GuC firmware path to use instead of the default one");
-
-module_param_named_unsafe(huc_firmware_path, i915.huc_firmware_path, charp, 0400);
-MODULE_PARM_DESC(huc_firmware_path,
- "HuC firmware path to use instead of the default one");
-
-module_param_named_unsafe(enable_dp_mst, i915.enable_dp_mst, bool, 0600);
-MODULE_PARM_DESC(enable_dp_mst,
- "Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true)");
-module_param_named_unsafe(inject_load_failure, i915.inject_load_failure, uint, 0400);
-MODULE_PARM_DESC(inject_load_failure,
- "Force an error after a number of failure check points (0:disabled (default), N:force failure at the Nth failure check point)");
-module_param_named(enable_dpcd_backlight, i915.enable_dpcd_backlight, bool, 0600);
-MODULE_PARM_DESC(enable_dpcd_backlight,
- "Enable support for DPCD backlight control (default:false)");
-
-module_param_named(enable_gvt, i915.enable_gvt, bool, 0400);
-MODULE_PARM_DESC(enable_gvt,
- "Enable support for Intel GVT-g graphics virtualization host support(default:false)");
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index 5fa62c2..ef7e350 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -27,53 +27,150 @@
#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, lvds_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(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(char *, guc_firmware_path); \
- func(char *, huc_firmware_path); \
- func(int, use_mmio_flip); \
- func(int, mmio_debug); \
- func(int, edp_vswing); \
- func(unsigned int, inject_load_failure); \
+/*
+ * Each i915 params is defined as single 'func' entry:
+ * func(Type, Name, Value, Mode, Unsafe, Brief, Detailed)
+ * where:
+ * @Type: int|uint|bool|charp
+ * @Name: the name of param
+ * @Value: the default value of the param
+ * @Mode: the access mode (usually 0600|0400)
+ * @Unsafe: must be either empty or _unsafe
+ * @Brief: short description text of the param
+ * @Detailed: more detailed description of the param (may be empty)
+ */
+#define _I915_PARAMS_FOR_EACH_BASE(func) \
+ func(int, modeset, -1, 0400, , \
+ "Use kernel modesetting (KMS).", \
+ "(0=disable, 1=on, -1=force vga console preference)") \
+ func(int, panel_ignore_lid, 1, 0600, _unsafe, \
+ "Override lid status.", \
+ "(0=autodetect, 1=autodetect disabled, -1=force lid closed, -2=force lid open)") \
+ func(int, semaphores, -1, 0400, _unsafe, \
+ "Use semaphores for inter-ring sync.", \
+ "(-1=use per-chip defaults)") \
+ func(int, lvds_channel_mode, 0, 0400, _unsafe, \
+ "Specify LVDS channel mode.", \
+ "(0=probe BIOS, 1=single-channel, 2=dual-channel)") \
+ func(int, lvds_use_ssc, -1, 0600, _unsafe, \
+ "Use Spread Spectrum Clock with panels [LVDS/eDP].", \
+ "(-1=auto from VBT)") \
+ func(int, vbt_sdvo_panel_type, -1, 0400, _unsafe, \
+ "Override/Ignore selection of SDVO panel mode in the VBT.", \
+ "(-2=ignore, -1=auto, 0..n=index in VBT BIOS table)") \
+ func(int, enable_rc6, -1, 0400, _unsafe, \
+ "Enable power-saving render C-state 6.", \
+ "(-1=use per-chip default; 0 = disable; 1 = enable rc6; 2 = enable deep rc6; 4 = enable deepest rc6)" \
+ "Different stages can be selected via bitmask values. " \
+ "For example, 3 would enable rc6 and deep rc6, and 7 would enable everything. ") \
+ func(int, enable_dc, -1, 0400, _unsafe, \
+ "Enable power-saving display C-states.", \
+ "(-1=auto; 0=disable; 1=up to DC5; 2=up to DC6)") \
+ func(int, enable_fbc, -1, 0600, _unsafe, \
+ "Enable frame buffer compression for power savings.", \
+ "(-1=use per-chip default)") \
+ func(int, enable_ppgtt, -1, 0400, _unsafe, \
+ "Override PPGTT usage.", \
+ "(-1=auto, 0=disabled, 1=aliasing, 2=full, 3=full with extended address space)") \
+ func(int, enable_execlists, -1, 0400, _unsafe, \
+ "Override execlists usage.", \
+ "(-1=auto, 0=disabled, 1=enabled)") \
+ func(int, enable_psr, -1, 0600, _unsafe, \
+ "Enable PSR.", \
+ "(-1=use per-chip default, 0=disabled," \
+ "1=link mode chosen per-platform, " \
+ "2=force link-standby mode, " \
+ "3=force link-off mode)") \
+ func(int, disable_power_well, -1, 0400, _unsafe, \
+ "Disable display power wells when possible.", \
+ "(-1=auto, 0=power wells always on, 1=power wells disabled when possible)") \
+ func(int, enable_ips, 1, 0600, _unsafe, \
+ "Enable IPS.", ) \
+ func(int, invert_brightness, 0, 0600, _unsafe, \
+ "Invert backlight brightness.", \
+ "Please report PCI device ID, subsystem vendor and subsystem " \
+ "device ID to dri-devel@lists.freedesktop.org, if your machine " \
+ "needs it. It will then be included in an upcoming module version. " \
+ "(-1=force normal, 0=machine defaults, 1=force inversion)") \
+ func(int, enable_guc_loading, 0, 0400, _unsafe, \
+ "Enable GuC firmware loading.", \
+ "(-1=auto, 0=never, 1=if available, 2=required)") \
+ func(int, enable_guc_submission, 0, 0400, _unsafe, \
+ "Enable GuC submission.", \
+ "(-1=auto, 0=never, 1=if available, 2=required)") \
+ func(int, guc_log_level, -1, 0400, _unsafe, \
+ "GuC firmware logging level.", \
+ "(-1:disabled, 0-3:enabled)") \
+ func(charp, guc_firmware_path, NULL, 0400, _unsafe, \
+ "GuC firmware path to use instead of the default one.", ) \
+ func(charp, huc_firmware_path, NULL, 0400, _unsafe, \
+ "HuC firmware path to use instead of the default one.", ) \
+ func(int, use_mmio_flip, 0, 0600, _unsafe, \
+ "Use MMIO flips.", \
+ "(-1=never, 0=driver discretion, 1=always)") \
+ func(int, mmio_debug, 0, 0600, , \
+ "Enable the MMIO debug code for the first N failures.", \
+ "This may negatively affect performance. ") \
+ func(int, edp_vswing, 0, 0400, _unsafe, \
+ "Ignore/Override vswing pre-emph table selection from VBT.", \
+ "(0=use value from VBT, 1=low power swing(200mV), 2=default swing(400mV))") \
+ func(uint, inject_load_failure, 0, 0400, _unsafe, \
+ "For developers only: Force an error after a number of failure check points.", \
+ "(0:disabled, N:force failure at the Nth failure check point)") \
/* leave bools at the end to not create holes */ \
- func(bool, alpha_support); \
- 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(bool, alpha_support, IS_ENABLED(CONFIG_DRM_I915_ALPHA_SUPPORT), 0400, _unsafe, \
+ "Enable alpha quality driver support for latest hardware.", ) \
+ func(bool, enable_cmd_parser, true, 0400, _unsafe, \
+ "Enable command parsing.", \
+ "(true=enabled, false=disabled)") \
+ func(bool, enable_hangcheck, true, 0644, _unsafe, \
+ "Periodically check GPU activity for detecting hangs.", \
+ "WARNING: Disabling this can cause system wide hangs! ") \
+ func(bool, fastboot, false, 0600, , \
+ "Try to skip unnecessary mode sets at boot time.", ) \
+ func(bool, prefault_disable, false, 0600, _unsafe, \
+ "For developers only: Disable page prefaulting for pread/pwrite/reloc.", ) \
+ func(bool, load_detect_test, false, 0600, _unsafe, \
+ "For developers only: Force-enable the VGA load detect code for testing.", ) \
+ func(bool, force_reset_modeset_test, false, 0600, _unsafe, \
+ "For developers only: Force a modeset during gpu reset for testing.", ) \
+ func(bool, reset, true, 0600, _unsafe, \
+ "Attempt GPU resets.", ) \
+ func(bool, disable_display, false, 0400, , \
+ "Disable display.", ) \
+ func(bool, verbose_state_checks, true, 0600, , \
+ "Enable verbose logs (ie. WARN_ON()) in case of unexpected HW state conditions.", ) \
+ func(bool, nuclear_pageflip, false, 0400, _unsafe, \
+ "Force enable atomic functionality on platforms that don't have full support yet.", ) \
+ func(bool, enable_dp_mst, true, 0600, _unsafe, \
+ "Enable multi-stream transport (MST) for new DisplayPort sinks.", ) \
+ func(bool, enable_dpcd_backlight, false, 0600, , \
+ "Enable support for DPCD backlight control.", ) \
+ func(bool, enable_gvt, false, 0400, , \
+ "Enable support for Intel GVT-g graphics virtualization host support.", ) \
+ /* consume \ */
+
+#if IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR)
+#define _I915_PARAMS_FOR_EACH_CONFIG_ERROR(func) \
+ func(bool, error_capture, true, 0600, , \
+ "Record the GPU state following a hang.", \
+ "This information in /sys/class/drm/card<N>/error is vital for triaging and debugging hangs. ")
+#else
+#define _I915_PARAMS_FOR_EACH_CONFIG_ERROR(func)
+#endif
+
+#define I915_PARAMS_FOR_EACH(func) \
+ _I915_PARAMS_FOR_EACH_BASE(func) \
+ _I915_PARAMS_FOR_EACH_CONFIG_ERROR(func) \
+ /* consume \ */
-#define MEMBER(T, member) T member
+#define charp char*
+#define MEMBER(Type, Name, Value, Mode, Unsafe, Brief, Detailed) Type Name;
struct i915_params {
- I915_PARAMS_FOR_EACH(MEMBER);
+ I915_PARAMS_FOR_EACH(MEMBER)
};
#undef MEMBER
+#undef charp
extern struct i915_params i915 __read_mostly;
--
2.7.4
_______________________________________________
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 3/3] drm/i915/debugfs: Highlight modified i915 params
2017-06-08 15:07 [PATCH 0/3] drm/i915: Misc improvements around module params Michal Wajdeczko
2017-06-08 15:07 ` [PATCH 1/3] drm/i915: Rename i915.panel_use_ssc field to lvds_use_ssc Michal Wajdeczko
2017-06-08 15:07 ` [PATCH 2/3] drm/i915: Extend PARAMS_FOR_EACH macro with more data Michal Wajdeczko
@ 2017-06-08 15:07 ` Michal Wajdeczko
2017-06-08 15:25 ` Chris Wilson
2017-06-08 15:26 ` ✓ Fi.CI.BAT: success for drm/i915: Misc improvements around module params Patchwork
2017-06-08 15:41 ` [PATCH v2 3/3] drm/i915/debugfs: Highlight modified i915 params Michal Wajdeczko
4 siblings, 1 reply; 10+ messages in thread
From: Michal Wajdeczko @ 2017-06-08 15:07 UTC (permalink / raw)
To: intel-gfx
We know default values for all params and we know which params are safe
to change. Mark params that were changed when dumping them in debugfs.
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_debugfs.c | 53 ++++++++++++++++++++++++++++---------
1 file changed, 41 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 7a2f0b8..4dc5e8f 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -35,20 +35,42 @@ static inline struct drm_i915_private *node_to_i915(struct drm_info_node *node)
return to_i915(node->minor->dev);
}
+static inline const char *param_diagnostic(bool is_default, bool is_unsafe)
+{
+ if (is_default)
+ return "";
+ if (is_unsafe)
+ return " [modified *unsafe*]";
+ return " [modified]";
+}
+
static __always_inline void seq_print_param(struct seq_file *m,
const char *name,
const char *type,
- const void *x)
-{
- if (!__builtin_strcmp(type, "bool"))
- seq_printf(m, "i915.%s=%s\n", name, yesno(*(const bool *)x));
- else if (!__builtin_strcmp(type, "int"))
- seq_printf(m, "i915.%s=%d\n", name, *(const int *)x);
- else if (!__builtin_strcmp(type, "uint"))
- seq_printf(m, "i915.%s=%u\n", name, *(const unsigned int *)x);
- else if (!__builtin_strcmp(type, "charp"))
- seq_printf(m, "i915.%s=%s\n", name, *(const char **)x);
- else
+ const void *x,
+ const void *v,
+ bool is_unsafe)
+{
+ if (!__builtin_strcmp(type, "bool")) {
+ bool is_default = *(const bool *)x == *(const bool *)v;
+ seq_printf(m, "i915.%s=%s%s\n", name, yesno(*(const bool *)x),
+ param_diagnostic(is_default, is_unsafe));
+ } else if (!__builtin_strcmp(type, "int")) {
+ bool is_default = *(const int *)x == *(const int *)v;
+ seq_printf(m, "i915.%s=%d%s\n", name, *(const int *)x,
+ param_diagnostic(is_default, is_unsafe));
+ } else if (!__builtin_strcmp(type, "uint")) {
+ bool is_default = *(const uint *)x == *(const uint *)v;
+ seq_printf(m, "i915.%s=%u%s\n", name, *(const unsigned int *)x,
+ param_diagnostic(is_default, is_unsafe));
+ } else if (!__builtin_strcmp(type, "charp")) {
+ const char *new = *(const char **)x;
+ const char *old = *(const char **)v;
+ bool is_default = old ? new ? !strcmp(old, new) : false :
+ new ? false : true;
+ seq_printf(m, "i915.%s=%s%s\n", name, *(const char **)x,
+ param_diagnostic(is_default, is_unsafe));
+ } else
BUILD_BUG();
}
@@ -66,9 +88,16 @@ static int i915_capabilities(struct seq_file *m, void *data)
#undef PRINT_FLAG
kernel_param_lock(THIS_MODULE);
-#define PRINT_PARAM(T, X, V, M, S, B, D) seq_print_param(m, #X, #T, &i915.X);
+#define FLAG false
+#define FLAG_unsafe true
+#define PRINT_PARAM(T, X, V, M, S, B, D) do { \
+ typeof(i915.X) __v = V; \
+ seq_print_param(m, #X, #T, &i915.X, &__v, FLAG##S); \
+ } while(0);
I915_PARAMS_FOR_EACH(PRINT_PARAM);
#undef PRINT_PARAM
+#undef FLAG
+#undef FLAG_unsafe
kernel_param_unlock(THIS_MODULE);
return 0;
--
2.7.4
_______________________________________________
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 3/3] drm/i915/debugfs: Highlight modified i915 params
2017-06-08 15:07 ` [PATCH 3/3] drm/i915/debugfs: Highlight modified i915 params Michal Wajdeczko
@ 2017-06-08 15:25 ` Chris Wilson
0 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2017-06-08 15:25 UTC (permalink / raw)
To: Michal Wajdeczko, intel-gfx
Quoting Michal Wajdeczko (2017-06-08 16:07:34)
> We know default values for all params and we know which params are safe
> to change. Mark params that were changed when dumping them in debugfs.
>
> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 53 ++++++++++++++++++++++++++++---------
> 1 file changed, 41 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 7a2f0b8..4dc5e8f 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -35,20 +35,42 @@ static inline struct drm_i915_private *node_to_i915(struct drm_info_node *node)
> return to_i915(node->minor->dev);
> }
>
> +static inline const char *param_diagnostic(bool is_default, bool is_unsafe)
> +{
> + if (is_default)
> + return "";
> + if (is_unsafe)
> + return " [modified *unsafe*]";
> + return " [modified]";
There's one more complication here: those parameters that are
automatically reset based on HW support. Probably not worth it since how
do we tell the difference (between the driver adjustment and user),
without support of modparam tracking. :|
> + } else if (!__builtin_strcmp(type, "charp")) {
> + const char *new = *(const char **)x;
> + const char *old = *(const char **)v;
> + bool is_default = old ? new ? !strcmp(old, new) : false :
> + new ? false : true;
is_default = old && new ? !strcmp(old, new) : old == new; ?
-Chris
_______________________________________________
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
* ✓ Fi.CI.BAT: success for drm/i915: Misc improvements around module params
2017-06-08 15:07 [PATCH 0/3] drm/i915: Misc improvements around module params Michal Wajdeczko
` (2 preceding siblings ...)
2017-06-08 15:07 ` [PATCH 3/3] drm/i915/debugfs: Highlight modified i915 params Michal Wajdeczko
@ 2017-06-08 15:26 ` Patchwork
2017-06-08 15:41 ` [PATCH v2 3/3] drm/i915/debugfs: Highlight modified i915 params Michal Wajdeczko
4 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2017-06-08 15:26 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: Misc improvements around module params
URL : https://patchwork.freedesktop.org/series/25482/
State : success
== Summary ==
Series 25482v1 drm/i915: Misc improvements around module params
https://patchwork.freedesktop.org/api/1.0/series/25482/revisions/1/mbox/
Test gem_exec_suspend:
Subgroup basic-s4-devices:
dmesg-warn -> PASS (fi-kbl-7560u) fdo#100125
Test kms_busy:
Subgroup basic-flip-default-a:
dmesg-warn -> PASS (fi-skl-6700hq) fdo#101144 +1
fdo#100125 https://bugs.freedesktop.org/show_bug.cgi?id=100125
fdo#101144 https://bugs.freedesktop.org/show_bug.cgi?id=101144
fi-bdw-5557u total:278 pass:267 dwarn:0 dfail:0 fail:0 skip:11 time:448s
fi-bdw-gvtdvm total:278 pass:256 dwarn:8 dfail:0 fail:0 skip:14 time:433s
fi-bsw-n3050 total:278 pass:242 dwarn:0 dfail:0 fail:0 skip:36 time:585s
fi-bxt-j4205 total:278 pass:259 dwarn:0 dfail:0 fail:0 skip:19 time:515s
fi-byt-j1900 total:278 pass:254 dwarn:0 dfail:0 fail:0 skip:24 time:485s
fi-byt-n2820 total:278 pass:250 dwarn:0 dfail:0 fail:0 skip:28 time:482s
fi-glk-2a total:278 pass:259 dwarn:0 dfail:0 fail:0 skip:19 time:588s
fi-hsw-4770 total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time:436s
fi-hsw-4770r total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time:413s
fi-ilk-650 total:278 pass:228 dwarn:0 dfail:0 fail:0 skip:50 time:415s
fi-ivb-3520m total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time:494s
fi-ivb-3770 total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time:460s
fi-kbl-7500u total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time:460s
fi-kbl-7560u total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time:567s
fi-kbl-r total:278 pass:259 dwarn:1 dfail:0 fail:0 skip:18 time:578s
fi-skl-6260u total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time:460s
fi-skl-6700hq total:278 pass:229 dwarn:1 dfail:0 fail:26 skip:22 time:403s
fi-skl-6700k total:278 pass:256 dwarn:4 dfail:0 fail:0 skip:18 time:466s
fi-skl-6770hq total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time:499s
fi-skl-gvtdvm total:278 pass:265 dwarn:0 dfail:0 fail:0 skip:13 time:442s
fi-snb-2520m total:278 pass:250 dwarn:0 dfail:0 fail:0 skip:28 time:540s
fi-snb-2600 total:278 pass:249 dwarn:0 dfail:0 fail:0 skip:29 time:406s
17f9a91122b35ff8eb237b65fec35d347ee49520 drm-tip: 2017y-06m-08d-14h-17m-12s UTC integration manifest
347a417 drm/i915/debugfs: Highlight modified i915 params
45da369 drm/i915: Extend PARAMS_FOR_EACH macro with more data
1476250 drm/i915: Rename i915.panel_use_ssc field to lvds_use_ssc
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4912/
_______________________________________________
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
* [PATCH v2 3/3] drm/i915/debugfs: Highlight modified i915 params
2017-06-08 15:07 [PATCH 0/3] drm/i915: Misc improvements around module params Michal Wajdeczko
` (3 preceding siblings ...)
2017-06-08 15:26 ` ✓ Fi.CI.BAT: success for drm/i915: Misc improvements around module params Patchwork
@ 2017-06-08 15:41 ` Michal Wajdeczko
4 siblings, 0 replies; 10+ messages in thread
From: Michal Wajdeczko @ 2017-06-08 15:41 UTC (permalink / raw)
To: intel-gfx
We know default values for all params and we know which params are safe
to change. Mark params that were changed when dumping them in debugfs.
v2: simplify is_default calculation for strings (Chris)
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_debugfs.c | 52 ++++++++++++++++++++++++++++---------
1 file changed, 40 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 7a2f0b8..03381a1 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -35,20 +35,41 @@ static inline struct drm_i915_private *node_to_i915(struct drm_info_node *node)
return to_i915(node->minor->dev);
}
+static inline const char *param_diagnostic(bool is_default, bool is_unsafe)
+{
+ if (is_default)
+ return "";
+ if (is_unsafe)
+ return " [modified *unsafe*]";
+ return " [modified]";
+}
+
static __always_inline void seq_print_param(struct seq_file *m,
const char *name,
const char *type,
- const void *x)
-{
- if (!__builtin_strcmp(type, "bool"))
- seq_printf(m, "i915.%s=%s\n", name, yesno(*(const bool *)x));
- else if (!__builtin_strcmp(type, "int"))
- seq_printf(m, "i915.%s=%d\n", name, *(const int *)x);
- else if (!__builtin_strcmp(type, "uint"))
- seq_printf(m, "i915.%s=%u\n", name, *(const unsigned int *)x);
- else if (!__builtin_strcmp(type, "charp"))
- seq_printf(m, "i915.%s=%s\n", name, *(const char **)x);
- else
+ const void *x,
+ const void *v,
+ bool is_unsafe)
+{
+ if (!__builtin_strcmp(type, "bool")) {
+ bool is_default = *(const bool *)x == *(const bool *)v;
+ seq_printf(m, "i915.%s=%s%s\n", name, yesno(*(const bool *)x),
+ param_diagnostic(is_default, is_unsafe));
+ } else if (!__builtin_strcmp(type, "int")) {
+ bool is_default = *(const int *)x == *(const int *)v;
+ seq_printf(m, "i915.%s=%d%s\n", name, *(const int *)x,
+ param_diagnostic(is_default, is_unsafe));
+ } else if (!__builtin_strcmp(type, "uint")) {
+ bool is_default = *(const uint *)x == *(const uint *)v;
+ seq_printf(m, "i915.%s=%u%s\n", name, *(const unsigned int *)x,
+ param_diagnostic(is_default, is_unsafe));
+ } else if (!__builtin_strcmp(type, "charp")) {
+ const char *new = *(const char **)x;
+ const char *old = *(const char **)v;
+ bool is_default = old && new ? !strcmp(old, new) : old == new;
+ seq_printf(m, "i915.%s=%s%s\n", name, *(const char **)x,
+ param_diagnostic(is_default, is_unsafe));
+ } else
BUILD_BUG();
}
@@ -66,9 +87,16 @@ static int i915_capabilities(struct seq_file *m, void *data)
#undef PRINT_FLAG
kernel_param_lock(THIS_MODULE);
-#define PRINT_PARAM(T, X, V, M, S, B, D) seq_print_param(m, #X, #T, &i915.X);
+#define FLAG false
+#define FLAG_unsafe true
+#define PRINT_PARAM(T, X, V, M, S, B, D) do { \
+ typeof(i915.X) __v = V; \
+ seq_print_param(m, #X, #T, &i915.X, &__v, FLAG##S); \
+ } while(0);
I915_PARAMS_FOR_EACH(PRINT_PARAM);
#undef PRINT_PARAM
+#undef FLAG
+#undef FLAG_unsafe
kernel_param_unlock(THIS_MODULE);
return 0;
--
2.7.4
_______________________________________________
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 1/3] drm/i915: Rename i915.panel_use_ssc field to lvds_use_ssc
2017-06-08 15:07 ` [PATCH 1/3] drm/i915: Rename i915.panel_use_ssc field to lvds_use_ssc Michal Wajdeczko
@ 2017-06-08 16:03 ` Ville Syrjälä
2017-06-08 16:22 ` Michal Wajdeczko
0 siblings, 1 reply; 10+ messages in thread
From: Ville Syrjälä @ 2017-06-08 16:03 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-gfx
On Thu, Jun 08, 2017 at 03:07:32PM +0000, Michal Wajdeczko wrote:
> This is the only field from i915_params struct which name does not match
> the the name of the param that it is associated with. Lets fix that now
> as this will unblock us with further improvements around params defs.
Maybe we should rename the modparam instead since it does affect eDP as
well. Thoughts?
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/i915_params.c | 4 ++--
> drivers/gpu/drm/i915/i915_params.h | 2 +-
> drivers/gpu/drm/i915/intel_display.c | 4 ++--
> 3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
> index b6a7e36..072aaaf 100644
> --- a/drivers/gpu/drm/i915/i915_params.c
> +++ b/drivers/gpu/drm/i915/i915_params.c
> @@ -30,7 +30,7 @@ struct i915_params i915 __read_mostly = {
> .panel_ignore_lid = 1,
> .semaphores = -1,
> .lvds_channel_mode = 0,
> - .panel_use_ssc = -1,
> + .lvds_use_ssc = -1,
> .vbt_sdvo_panel_type = -1,
> .enable_rc6 = -1,
> .enable_dc = -1,
> @@ -105,7 +105,7 @@ MODULE_PARM_DESC(lvds_channel_mode,
> "Specify LVDS channel mode "
> "(0=probe BIOS [default], 1=single-channel, 2=dual-channel)");
>
> -module_param_named_unsafe(lvds_use_ssc, i915.panel_use_ssc, int, 0600);
> +module_param_named_unsafe(lvds_use_ssc, i915.lvds_use_ssc, int, 0600);
> MODULE_PARM_DESC(lvds_use_ssc,
> "Use Spread Spectrum Clock with panels [LVDS/eDP] "
> "(default: auto from VBT)");
> diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
> index 34148cc..5fa62c2 100644
> --- a/drivers/gpu/drm/i915/i915_params.h
> +++ b/drivers/gpu/drm/i915/i915_params.h
> @@ -32,7 +32,7 @@
> func(int, panel_ignore_lid); \
> func(int, semaphores); \
> func(int, lvds_channel_mode); \
> - func(int, panel_use_ssc); \
> + func(int, lvds_use_ssc); \
> func(int, vbt_sdvo_panel_type); \
> func(int, enable_rc6); \
> func(int, enable_dc); \
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 25390dd..fdd2576 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -6345,8 +6345,8 @@ intel_link_compute_m_n(int bits_per_pixel, int nlanes,
>
> static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv)
> {
> - if (i915.panel_use_ssc >= 0)
> - return i915.panel_use_ssc != 0;
> + if (i915.lvds_use_ssc >= 0)
> + return i915.lvds_use_ssc != 0;
> return dev_priv->vbt.lvds_use_ssc
> && !(dev_priv->quirks & QUIRK_LVDS_SSC_DISABLE);
> }
> --
> 2.7.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
_______________________________________________
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 1/3] drm/i915: Rename i915.panel_use_ssc field to lvds_use_ssc
2017-06-08 16:03 ` Ville Syrjälä
@ 2017-06-08 16:22 ` Michal Wajdeczko
2017-06-08 20:00 ` Chris Wilson
0 siblings, 1 reply; 10+ messages in thread
From: Michal Wajdeczko @ 2017-06-08 16:22 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: intel-gfx
On Thu, Jun 08, 2017 at 07:03:55PM +0300, Ville Syrjälä wrote:
> On Thu, Jun 08, 2017 at 03:07:32PM +0000, Michal Wajdeczko wrote:
> > This is the only field from i915_params struct which name does not match
> > the the name of the param that it is associated with. Lets fix that now
> > as this will unblock us with further improvements around params defs.
>
> Maybe we should rename the modparam instead since it does affect eDP as
> well. Thoughts?
>
For me it's fine (and maybe even easier).
But I'm not sure how "stable" modparams need to be.
Michal
> >
> > Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> > drivers/gpu/drm/i915/i915_params.c | 4 ++--
> > drivers/gpu/drm/i915/i915_params.h | 2 +-
> > drivers/gpu/drm/i915/intel_display.c | 4 ++--
> > 3 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
> > index b6a7e36..072aaaf 100644
> > --- a/drivers/gpu/drm/i915/i915_params.c
> > +++ b/drivers/gpu/drm/i915/i915_params.c
> > @@ -30,7 +30,7 @@ struct i915_params i915 __read_mostly = {
> > .panel_ignore_lid = 1,
> > .semaphores = -1,
> > .lvds_channel_mode = 0,
> > - .panel_use_ssc = -1,
> > + .lvds_use_ssc = -1,
> > .vbt_sdvo_panel_type = -1,
> > .enable_rc6 = -1,
> > .enable_dc = -1,
> > @@ -105,7 +105,7 @@ MODULE_PARM_DESC(lvds_channel_mode,
> > "Specify LVDS channel mode "
> > "(0=probe BIOS [default], 1=single-channel, 2=dual-channel)");
> >
> > -module_param_named_unsafe(lvds_use_ssc, i915.panel_use_ssc, int, 0600);
> > +module_param_named_unsafe(lvds_use_ssc, i915.lvds_use_ssc, int, 0600);
> > MODULE_PARM_DESC(lvds_use_ssc,
> > "Use Spread Spectrum Clock with panels [LVDS/eDP] "
> > "(default: auto from VBT)");
> > diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
> > index 34148cc..5fa62c2 100644
> > --- a/drivers/gpu/drm/i915/i915_params.h
> > +++ b/drivers/gpu/drm/i915/i915_params.h
> > @@ -32,7 +32,7 @@
> > func(int, panel_ignore_lid); \
> > func(int, semaphores); \
> > func(int, lvds_channel_mode); \
> > - func(int, panel_use_ssc); \
> > + func(int, lvds_use_ssc); \
> > func(int, vbt_sdvo_panel_type); \
> > func(int, enable_rc6); \
> > func(int, enable_dc); \
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 25390dd..fdd2576 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -6345,8 +6345,8 @@ intel_link_compute_m_n(int bits_per_pixel, int nlanes,
> >
> > static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv)
> > {
> > - if (i915.panel_use_ssc >= 0)
> > - return i915.panel_use_ssc != 0;
> > + if (i915.lvds_use_ssc >= 0)
> > + return i915.lvds_use_ssc != 0;
> > return dev_priv->vbt.lvds_use_ssc
> > && !(dev_priv->quirks & QUIRK_LVDS_SSC_DISABLE);
> > }
> > --
> > 2.7.4
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> --
> Ville Syrjälä
> Intel OTC
_______________________________________________
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 1/3] drm/i915: Rename i915.panel_use_ssc field to lvds_use_ssc
2017-06-08 16:22 ` Michal Wajdeczko
@ 2017-06-08 20:00 ` Chris Wilson
0 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2017-06-08 20:00 UTC (permalink / raw)
To: Michal Wajdeczko, Ville Syrjälä; +Cc: intel-gfx
Quoting Michal Wajdeczko (2017-06-08 17:22:40)
> On Thu, Jun 08, 2017 at 07:03:55PM +0300, Ville Syrjälä wrote:
> > On Thu, Jun 08, 2017 at 03:07:32PM +0000, Michal Wajdeczko wrote:
> > > This is the only field from i915_params struct which name does not match
> > > the the name of the param that it is associated with. Lets fix that now
> > > as this will unblock us with further improvements around params defs.
> >
> > Maybe we should rename the modparam instead since it does affect eDP as
> > well. Thoughts?
> >
>
> For me it's fine (and maybe even easier).
> But I'm not sure how "stable" modparams need to be.
Soft. Since it is used to quirk hw behaviour, occasionally upsetting the
apple-cart so that a user files a bug report and we get it added to the
quirk table is a small price to pay in annoyance. If no one notices, the
modparam may have outlived its usefulness.
-Chris
_______________________________________________
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-06-08 20:00 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-08 15:07 [PATCH 0/3] drm/i915: Misc improvements around module params Michal Wajdeczko
2017-06-08 15:07 ` [PATCH 1/3] drm/i915: Rename i915.panel_use_ssc field to lvds_use_ssc Michal Wajdeczko
2017-06-08 16:03 ` Ville Syrjälä
2017-06-08 16:22 ` Michal Wajdeczko
2017-06-08 20:00 ` Chris Wilson
2017-06-08 15:07 ` [PATCH 2/3] drm/i915: Extend PARAMS_FOR_EACH macro with more data Michal Wajdeczko
2017-06-08 15:07 ` [PATCH 3/3] drm/i915/debugfs: Highlight modified i915 params Michal Wajdeczko
2017-06-08 15:25 ` Chris Wilson
2017-06-08 15:26 ` ✓ Fi.CI.BAT: success for drm/i915: Misc improvements around module params Patchwork
2017-06-08 15:41 ` [PATCH v2 3/3] drm/i915/debugfs: Highlight modified i915 params Michal Wajdeczko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox