mirror of
https://github.com/torvalds/linux.git
synced 2026-04-30 12:32:31 -04:00
drm/i915/params: switch to device specific parameters
Start using device specific parameters instead of module parameters for most things. The module parameters become the immutable initial values for i915 parameters. The device specific parameters in i915->params start life as a copy of i915_modparams. Any later changes are only reflected in the debugfs. The stragglers are: * i915.force_probe and i915.modeset. Needed before dev_priv is available. This is fine because the parameters are read-only and never modified. * i915.verbose_state_checks. Passing dev_priv to I915_STATE_WARN and I915_STATE_WARN_ON would result in massive and ugly churn. This is handled by not exposing the parameter via debugfs, and leaving the parameter writable in sysfs. This may be fixed up in follow-up work. * i915.inject_probe_failure. Only makes sense in terms of the module, not the device. This is handled by not exposing the parameter via debugfs. v2: Fix uc i915 lookup code (Michał Winiarski) Cc: Juha-Pekka Heikkilä <juha-pekka.heikkila@intel.com> Cc: Venkata Sandeep Dhanalakota <venkata.s.dhanalakota@intel.com> Cc: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Acked-by: Michał Winiarski <michal.winiarski@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20200618150402.14022-1-jani.nikula@intel.com
This commit is contained in:
@@ -479,7 +479,7 @@ parse_sdvo_panel_data(struct drm_i915_private *dev_priv,
|
||||
struct drm_display_mode *panel_fixed_mode;
|
||||
int index;
|
||||
|
||||
index = i915_modparams.vbt_sdvo_panel_type;
|
||||
index = dev_priv->params.vbt_sdvo_panel_type;
|
||||
if (index == -2) {
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
"Ignore SDVO panel mode from BIOS VBT tables.\n");
|
||||
@@ -829,9 +829,9 @@ parse_edp(struct drm_i915_private *dev_priv, const struct bdb_header *bdb)
|
||||
u8 vswing;
|
||||
|
||||
/* Don't read from VBT if module parameter has valid value*/
|
||||
if (i915_modparams.edp_vswing) {
|
||||
if (dev_priv->params.edp_vswing) {
|
||||
dev_priv->vbt.edp.low_vswing =
|
||||
i915_modparams.edp_vswing == 1;
|
||||
dev_priv->params.edp_vswing == 1;
|
||||
} else {
|
||||
vswing = (edp->edp_vswing_preemph >> (panel_type * 4)) & 0xF;
|
||||
dev_priv->vbt.edp.low_vswing = vswing == 0;
|
||||
|
||||
@@ -833,7 +833,7 @@ intel_crt_detect(struct drm_connector *connector,
|
||||
connector->base.id, connector->name,
|
||||
force);
|
||||
|
||||
if (i915_modparams.load_detect_test) {
|
||||
if (dev_priv->params.load_detect_test) {
|
||||
wakeref = intel_display_power_get(dev_priv,
|
||||
intel_encoder->power_domain);
|
||||
goto load_detect;
|
||||
@@ -889,7 +889,7 @@ load_detect:
|
||||
else if (INTEL_GEN(dev_priv) < 4)
|
||||
status = intel_crt_load_detect(crt,
|
||||
to_intel_crtc(connector->state->crtc)->pipe);
|
||||
else if (i915_modparams.load_detect_test)
|
||||
else if (dev_priv->params.load_detect_test)
|
||||
status = connector_status_disconnected;
|
||||
else
|
||||
status = connector_status_unknown;
|
||||
|
||||
@@ -723,15 +723,15 @@ void intel_csr_ucode_init(struct drm_i915_private *dev_priv)
|
||||
csr->max_fw_size = BXT_CSR_MAX_FW_SIZE;
|
||||
}
|
||||
|
||||
if (i915_modparams.dmc_firmware_path) {
|
||||
if (strlen(i915_modparams.dmc_firmware_path) == 0) {
|
||||
if (dev_priv->params.dmc_firmware_path) {
|
||||
if (strlen(dev_priv->params.dmc_firmware_path) == 0) {
|
||||
csr->fw_path = NULL;
|
||||
drm_info(&dev_priv->drm,
|
||||
"Disabling CSR firmware and runtime PM\n");
|
||||
return;
|
||||
}
|
||||
|
||||
csr->fw_path = i915_modparams.dmc_firmware_path;
|
||||
csr->fw_path = dev_priv->params.dmc_firmware_path;
|
||||
/* Bypass version check for firmware override. */
|
||||
csr->required_version = 0;
|
||||
}
|
||||
|
||||
@@ -4886,7 +4886,7 @@ void intel_prepare_reset(struct drm_i915_private *dev_priv)
|
||||
int ret;
|
||||
|
||||
/* reset doesn't touch the display */
|
||||
if (!i915_modparams.force_reset_modeset_test &&
|
||||
if (!dev_priv->params.force_reset_modeset_test &&
|
||||
!gpu_reset_clobbers_display(dev_priv))
|
||||
return;
|
||||
|
||||
@@ -7882,7 +7882,7 @@ bool hsw_crtc_state_ips_capable(const struct intel_crtc_state *crtc_state)
|
||||
if (!hsw_crtc_supports_ips(crtc))
|
||||
return false;
|
||||
|
||||
if (!i915_modparams.enable_ips)
|
||||
if (!dev_priv->params.enable_ips)
|
||||
return false;
|
||||
|
||||
if (crtc_state->pipe_bpp > 24)
|
||||
@@ -8153,8 +8153,8 @@ static void intel_panel_sanitize_ssc(struct drm_i915_private *dev_priv)
|
||||
|
||||
static bool intel_panel_use_ssc(struct drm_i915_private *dev_priv)
|
||||
{
|
||||
if (i915_modparams.panel_use_ssc >= 0)
|
||||
return i915_modparams.panel_use_ssc != 0;
|
||||
if (dev_priv->params.panel_use_ssc >= 0)
|
||||
return dev_priv->params.panel_use_ssc != 0;
|
||||
return dev_priv->vbt.lvds_use_ssc
|
||||
&& !(dev_priv->quirks & QUIRK_LVDS_SSC_DISABLE);
|
||||
}
|
||||
@@ -13585,8 +13585,8 @@ pipe_config_mismatch(bool fastset, const struct intel_crtc *crtc,
|
||||
|
||||
static bool fastboot_enabled(struct drm_i915_private *dev_priv)
|
||||
{
|
||||
if (i915_modparams.fastboot != -1)
|
||||
return i915_modparams.fastboot;
|
||||
if (dev_priv->params.fastboot != -1)
|
||||
return dev_priv->params.fastboot;
|
||||
|
||||
/* Enable fastboot by default on Skylake and newer */
|
||||
if (INTEL_GEN(dev_priv) >= 9)
|
||||
|
||||
@@ -125,7 +125,7 @@ static int i915_ips_status(struct seq_file *m, void *unused)
|
||||
wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
|
||||
|
||||
seq_printf(m, "Enabled by kernel parameter: %s\n",
|
||||
yesno(i915_modparams.enable_ips));
|
||||
yesno(dev_priv->params.enable_ips));
|
||||
|
||||
if (INTEL_GEN(dev_priv) >= 8) {
|
||||
seq_puts(m, "Currently: unknown\n");
|
||||
|
||||
@@ -4513,7 +4513,7 @@ static u32 get_allowed_dc_mask(const struct drm_i915_private *dev_priv,
|
||||
mask = 0;
|
||||
}
|
||||
|
||||
if (!i915_modparams.disable_power_well)
|
||||
if (!dev_priv->params.disable_power_well)
|
||||
max_dc = 0;
|
||||
|
||||
if (enable_dc >= 0 && enable_dc <= max_dc) {
|
||||
@@ -4602,11 +4602,11 @@ int intel_power_domains_init(struct drm_i915_private *dev_priv)
|
||||
struct i915_power_domains *power_domains = &dev_priv->power_domains;
|
||||
int err;
|
||||
|
||||
i915_modparams.disable_power_well =
|
||||
dev_priv->params.disable_power_well =
|
||||
sanitize_disable_power_well_option(dev_priv,
|
||||
i915_modparams.disable_power_well);
|
||||
dev_priv->params.disable_power_well);
|
||||
dev_priv->csr.allowed_dc_mask =
|
||||
get_allowed_dc_mask(dev_priv, i915_modparams.enable_dc);
|
||||
get_allowed_dc_mask(dev_priv, dev_priv->params.enable_dc);
|
||||
|
||||
dev_priv->csr.target_dc_state =
|
||||
sanitize_target_dc_state(dev_priv, DC_STATE_EN_UPTO_DC6);
|
||||
@@ -5568,7 +5568,7 @@ void intel_power_domains_init_hw(struct drm_i915_private *i915, bool resume)
|
||||
intel_display_power_get(i915, POWER_DOMAIN_INIT);
|
||||
|
||||
/* Disable power support if the user asked so. */
|
||||
if (!i915_modparams.disable_power_well)
|
||||
if (!i915->params.disable_power_well)
|
||||
intel_display_power_get(i915, POWER_DOMAIN_INIT);
|
||||
intel_power_domains_sync_hw(i915);
|
||||
|
||||
@@ -5592,7 +5592,7 @@ void intel_power_domains_driver_remove(struct drm_i915_private *i915)
|
||||
fetch_and_zero(&i915->power_domains.wakeref);
|
||||
|
||||
/* Remove the refcount we took to keep power well support disabled. */
|
||||
if (!i915_modparams.disable_power_well)
|
||||
if (!i915->params.disable_power_well)
|
||||
intel_display_power_put_unchecked(i915, POWER_DOMAIN_INIT);
|
||||
|
||||
intel_display_power_flush_work_sync(i915);
|
||||
@@ -5681,7 +5681,7 @@ void intel_power_domains_suspend(struct drm_i915_private *i915,
|
||||
* Even if power well support was disabled we still want to disable
|
||||
* power wells if power domains must be deinitialized for suspend.
|
||||
*/
|
||||
if (!i915_modparams.disable_power_well)
|
||||
if (!i915->params.disable_power_well)
|
||||
intel_display_power_put_unchecked(i915, POWER_DOMAIN_INIT);
|
||||
|
||||
intel_display_power_flush_work(i915);
|
||||
|
||||
@@ -4707,7 +4707,9 @@ intel_dp_sink_can_mst(struct intel_dp *intel_dp)
|
||||
static bool
|
||||
intel_dp_can_mst(struct intel_dp *intel_dp)
|
||||
{
|
||||
return i915_modparams.enable_dp_mst &&
|
||||
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
|
||||
|
||||
return i915->params.enable_dp_mst &&
|
||||
intel_dp->can_mst &&
|
||||
intel_dp_sink_can_mst(intel_dp);
|
||||
}
|
||||
@@ -4724,13 +4726,13 @@ intel_dp_configure_mst(struct intel_dp *intel_dp)
|
||||
"[ENCODER:%d:%s] MST support: port: %s, sink: %s, modparam: %s\n",
|
||||
encoder->base.base.id, encoder->base.name,
|
||||
yesno(intel_dp->can_mst), yesno(sink_can_mst),
|
||||
yesno(i915_modparams.enable_dp_mst));
|
||||
yesno(i915->params.enable_dp_mst));
|
||||
|
||||
if (!intel_dp->can_mst)
|
||||
return;
|
||||
|
||||
intel_dp->is_mst = sink_can_mst &&
|
||||
i915_modparams.enable_dp_mst;
|
||||
i915->params.enable_dp_mst;
|
||||
|
||||
drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr,
|
||||
intel_dp->is_mst);
|
||||
|
||||
@@ -348,7 +348,7 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector)
|
||||
struct intel_dp *intel_dp = enc_to_intel_dp(intel_connector->encoder);
|
||||
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
|
||||
|
||||
if (i915_modparams.enable_dpcd_backlight == 0 ||
|
||||
if (i915->params.enable_dpcd_backlight == 0 ||
|
||||
!intel_dp_aux_display_control_capable(intel_connector))
|
||||
return -ENODEV;
|
||||
|
||||
@@ -358,7 +358,7 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector)
|
||||
*/
|
||||
if (i915->vbt.backlight.type !=
|
||||
INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE &&
|
||||
i915_modparams.enable_dpcd_backlight != 1 &&
|
||||
i915->params.enable_dpcd_backlight != 1 &&
|
||||
!drm_dp_has_quirk(&intel_dp->desc, intel_dp->edid_quirks,
|
||||
DP_QUIRK_FORCE_DPCD_BACKLIGHT)) {
|
||||
drm_info(&i915->drm,
|
||||
|
||||
@@ -740,7 +740,7 @@ static bool intel_fbc_can_enable(struct drm_i915_private *dev_priv)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!i915_modparams.enable_fbc) {
|
||||
if (!dev_priv->params.enable_fbc) {
|
||||
fbc->no_fbc_reason = "disabled per module param or by default";
|
||||
return false;
|
||||
}
|
||||
@@ -1017,7 +1017,7 @@ static void __intel_fbc_post_update(struct intel_crtc *crtc)
|
||||
|
||||
fbc->flip_pending = false;
|
||||
|
||||
if (!i915_modparams.enable_fbc) {
|
||||
if (!dev_priv->params.enable_fbc) {
|
||||
intel_fbc_deactivate(dev_priv, "disabled at runtime per module param");
|
||||
__intel_fbc_disable(dev_priv);
|
||||
|
||||
@@ -1370,8 +1370,8 @@ void intel_fbc_handle_fifo_underrun_irq(struct drm_i915_private *dev_priv)
|
||||
*/
|
||||
static int intel_sanitize_fbc_option(struct drm_i915_private *dev_priv)
|
||||
{
|
||||
if (i915_modparams.enable_fbc >= 0)
|
||||
return !!i915_modparams.enable_fbc;
|
||||
if (dev_priv->params.enable_fbc >= 0)
|
||||
return !!dev_priv->params.enable_fbc;
|
||||
|
||||
if (!HAS_FBC(dev_priv))
|
||||
return 0;
|
||||
@@ -1415,9 +1415,9 @@ void intel_fbc_init(struct drm_i915_private *dev_priv)
|
||||
if (need_fbc_vtd_wa(dev_priv))
|
||||
mkwrite_device_info(dev_priv)->display.has_fbc = false;
|
||||
|
||||
i915_modparams.enable_fbc = intel_sanitize_fbc_option(dev_priv);
|
||||
dev_priv->params.enable_fbc = intel_sanitize_fbc_option(dev_priv);
|
||||
drm_dbg_kms(&dev_priv->drm, "Sanitized enable_fbc value: %d\n",
|
||||
i915_modparams.enable_fbc);
|
||||
dev_priv->params.enable_fbc);
|
||||
|
||||
if (!HAS_FBC(dev_priv)) {
|
||||
fbc->no_fbc_reason = "unsupported by this chipset";
|
||||
|
||||
@@ -784,8 +784,8 @@ static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder)
|
||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||
|
||||
/* use the module option value if specified */
|
||||
if (i915_modparams.lvds_channel_mode > 0)
|
||||
return i915_modparams.lvds_channel_mode == 2;
|
||||
if (dev_priv->params.lvds_channel_mode > 0)
|
||||
return dev_priv->params.lvds_channel_mode == 2;
|
||||
|
||||
/* single channel LVDS is limited to 112 MHz */
|
||||
if (lvds_encoder->attached_connector->panel.fixed_mode->clock > 112999)
|
||||
|
||||
@@ -801,7 +801,7 @@ static int intel_load_vbt_firmware(struct drm_i915_private *dev_priv)
|
||||
{
|
||||
struct intel_opregion *opregion = &dev_priv->opregion;
|
||||
const struct firmware *fw = NULL;
|
||||
const char *name = i915_modparams.vbt_firmware;
|
||||
const char *name = dev_priv->params.vbt_firmware;
|
||||
int ret;
|
||||
|
||||
if (!name || !*name)
|
||||
|
||||
@@ -521,10 +521,10 @@ static u32 intel_panel_compute_brightness(struct intel_connector *connector,
|
||||
|
||||
drm_WARN_ON(&dev_priv->drm, panel->backlight.max == 0);
|
||||
|
||||
if (i915_modparams.invert_brightness < 0)
|
||||
if (dev_priv->params.invert_brightness < 0)
|
||||
return val;
|
||||
|
||||
if (i915_modparams.invert_brightness > 0 ||
|
||||
if (dev_priv->params.invert_brightness > 0 ||
|
||||
dev_priv->quirks & QUIRK_INVERT_BRIGHTNESS) {
|
||||
return panel->backlight.max - val + panel->backlight.min;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ static bool psr_global_enabled(struct drm_i915_private *i915)
|
||||
{
|
||||
switch (i915->psr.debug & I915_PSR_DEBUG_MODE_MASK) {
|
||||
case I915_PSR_DEBUG_DEFAULT:
|
||||
return i915_modparams.enable_psr;
|
||||
return i915->params.enable_psr;
|
||||
case I915_PSR_DEBUG_DISABLE:
|
||||
return false;
|
||||
default:
|
||||
@@ -426,7 +426,7 @@ static u32 intel_psr1_get_tp_time(struct intel_dp *intel_dp)
|
||||
if (INTEL_GEN(dev_priv) >= 11)
|
||||
val |= EDP_PSR_TP4_TIME_0US;
|
||||
|
||||
if (i915_modparams.psr_safest_params) {
|
||||
if (dev_priv->params.psr_safest_params) {
|
||||
val |= EDP_PSR_TP1_TIME_2500us;
|
||||
val |= EDP_PSR_TP2_TP3_TIME_2500us;
|
||||
goto check_tp3_sel;
|
||||
@@ -507,7 +507,7 @@ static u32 intel_psr2_get_tp_time(struct intel_dp *intel_dp)
|
||||
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
|
||||
u32 val = 0;
|
||||
|
||||
if (i915_modparams.psr_safest_params)
|
||||
if (dev_priv->params.psr_safest_params)
|
||||
return EDP_PSR2_TP2_TIME_2500us;
|
||||
|
||||
if (dev_priv->vbt.psr.psr2_tp2_tp3_wakeup_time_us >= 0 &&
|
||||
@@ -1500,9 +1500,9 @@ void intel_psr_init(struct drm_i915_private *dev_priv)
|
||||
*/
|
||||
dev_priv->hsw_psr_mmio_adjust = _SRD_CTL_EDP - _HSW_EDP_PSR_BASE;
|
||||
|
||||
if (i915_modparams.enable_psr == -1)
|
||||
if (dev_priv->params.enable_psr == -1)
|
||||
if (INTEL_GEN(dev_priv) < 9 || !dev_priv->vbt.psr.enable)
|
||||
i915_modparams.enable_psr = 0;
|
||||
dev_priv->params.enable_psr = 0;
|
||||
|
||||
/* Set link_standby x link_off defaults */
|
||||
if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv))
|
||||
|
||||
Reference in New Issue
Block a user