[Intel-gfx] [RFC 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Mon Sep 25 09:30:11 UTC 2017


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 at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Jani Nikula <jani.nikula at intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen at 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 at linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list