summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_params.h
diff options
context:
space:
mode:
authorMichal Wajdeczko <michal.wajdeczko@intel.com>2017-09-25 13:50:07 +0300
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>2017-09-26 11:22:23 +0300
commit7075cb855d493487805ecf113874c04218d16014 (patch)
tree1da7f4dbe1f5b47101b754e522bff959664fb6f1 /drivers/gpu/drm/i915/i915_params.h
parent54fea2b974a076799e427e50644de7c6ca662be5 (diff)
downloadlinux-7075cb855d493487805ecf113874c04218d16014.tar.xz
drm/i915: Extend I915_PARAMS_FOR_EACH with default member value
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> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170925105008.46060-2-michal.wajdeczko@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_params.h')
-rw-r--r--drivers/gpu/drm/i915/i915_params.h82
1 files changed, 41 insertions, 41 deletions
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index 0116bb9713e3..da599395f2ba 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);
};