* [RFC 1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible
@ 2017-09-22 14:27 Michal Wajdeczko
2017-09-22 14:27 ` [RFC 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value Michal Wajdeczko
` (6 more replies)
0 siblings, 7 replies; 17+ messages in thread
From: Michal Wajdeczko @ 2017-09-22 14:27 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula
We should not add trailing ; after each member allow other
than statements-style uses of this helper macro.
While here s/func/param for clarity.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/i915_params.h | 84 +++++++++++++++++++-------------------
1 file changed, 42 insertions(+), 42 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index a2cbb47..0116bb9 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -27,50 +27,50 @@
#include <linux/cache.h> /* for __read_mostly */
-#define I915_PARAMS_FOR_EACH(func) \
- func(char *, vbt_firmware); \
- 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(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(int, reset); \
- func(unsigned int, inject_load_failure); \
+#define I915_PARAMS_FOR_EACH(param) \
+ param(char *, vbt_firmware) \
+ param(int, modeset) \
+ param(int, panel_ignore_lid) \
+ param(int, semaphores) \
+ param(int, lvds_channel_mode) \
+ param(int, panel_use_ssc) \
+ param(int, vbt_sdvo_panel_type) \
+ param(int, enable_rc6) \
+ param(int, enable_dc) \
+ param(int, enable_fbc) \
+ param(int, enable_ppgtt) \
+ param(int, enable_execlists) \
+ param(int, enable_psr) \
+ param(int, disable_power_well) \
+ param(int, enable_ips) \
+ param(int, invert_brightness) \
+ param(int, enable_guc_loading) \
+ param(int, enable_guc_submission) \
+ param(int, guc_log_level) \
+ param(char *, guc_firmware_path) \
+ param(char *, huc_firmware_path) \
+ param(int, use_mmio_flip) \
+ param(int, mmio_debug) \
+ param(int, edp_vswing) \
+ param(int, reset) \
+ param(unsigned int, inject_load_failure) \
/* 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, 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)
+ param(bool, alpha_support) \
+ param(bool, enable_cmd_parser) \
+ param(bool, enable_hangcheck) \
+ param(bool, fastboot) \
+ param(bool, prefault_disable) \
+ param(bool, load_detect_test) \
+ param(bool, force_reset_modeset_test) \
+ param(bool, error_capture) \
+ param(bool, disable_display) \
+ param(bool, verbose_state_checks) \
+ param(bool, nuclear_pageflip) \
+ param(bool, enable_dp_mst) \
+ param(bool, enable_dpcd_backlight) \
+ param(bool, enable_gvt)
-#define MEMBER(T, member) T member
+#define MEMBER(T, member) T member;
struct i915_params {
I915_PARAMS_FOR_EACH(MEMBER);
};
--
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] 17+ messages in thread
* [RFC 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value
2017-09-22 14:27 [RFC 1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible Michal Wajdeczko
@ 2017-09-22 14:27 ` Michal Wajdeczko
2017-09-22 15:15 ` Chris Wilson
2017-09-25 9:30 ` Joonas Lahtinen
2017-09-22 14:27 ` [RFC 3/3] drm/i915: Fix default values of some modparams Michal Wajdeczko
` (5 subsequent siblings)
6 siblings, 2 replies; 17+ messages in thread
From: Michal Wajdeczko @ 2017-09-22 14:27 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula
By combining default value into helper macro we can initialize
modparams struct in the same automatic way as it was declared.
This will initialize members in the same order as declared
and additionally will disallow declaring new member without
proper default value for it.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 2 +-
drivers/gpu/drm/i915/i915_gpu_error.c | 6 +--
drivers/gpu/drm/i915/i915_params.c | 42 ++----------------
drivers/gpu/drm/i915/i915_params.h | 82 +++++++++++++++++------------------
4 files changed, 48 insertions(+), 84 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 13fc259..29c2299 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -67,7 +67,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_modparams.x);
+#define PRINT_PARAM(T, x, ...) seq_print_param(m, #x, #T, &i915_modparams.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 c7aaf62..c76b036 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -567,7 +567,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, ...) err_print_param(m, #x, #T, &p->x);
I915_PARAMS_FOR_EACH(PRINT);
#undef PRINT
}
@@ -861,7 +861,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, ...) free_param(#T, &error->params.x);
I915_PARAMS_FOR_EACH(FREE);
#undef FREE
@@ -1697,7 +1697,7 @@ static int capture(void *data)
error->i915->gt.last_init_time));
error->params = i915_modparams;
-#define DUP(T, x) dup_param(#T, &error->params.x);
+#define DUP(T, x, ...) 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 ec65341..46eab92 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -33,45 +33,9 @@
MODULE_PARM_DESC(name, desc)
struct i915_params i915_modparams __read_mostly = {
- .modeset = -1,
- .panel_ignore_lid = 1,
- .semaphores = -1,
- .lvds_channel_mode = 0,
- .panel_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 = 2,
- .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(T, member, value) .member = value,
+ I915_PARAMS_FOR_EACH(MEMBER)
+#undef MEMBER
};
i915_param_named(modeset, int, 0400,
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index 0116bb9..da59939 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -28,49 +28,49 @@
#include <linux/cache.h> /* for __read_mostly */
#define I915_PARAMS_FOR_EACH(param) \
- param(char *, vbt_firmware) \
- param(int, modeset) \
- param(int, panel_ignore_lid) \
- param(int, semaphores) \
- param(int, lvds_channel_mode) \
- param(int, panel_use_ssc) \
- param(int, vbt_sdvo_panel_type) \
- param(int, enable_rc6) \
- param(int, enable_dc) \
- param(int, enable_fbc) \
- param(int, enable_ppgtt) \
- param(int, enable_execlists) \
- param(int, enable_psr) \
- param(int, disable_power_well) \
- param(int, enable_ips) \
- param(int, invert_brightness) \
- param(int, enable_guc_loading) \
- param(int, enable_guc_submission) \
- param(int, guc_log_level) \
- param(char *, guc_firmware_path) \
- param(char *, huc_firmware_path) \
- param(int, use_mmio_flip) \
- param(int, mmio_debug) \
- param(int, edp_vswing) \
- param(int, reset) \
- param(unsigned int, inject_load_failure) \
+ param(char *, vbt_firmware, NULL) \
+ param(int, modeset, -1) \
+ param(int, panel_ignore_lid, 1) \
+ param(int, semaphores, -1) \
+ param(int, lvds_channel_mode, 0) \
+ param(int, panel_use_ssc, -1) \
+ param(int, vbt_sdvo_panel_type, -1) \
+ param(int, enable_rc6, -1) \
+ param(int, enable_dc, -1) \
+ param(int, enable_fbc, -1) \
+ param(int, enable_ppgtt, -1) \
+ param(int, enable_execlists, -1) \
+ param(int, enable_psr, -1) \
+ param(int, disable_power_well, -1) \
+ param(int, enable_ips, 1) \
+ param(int, invert_brightness, 0) \
+ param(int, enable_guc_loading, 0) \
+ param(int, enable_guc_submission, 0) \
+ param(int, guc_log_level, -1) \
+ param(char *, guc_firmware_path, NULL) \
+ param(char *, huc_firmware_path, NULL) \
+ param(int, use_mmio_flip, 0) \
+ param(int, mmio_debug, 0) \
+ param(int, edp_vswing, 0) \
+ param(int, reset, 2) \
+ param(unsigned int, inject_load_failure, 0) \
/* leave bools at the end to not create holes */ \
- param(bool, alpha_support) \
- param(bool, enable_cmd_parser) \
- param(bool, enable_hangcheck) \
- param(bool, fastboot) \
- param(bool, prefault_disable) \
- param(bool, load_detect_test) \
- param(bool, force_reset_modeset_test) \
- param(bool, error_capture) \
- param(bool, disable_display) \
- param(bool, verbose_state_checks) \
- param(bool, nuclear_pageflip) \
- param(bool, enable_dp_mst) \
- param(bool, enable_dpcd_backlight) \
- param(bool, enable_gvt)
+ param(bool, alpha_support, IS_ENABLED(CONFIG_DRM_I915_ALPHA_SUPPORT)) \
+ param(bool, enable_cmd_parser, true) \
+ param(bool, enable_hangcheck, true) \
+ param(bool, fastboot, 0) \
+ param(bool, prefault_disable, 0) \
+ param(bool, load_detect_test, 0) \
+ param(bool, force_reset_modeset_test, 0) \
+ param(bool, error_capture, true) \
+ param(bool, disable_display, 0) \
+ param(bool, verbose_state_checks, 1) \
+ param(bool, nuclear_pageflip, 0) \
+ param(bool, enable_dp_mst, true) \
+ param(bool, enable_dpcd_backlight, false) \
+ param(bool, enable_gvt, false)
-#define MEMBER(T, member) T member;
+#define MEMBER(T, member, ...) T member;
struct i915_params {
I915_PARAMS_FOR_EACH(MEMBER);
};
--
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] 17+ messages in thread
* [RFC 3/3] drm/i915: Fix default values of some modparams
2017-09-22 14:27 [RFC 1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible Michal Wajdeczko
2017-09-22 14:27 ` [RFC 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value Michal Wajdeczko
@ 2017-09-22 14:27 ` Michal Wajdeczko
2017-09-22 15:18 ` Chris Wilson
2017-09-22 15:12 ` ✓ Fi.CI.BAT: success for series starting with [RFC,1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible Patchwork
` (4 subsequent siblings)
6 siblings, 1 reply; 17+ messages in thread
From: Michal Wajdeczko @ 2017-09-22 14:27 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula
Members should be initialized with values of matching types.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
drivers/gpu/drm/i915/i915_params.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index da59939..4f3f8d6 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -58,14 +58,14 @@
param(bool, alpha_support, IS_ENABLED(CONFIG_DRM_I915_ALPHA_SUPPORT)) \
param(bool, enable_cmd_parser, true) \
param(bool, enable_hangcheck, true) \
- param(bool, fastboot, 0) \
- param(bool, prefault_disable, 0) \
- param(bool, load_detect_test, 0) \
- param(bool, force_reset_modeset_test, 0) \
+ param(bool, fastboot, false) \
+ param(bool, prefault_disable, false) \
+ param(bool, load_detect_test, false) \
+ param(bool, force_reset_modeset_test, false) \
param(bool, error_capture, true) \
- param(bool, disable_display, 0) \
- param(bool, verbose_state_checks, 1) \
- param(bool, nuclear_pageflip, 0) \
+ param(bool, disable_display, false) \
+ param(bool, verbose_state_checks, true) \
+ param(bool, nuclear_pageflip, false) \
param(bool, enable_dp_mst, true) \
param(bool, enable_dpcd_backlight, false) \
param(bool, enable_gvt, false)
--
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] 17+ messages in thread
* ✓ Fi.CI.BAT: success for series starting with [RFC,1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible
2017-09-22 14:27 [RFC 1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible Michal Wajdeczko
2017-09-22 14:27 ` [RFC 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value Michal Wajdeczko
2017-09-22 14:27 ` [RFC 3/3] drm/i915: Fix default values of some modparams Michal Wajdeczko
@ 2017-09-22 15:12 ` Patchwork
2017-09-22 15:12 ` [RFC 1/3] " Chris Wilson
` (3 subsequent siblings)
6 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2017-09-22 15:12 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-gfx
== Series Details ==
Series: series starting with [RFC,1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible
URL : https://patchwork.freedesktop.org/series/30768/
State : success
== Summary ==
Series 30768v1 series starting with [RFC,1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible
https://patchwork.freedesktop.org/api/1.0/series/30768/revisions/1/mbox/
Test chamelium:
Subgroup dp-edid-read:
pass -> FAIL (fi-kbl-7500u) fdo#102672
Test gem_exec_suspend:
Subgroup basic-s3:
pass -> INCOMPLETE (fi-kbl-r) fdo#102850
Test kms_cursor_legacy:
Subgroup basic-busy-flip-before-cursor-legacy:
pass -> FAIL (fi-snb-2600) fdo#100215
Test drv_module_reload:
Subgroup basic-no-display:
dmesg-warn -> PASS (fi-glk-1) fdo#102777
fdo#102672 https://bugs.freedesktop.org/show_bug.cgi?id=102672
fdo#102850 https://bugs.freedesktop.org/show_bug.cgi?id=102850
fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215
fdo#102777 https://bugs.freedesktop.org/show_bug.cgi?id=102777
fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:441s
fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:467s
fi-blb-e6850 total:289 pass:224 dwarn:1 dfail:0 fail:0 skip:64 time:414s
fi-bsw-n3050 total:289 pass:243 dwarn:0 dfail:0 fail:0 skip:46 time:510s
fi-bwr-2160 total:289 pass:184 dwarn:0 dfail:0 fail:0 skip:105 time:277s
fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:504s
fi-byt-j1900 total:289 pass:254 dwarn:1 dfail:0 fail:0 skip:34 time:490s
fi-byt-n2820 total:289 pass:250 dwarn:1 dfail:0 fail:0 skip:38 time:486s
fi-cfl-s total:289 pass:223 dwarn:34 dfail:0 fail:0 skip:32 time:539s
fi-elk-e7500 total:289 pass:230 dwarn:0 dfail:0 fail:0 skip:59 time:413s
fi-glk-1 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:565s
fi-hsw-4770 total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:423s
fi-hsw-4770r total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:404s
fi-ilk-650 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:432s
fi-ivb-3520m total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:485s
fi-ivb-3770 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:462s
fi-kbl-7500u total:289 pass:263 dwarn:1 dfail:0 fail:1 skip:24 time:465s
fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:581s
fi-kbl-r total:118 pass:97 dwarn:0 dfail:0 fail:0 skip:20
fi-pnv-d510 total:289 pass:223 dwarn:1 dfail:0 fail:0 skip:65 time:537s
fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:452s
fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:749s
fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:491s
fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:468s
fi-snb-2520m total:289 pass:251 dwarn:0 dfail:0 fail:0 skip:38 time:567s
fi-snb-2600 total:289 pass:248 dwarn:0 dfail:0 fail:2 skip:39 time:417s
e0e308721fd283e1c5777657a5941f178f0d49e6 drm-tip: 2017y-09m-22d-13h-31m-38s UTC integration manifest
60390eec06dc drm/i915: Fix default values of some modparams
2505ec2c4681 drm/i915: Extend I915_PARAMS_FOR_EACH with default member value
b16f668e9734 drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5794/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC 1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible
2017-09-22 14:27 [RFC 1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible Michal Wajdeczko
` (2 preceding siblings ...)
2017-09-22 15:12 ` ✓ Fi.CI.BAT: success for series starting with [RFC,1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible Patchwork
@ 2017-09-22 15:12 ` Chris Wilson
2017-09-22 20:01 ` ✗ Fi.CI.IGT: failure for series starting with [RFC,1/3] " Patchwork
` (2 subsequent siblings)
6 siblings, 0 replies; 17+ messages in thread
From: Chris Wilson @ 2017-09-22 15:12 UTC (permalink / raw)
To: Michal Wajdeczko, intel-gfx; +Cc: Jani Nikula
Quoting Michal Wajdeczko (2017-09-22 15:27:24)
> We should not add trailing ; after each member allow other
> than statements-style uses of this helper macro.
> While here s/func/param for clarity.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Jani Nikula <jani.nikula@intel.com>
Ok, looks like the trailing ; already snuck into the other users.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value
2017-09-22 14:27 ` [RFC 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value Michal Wajdeczko
@ 2017-09-22 15:15 ` Chris Wilson
2017-09-22 19:05 ` Jani Nikula
2017-09-25 9:30 ` Joonas Lahtinen
1 sibling, 1 reply; 17+ messages in thread
From: Chris Wilson @ 2017-09-22 15:15 UTC (permalink / raw)
To: Michal Wajdeczko, intel-gfx; +Cc: Jani Nikula
Quoting Michal Wajdeczko (2017-09-22 15:27:25)
> By combining default value into helper macro we can initialize
> modparams struct in the same automatic way as it was declared.
> This will initialize members in the same order as declared
> and additionally will disallow declaring new member without
> proper default value for it.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Overall, I think this is a positive change. I'm not completely happy
that the param() macro is more readable than the struct assignment, but
that is offset by the reduction in duplication.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC 3/3] drm/i915: Fix default values of some modparams
2017-09-22 14:27 ` [RFC 3/3] drm/i915: Fix default values of some modparams Michal Wajdeczko
@ 2017-09-22 15:18 ` Chris Wilson
0 siblings, 0 replies; 17+ messages in thread
From: Chris Wilson @ 2017-09-22 15:18 UTC (permalink / raw)
To: Michal Wajdeczko, intel-gfx; +Cc: Jani Nikula
Quoting Michal Wajdeczko (2017-09-22 15:27:26)
> Members should be initialized with values of matching types.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Perhaps typecheck(T, value) could sneak in somewhere. Add a sanitycheck
to i915_params.c?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value
2017-09-22 15:15 ` Chris Wilson
@ 2017-09-22 19:05 ` Jani Nikula
2017-09-25 9:19 ` Joonas Lahtinen
2017-09-25 9:31 ` Michal Wajdeczko
0 siblings, 2 replies; 17+ messages in thread
From: Jani Nikula @ 2017-09-22 19:05 UTC (permalink / raw)
To: Chris Wilson, Michal Wajdeczko, intel-gfx
On Fri, 22 Sep 2017, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Quoting Michal Wajdeczko (2017-09-22 15:27:25)
>> By combining default value into helper macro we can initialize
>> modparams struct in the same automatic way as it was declared.
>> This will initialize members in the same order as declared
>> and additionally will disallow declaring new member without
>> proper default value for it.
>>
>> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Jani Nikula <jani.nikula@intel.com>
>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>
> Overall, I think this is a positive change. I'm not completely happy
> that the param() macro is more readable than the struct assignment, but
> that is offset by the reduction in duplication.
I'm also not completely happy that the default values get moved away
from the param descriptions. (Hmm, what next, putting the permissions
and descriptions in I915_PARAMS_FOR_EACH too?! :o)
There's also the benefit of being able to highlight the changed values
and displaying the defaults in debugfs if desired.
On the series,
Acked-by: Jani Nikula <jani.nikula@intel.com>
--
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] 17+ messages in thread
* ✗ Fi.CI.IGT: failure for series starting with [RFC,1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible
2017-09-22 14:27 [RFC 1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible Michal Wajdeczko
` (3 preceding siblings ...)
2017-09-22 15:12 ` [RFC 1/3] " Chris Wilson
@ 2017-09-22 20:01 ` Patchwork
2017-09-25 9:45 ` [PATCH v2 1/3] " Michal Wajdeczko
2017-09-25 10:06 ` ✗ Fi.CI.BAT: failure for series starting with [v2,3/3] drm/i915: Fix default values of some modparams (rev4) Patchwork
6 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2017-09-22 20:01 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-gfx
== Series Details ==
Series: series starting with [RFC,1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible
URL : https://patchwork.freedesktop.org/series/30768/
State : failure
== Summary ==
Test kms_setmode:
Subgroup basic:
pass -> FAIL (shard-hsw) fdo#99912
Test perf:
Subgroup blocking:
pass -> FAIL (shard-hsw) fdo#102252 +1
Test kms_frontbuffer_tracking:
Subgroup fbc-1p-primscrn-pri-indfb-draw-blt:
skip -> PASS (shard-hsw)
Test kms_atomic_transition:
Subgroup plane-all-transition-nonblocking-fencing:
pass -> FAIL (shard-hsw)
Test kms_draw_crc:
Subgroup draw-method-xrgb8888-mmap-wc-xtiled:
pass -> SKIP (shard-hsw)
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
shard-hsw total:2429 pass:1330 dwarn:1 dfail:0 fail:14 skip:1084 time:9861s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5794/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value
2017-09-22 19:05 ` Jani Nikula
@ 2017-09-25 9:19 ` Joonas Lahtinen
2017-09-25 9:31 ` Michal Wajdeczko
1 sibling, 0 replies; 17+ messages in thread
From: Joonas Lahtinen @ 2017-09-25 9:19 UTC (permalink / raw)
To: Jani Nikula, Chris Wilson, Michal Wajdeczko, intel-gfx
On Fri, 2017-09-22 at 22:05 +0300, Jani Nikula wrote:
> On Fri, 22 Sep 2017, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > Quoting Michal Wajdeczko (2017-09-22 15:27:25)
> > > By combining default value into helper macro we can initialize
> > > modparams struct in the same automatic way as it was declared.
> > > This will initialize members in the same order as declared
> > > and additionally will disallow declaring new member without
> > > proper default value for it.
> > >
> > > Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> > > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > > Cc: Jani Nikula <jani.nikula@intel.com>
> > > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> >
> > Overall, I think this is a positive change. I'm not completely happy
> > that the param() macro is more readable than the struct assignment, but
> > that is offset by the reduction in duplication.
>
> I'm also not completely happy that the default values get moved away
> from the param descriptions. (Hmm, what next, putting the permissions
> and descriptions in I915_PARAMS_FOR_EACH too?! :o)
>
> There's also the benefit of being able to highlight the changed values
> and displaying the defaults in debugfs if desired.
Yes, I think this would be useful going forward.
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] 17+ messages in thread
* Re: [RFC 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value
2017-09-22 14:27 ` [RFC 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value Michal Wajdeczko
2017-09-22 15:15 ` Chris Wilson
@ 2017-09-25 9:30 ` Joonas Lahtinen
1 sibling, 0 replies; 17+ messages in thread
From: Joonas Lahtinen @ 2017-09-25 9:30 UTC (permalink / raw)
To: Michal Wajdeczko, intel-gfx; +Cc: Jani Nikula
On Fri, 2017-09-22 at 14:27 +0000, Michal Wajdeczko wrote:
> By combining default value into helper macro we can initialize
> modparams struct in the same automatic way as it was declared.
> This will initialize members in the same order as declared
> and additionally will disallow declaring new member without
> proper default value for it.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Ha, seems like you beat me to it :) (https://lists.freedesktop.org/arch
ives/intel-gfx/2017-September/139268.html)
<SNIP>
> @@ -33,45 +33,9 @@
> MODULE_PARM_DESC(name, desc)
>
> struct i915_params i915_modparams __read_mostly = {
> - .modeset = -1,
> - .panel_ignore_lid = 1,
> - .semaphores = -1,
> - .lvds_channel_mode = 0,
> - .panel_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 = 2,
> - .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(T, member, value) .member = value,
Should be .member = (value),
With that;
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
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] 17+ messages in thread
* Re: [RFC 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value
2017-09-22 19:05 ` Jani Nikula
2017-09-25 9:19 ` Joonas Lahtinen
@ 2017-09-25 9:31 ` Michal Wajdeczko
1 sibling, 0 replies; 17+ messages in thread
From: Michal Wajdeczko @ 2017-09-25 9:31 UTC (permalink / raw)
To: Chris Wilson, intel-gfx, Jani Nikula
On Fri, 22 Sep 2017 21:05:11 +0200, Jani Nikula <jani.nikula@intel.com>
wrote:
> On Fri, 22 Sep 2017, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>> Quoting Michal Wajdeczko (2017-09-22 15:27:25)
>>> By combining default value into helper macro we can initialize
>>> modparams struct in the same automatic way as it was declared.
>>> This will initialize members in the same order as declared
>>> and additionally will disallow declaring new member without
>>> proper default value for it.
>>>
>>> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>>> Cc: Jani Nikula <jani.nikula@intel.com>
>>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>>
>> Overall, I think this is a positive change. I'm not completely happy
>> that the param() macro is more readable than the struct assignment, but
>> that is offset by the reduction in duplication.
>
> I'm also not completely happy that the default values get moved away
> from the param descriptions. (Hmm, what next, putting the permissions
> and descriptions in I915_PARAMS_FOR_EACH too?! :o)
>
In fact, I was already trying that ;)
https://patchwork.freedesktop.org/patch/162037/
> There's also the benefit of being able to highlight the changed values
> and displaying the defaults in debugfs if desired.
And such highlight was also there
https://patchwork.freedesktop.org/patch/162038/
Michal
>
> On the series,
>
> Acked-by: Jani Nikula <jani.nikula@intel.com>
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible
2017-09-22 14:27 [RFC 1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible Michal Wajdeczko
` (4 preceding siblings ...)
2017-09-22 20:01 ` ✗ Fi.CI.IGT: failure for series starting with [RFC,1/3] " Patchwork
@ 2017-09-25 9:45 ` Michal Wajdeczko
2017-09-25 9:45 ` [PATCH v2 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value Michal Wajdeczko
2017-09-25 9:45 ` [PATCH v2 3/3] drm/i915: Fix default values of some modparams Michal Wajdeczko
2017-09-25 10:06 ` ✗ Fi.CI.BAT: failure for series starting with [v2,3/3] drm/i915: Fix default values of some modparams (rev4) Patchwork
6 siblings, 2 replies; 17+ messages in thread
From: Michal Wajdeczko @ 2017-09-25 9:45 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula
We should not add trailing ; after each member allow other
than statements-style uses of this helper macro.
While here s/func/param for clarity.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_params.h | 84 +++++++++++++++++++-------------------
1 file changed, 42 insertions(+), 42 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index a2cbb47..0116bb9 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -27,50 +27,50 @@
#include <linux/cache.h> /* for __read_mostly */
-#define I915_PARAMS_FOR_EACH(func) \
- func(char *, vbt_firmware); \
- 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(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(int, reset); \
- func(unsigned int, inject_load_failure); \
+#define I915_PARAMS_FOR_EACH(param) \
+ param(char *, vbt_firmware) \
+ param(int, modeset) \
+ param(int, panel_ignore_lid) \
+ param(int, semaphores) \
+ param(int, lvds_channel_mode) \
+ param(int, panel_use_ssc) \
+ param(int, vbt_sdvo_panel_type) \
+ param(int, enable_rc6) \
+ param(int, enable_dc) \
+ param(int, enable_fbc) \
+ param(int, enable_ppgtt) \
+ param(int, enable_execlists) \
+ param(int, enable_psr) \
+ param(int, disable_power_well) \
+ param(int, enable_ips) \
+ param(int, invert_brightness) \
+ param(int, enable_guc_loading) \
+ param(int, enable_guc_submission) \
+ param(int, guc_log_level) \
+ param(char *, guc_firmware_path) \
+ param(char *, huc_firmware_path) \
+ param(int, use_mmio_flip) \
+ param(int, mmio_debug) \
+ param(int, edp_vswing) \
+ param(int, reset) \
+ param(unsigned int, inject_load_failure) \
/* 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, 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)
+ param(bool, alpha_support) \
+ param(bool, enable_cmd_parser) \
+ param(bool, enable_hangcheck) \
+ param(bool, fastboot) \
+ param(bool, prefault_disable) \
+ param(bool, load_detect_test) \
+ param(bool, force_reset_modeset_test) \
+ param(bool, error_capture) \
+ param(bool, disable_display) \
+ param(bool, verbose_state_checks) \
+ param(bool, nuclear_pageflip) \
+ param(bool, enable_dp_mst) \
+ param(bool, enable_dpcd_backlight) \
+ param(bool, enable_gvt)
-#define MEMBER(T, member) T member
+#define MEMBER(T, member) T member;
struct i915_params {
I915_PARAMS_FOR_EACH(MEMBER);
};
--
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] 17+ messages in thread
* [PATCH v2 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value
2017-09-25 9:45 ` [PATCH v2 1/3] " Michal Wajdeczko
@ 2017-09-25 9:45 ` Michal Wajdeczko
2017-09-25 10:23 ` Joonas Lahtinen
2017-09-25 9:45 ` [PATCH v2 3/3] drm/i915: Fix default values of some modparams Michal Wajdeczko
1 sibling, 1 reply; 17+ messages in thread
From: Michal Wajdeczko @ 2017-09-25 9:45 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula
By combining default value into helper macro we can initialize
modparams struct in the same automatic way as it was declared.
This will initialize members in the same order as declared
and additionally will disallow declaring new member without
proper default value for it.
v2: make MEMBER macro more robust (Joonas)
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 2 +-
drivers/gpu/drm/i915/i915_gpu_error.c | 6 +--
drivers/gpu/drm/i915/i915_params.c | 42 ++----------------
drivers/gpu/drm/i915/i915_params.h | 82 +++++++++++++++++------------------
4 files changed, 48 insertions(+), 84 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 847f8e8..b4a6ac6 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -67,7 +67,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_modparams.x);
+#define PRINT_PARAM(T, x, ...) seq_print_param(m, #x, #T, &i915_modparams.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 12146d7..c14552a 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -572,7 +572,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, ...) err_print_param(m, #x, #T, &p->x);
I915_PARAMS_FOR_EACH(PRINT);
#undef PRINT
}
@@ -866,7 +866,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, ...) free_param(#T, &error->params.x);
I915_PARAMS_FOR_EACH(FREE);
#undef FREE
@@ -1704,7 +1704,7 @@ static int capture(void *data)
error->i915->gt.last_init_time));
error->params = i915_modparams;
-#define DUP(T, x) dup_param(#T, &error->params.x);
+#define DUP(T, x, ...) 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 ec65341..9dff323 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -33,45 +33,9 @@
MODULE_PARM_DESC(name, desc)
struct i915_params i915_modparams __read_mostly = {
- .modeset = -1,
- .panel_ignore_lid = 1,
- .semaphores = -1,
- .lvds_channel_mode = 0,
- .panel_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 = 2,
- .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(T, member, value) .member = (value),
+ I915_PARAMS_FOR_EACH(MEMBER)
+#undef MEMBER
};
i915_param_named(modeset, int, 0400,
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index 0116bb9..da59939 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -28,49 +28,49 @@
#include <linux/cache.h> /* for __read_mostly */
#define I915_PARAMS_FOR_EACH(param) \
- param(char *, vbt_firmware) \
- param(int, modeset) \
- param(int, panel_ignore_lid) \
- param(int, semaphores) \
- param(int, lvds_channel_mode) \
- param(int, panel_use_ssc) \
- param(int, vbt_sdvo_panel_type) \
- param(int, enable_rc6) \
- param(int, enable_dc) \
- param(int, enable_fbc) \
- param(int, enable_ppgtt) \
- param(int, enable_execlists) \
- param(int, enable_psr) \
- param(int, disable_power_well) \
- param(int, enable_ips) \
- param(int, invert_brightness) \
- param(int, enable_guc_loading) \
- param(int, enable_guc_submission) \
- param(int, guc_log_level) \
- param(char *, guc_firmware_path) \
- param(char *, huc_firmware_path) \
- param(int, use_mmio_flip) \
- param(int, mmio_debug) \
- param(int, edp_vswing) \
- param(int, reset) \
- param(unsigned int, inject_load_failure) \
+ param(char *, vbt_firmware, NULL) \
+ param(int, modeset, -1) \
+ param(int, panel_ignore_lid, 1) \
+ param(int, semaphores, -1) \
+ param(int, lvds_channel_mode, 0) \
+ param(int, panel_use_ssc, -1) \
+ param(int, vbt_sdvo_panel_type, -1) \
+ param(int, enable_rc6, -1) \
+ param(int, enable_dc, -1) \
+ param(int, enable_fbc, -1) \
+ param(int, enable_ppgtt, -1) \
+ param(int, enable_execlists, -1) \
+ param(int, enable_psr, -1) \
+ param(int, disable_power_well, -1) \
+ param(int, enable_ips, 1) \
+ param(int, invert_brightness, 0) \
+ param(int, enable_guc_loading, 0) \
+ param(int, enable_guc_submission, 0) \
+ param(int, guc_log_level, -1) \
+ param(char *, guc_firmware_path, NULL) \
+ param(char *, huc_firmware_path, NULL) \
+ param(int, use_mmio_flip, 0) \
+ param(int, mmio_debug, 0) \
+ param(int, edp_vswing, 0) \
+ param(int, reset, 2) \
+ param(unsigned int, inject_load_failure, 0) \
/* leave bools at the end to not create holes */ \
- param(bool, alpha_support) \
- param(bool, enable_cmd_parser) \
- param(bool, enable_hangcheck) \
- param(bool, fastboot) \
- param(bool, prefault_disable) \
- param(bool, load_detect_test) \
- param(bool, force_reset_modeset_test) \
- param(bool, error_capture) \
- param(bool, disable_display) \
- param(bool, verbose_state_checks) \
- param(bool, nuclear_pageflip) \
- param(bool, enable_dp_mst) \
- param(bool, enable_dpcd_backlight) \
- param(bool, enable_gvt)
+ param(bool, alpha_support, IS_ENABLED(CONFIG_DRM_I915_ALPHA_SUPPORT)) \
+ param(bool, enable_cmd_parser, true) \
+ param(bool, enable_hangcheck, true) \
+ param(bool, fastboot, 0) \
+ param(bool, prefault_disable, 0) \
+ param(bool, load_detect_test, 0) \
+ param(bool, force_reset_modeset_test, 0) \
+ param(bool, error_capture, true) \
+ param(bool, disable_display, 0) \
+ param(bool, verbose_state_checks, 1) \
+ param(bool, nuclear_pageflip, 0) \
+ param(bool, enable_dp_mst, true) \
+ param(bool, enable_dpcd_backlight, false) \
+ param(bool, enable_gvt, false)
-#define MEMBER(T, member) T member;
+#define MEMBER(T, member, ...) T member;
struct i915_params {
I915_PARAMS_FOR_EACH(MEMBER);
};
--
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] 17+ messages in thread
* [PATCH v2 3/3] drm/i915: Fix default values of some modparams
2017-09-25 9:45 ` [PATCH v2 1/3] " Michal Wajdeczko
2017-09-25 9:45 ` [PATCH v2 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value Michal Wajdeczko
@ 2017-09-25 9:45 ` Michal Wajdeczko
1 sibling, 0 replies; 17+ messages in thread
From: Michal Wajdeczko @ 2017-09-25 9:45 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula
Members should be initialized with values of matching types.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_params.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index da59939..4f3f8d6 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -58,14 +58,14 @@
param(bool, alpha_support, IS_ENABLED(CONFIG_DRM_I915_ALPHA_SUPPORT)) \
param(bool, enable_cmd_parser, true) \
param(bool, enable_hangcheck, true) \
- param(bool, fastboot, 0) \
- param(bool, prefault_disable, 0) \
- param(bool, load_detect_test, 0) \
- param(bool, force_reset_modeset_test, 0) \
+ param(bool, fastboot, false) \
+ param(bool, prefault_disable, false) \
+ param(bool, load_detect_test, false) \
+ param(bool, force_reset_modeset_test, false) \
param(bool, error_capture, true) \
- param(bool, disable_display, 0) \
- param(bool, verbose_state_checks, 1) \
- param(bool, nuclear_pageflip, 0) \
+ param(bool, disable_display, false) \
+ param(bool, verbose_state_checks, true) \
+ param(bool, nuclear_pageflip, false) \
param(bool, enable_dp_mst, true) \
param(bool, enable_dpcd_backlight, false) \
param(bool, enable_gvt, false)
--
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] 17+ messages in thread
* ✗ Fi.CI.BAT: failure for series starting with [v2,3/3] drm/i915: Fix default values of some modparams (rev4)
2017-09-22 14:27 [RFC 1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible Michal Wajdeczko
` (5 preceding siblings ...)
2017-09-25 9:45 ` [PATCH v2 1/3] " Michal Wajdeczko
@ 2017-09-25 10:06 ` Patchwork
6 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2017-09-25 10:06 UTC (permalink / raw)
To: Michal Wajdeczko; +Cc: intel-gfx
== Series Details ==
Series: series starting with [v2,3/3] drm/i915: Fix default values of some modparams (rev4)
URL : https://patchwork.freedesktop.org/series/30768/
State : failure
== Summary ==
Series 30768 revision 4 was fully merged or fully failed: no git log
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value
2017-09-25 9:45 ` [PATCH v2 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value Michal Wajdeczko
@ 2017-09-25 10:23 ` Joonas Lahtinen
0 siblings, 0 replies; 17+ messages in thread
From: Joonas Lahtinen @ 2017-09-25 10:23 UTC (permalink / raw)
To: Michal Wajdeczko, intel-gfx; +Cc: Jani Nikula
On Mon, 2017-09-25 at 09:45 +0000, Michal Wajdeczko wrote:
> By combining default value into helper macro we can initialize
> modparams struct in the same automatic way as it was declared.
> This will initialize members in the same order as declared
> and additionally will disallow declaring new member without
> proper default value for it.
>
> v2: make MEMBER macro more robust (Joonas)
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> Acked-by: Jani Nikula <jani.nikula@intel.com>
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
<SNIP>
> +++ b/drivers/gpu/drm/i915/i915_params.c
> @@ -33,45 +33,9 @@
> MODULE_PARM_DESC(name, desc)
>
> struct i915_params i915_modparams __read_mostly = {
> - .modeset = -1,
> - .panel_ignore_lid = 1,
> - .semaphores = -1,
> - .lvds_channel_mode = 0,
> - .panel_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 = 2,
> - .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(T, member, value) .member = (value),
> + I915_PARAMS_FOR_EACH(MEMBER)
To fix the problem that next patch is needed for;
.member = typecheck(T, (value)) ? (value) : (value),
Assuming it won't mess up GCC code generation. Can be sent as an extra
patch on top when this gets in.
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] 17+ messages in thread
end of thread, other threads:[~2017-09-25 10:23 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-22 14:27 [RFC 1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible Michal Wajdeczko
2017-09-22 14:27 ` [RFC 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value Michal Wajdeczko
2017-09-22 15:15 ` Chris Wilson
2017-09-22 19:05 ` Jani Nikula
2017-09-25 9:19 ` Joonas Lahtinen
2017-09-25 9:31 ` Michal Wajdeczko
2017-09-25 9:30 ` Joonas Lahtinen
2017-09-22 14:27 ` [RFC 3/3] drm/i915: Fix default values of some modparams Michal Wajdeczko
2017-09-22 15:18 ` Chris Wilson
2017-09-22 15:12 ` ✓ Fi.CI.BAT: success for series starting with [RFC,1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible Patchwork
2017-09-22 15:12 ` [RFC 1/3] " Chris Wilson
2017-09-22 20:01 ` ✗ Fi.CI.IGT: failure for series starting with [RFC,1/3] " Patchwork
2017-09-25 9:45 ` [PATCH v2 1/3] " Michal Wajdeczko
2017-09-25 9:45 ` [PATCH v2 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value Michal Wajdeczko
2017-09-25 10:23 ` Joonas Lahtinen
2017-09-25 9:45 ` [PATCH v2 3/3] drm/i915: Fix default values of some modparams Michal Wajdeczko
2017-09-25 10:06 ` ✗ Fi.CI.BAT: failure for series starting with [v2,3/3] drm/i915: Fix default values of some modparams (rev4) Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox