From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
intel-gfx@lists.freedesktop.org
Cc: Jani Nikula <jani.nikula@intel.com>
Subject: Re: [PATCH v2 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value
Date: Mon, 25 Sep 2017 13:23:03 +0300 [thread overview]
Message-ID: <1506334983.5593.26.camel@linux.intel.com> (raw)
In-Reply-To: <20170925094551.15052-2-michal.wajdeczko@intel.com>
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
next prev parent reply other threads:[~2017-09-25 10:23 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
-- strict thread matches above, loose matches on Subject: below --
2017-09-25 10:50 [PATCH v2 1/3] drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible Michal Wajdeczko
2017-09-25 10:50 ` [PATCH v2 2/3] drm/i915: Extend I915_PARAMS_FOR_EACH with default member value Michal Wajdeczko
2017-09-25 11:01 ` Jani Nikula
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1506334983.5593.26.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=michal.wajdeczko@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox