Commit c24760cf authored by Anusha Srivatsa's avatar Anusha Srivatsa Committed by Lucas De Marchi

drm/i915/dmc: s/intel_csr/intel_dmc

No functional change.

v2: Chchpatch fixes.

Cc: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: default avatarAnusha Srivatsa <anusha.srivatsa@intel.com>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210518213444.11420-2-anusha.srivatsa@intel.com
parent ec279384
This diff is collapsed.
...@@ -532,24 +532,24 @@ static int i915_dmc_info(struct seq_file *m, void *unused) ...@@ -532,24 +532,24 @@ static int i915_dmc_info(struct seq_file *m, void *unused)
{ {
struct drm_i915_private *dev_priv = node_to_i915(m->private); struct drm_i915_private *dev_priv = node_to_i915(m->private);
intel_wakeref_t wakeref; intel_wakeref_t wakeref;
struct intel_csr *csr; struct intel_dmc *dmc;
i915_reg_t dc5_reg, dc6_reg = {}; i915_reg_t dc5_reg, dc6_reg = {};
if (!HAS_CSR(dev_priv)) if (!HAS_CSR(dev_priv))
return -ENODEV; return -ENODEV;
csr = &dev_priv->csr; dmc = &dev_priv->dmc;
wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm); wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
seq_printf(m, "fw loaded: %s\n", yesno(csr->dmc_payload != NULL)); seq_printf(m, "fw loaded: %s\n", yesno(dmc->dmc_payload));
seq_printf(m, "path: %s\n", csr->fw_path); seq_printf(m, "path: %s\n", dmc->fw_path);
if (!csr->dmc_payload) if (!dmc->dmc_payload)
goto out; goto out;
seq_printf(m, "version: %d.%d\n", CSR_VERSION_MAJOR(csr->version), seq_printf(m, "version: %d.%d\n", CSR_VERSION_MAJOR(dmc->version),
CSR_VERSION_MINOR(csr->version)); CSR_VERSION_MINOR(dmc->version));
if (DISPLAY_VER(dev_priv) >= 12) { if (DISPLAY_VER(dev_priv) >= 12) {
if (IS_DGFX(dev_priv)) { if (IS_DGFX(dev_priv)) {
......
...@@ -829,8 +829,8 @@ static void gen9_sanitize_dc_state(struct drm_i915_private *dev_priv) ...@@ -829,8 +829,8 @@ static void gen9_sanitize_dc_state(struct drm_i915_private *dev_priv)
drm_dbg_kms(&dev_priv->drm, drm_dbg_kms(&dev_priv->drm,
"Resetting DC state tracking from %02x to %02x\n", "Resetting DC state tracking from %02x to %02x\n",
dev_priv->csr.dc_state, val); dev_priv->dmc.dc_state, val);
dev_priv->csr.dc_state = val; dev_priv->dmc.dc_state = val;
} }
/** /**
...@@ -865,8 +865,8 @@ static void gen9_set_dc_state(struct drm_i915_private *dev_priv, u32 state) ...@@ -865,8 +865,8 @@ static void gen9_set_dc_state(struct drm_i915_private *dev_priv, u32 state)
return; return;
if (drm_WARN_ON_ONCE(&dev_priv->drm, if (drm_WARN_ON_ONCE(&dev_priv->drm,
state & ~dev_priv->csr.allowed_dc_mask)) state & ~dev_priv->dmc.allowed_dc_mask))
state &= dev_priv->csr.allowed_dc_mask; state &= dev_priv->dmc.allowed_dc_mask;
val = intel_de_read(dev_priv, DC_STATE_EN); val = intel_de_read(dev_priv, DC_STATE_EN);
mask = gen9_dc_mask(dev_priv); mask = gen9_dc_mask(dev_priv);
...@@ -874,16 +874,16 @@ static void gen9_set_dc_state(struct drm_i915_private *dev_priv, u32 state) ...@@ -874,16 +874,16 @@ static void gen9_set_dc_state(struct drm_i915_private *dev_priv, u32 state)
val & mask, state); val & mask, state);
/* Check if DMC is ignoring our DC state requests */ /* Check if DMC is ignoring our DC state requests */
if ((val & mask) != dev_priv->csr.dc_state) if ((val & mask) != dev_priv->dmc.dc_state)
drm_err(&dev_priv->drm, "DC state mismatch (0x%x -> 0x%x)\n", drm_err(&dev_priv->drm, "DC state mismatch (0x%x -> 0x%x)\n",
dev_priv->csr.dc_state, val & mask); dev_priv->dmc.dc_state, val & mask);
val &= ~mask; val &= ~mask;
val |= state; val |= state;
gen9_write_dc_state(dev_priv, val); gen9_write_dc_state(dev_priv, val);
dev_priv->csr.dc_state = val & mask; dev_priv->dmc.dc_state = val & mask;
} }
static u32 static u32
...@@ -902,7 +902,7 @@ sanitize_target_dc_state(struct drm_i915_private *dev_priv, ...@@ -902,7 +902,7 @@ sanitize_target_dc_state(struct drm_i915_private *dev_priv,
if (target_dc_state != states[i]) if (target_dc_state != states[i])
continue; continue;
if (dev_priv->csr.allowed_dc_mask & target_dc_state) if (dev_priv->dmc.allowed_dc_mask & target_dc_state)
break; break;
target_dc_state = states[i + 1]; target_dc_state = states[i + 1];
...@@ -1016,7 +1016,7 @@ void intel_display_power_set_target_dc_state(struct drm_i915_private *dev_priv, ...@@ -1016,7 +1016,7 @@ void intel_display_power_set_target_dc_state(struct drm_i915_private *dev_priv,
state = sanitize_target_dc_state(dev_priv, state); state = sanitize_target_dc_state(dev_priv, state);
if (state == dev_priv->csr.target_dc_state) if (state == dev_priv->dmc.target_dc_state)
goto unlock; goto unlock;
dc_off_enabled = power_well->desc->ops->is_enabled(dev_priv, dc_off_enabled = power_well->desc->ops->is_enabled(dev_priv,
...@@ -1028,7 +1028,7 @@ void intel_display_power_set_target_dc_state(struct drm_i915_private *dev_priv, ...@@ -1028,7 +1028,7 @@ void intel_display_power_set_target_dc_state(struct drm_i915_private *dev_priv,
if (!dc_off_enabled) if (!dc_off_enabled)
power_well->desc->ops->enable(dev_priv, power_well); power_well->desc->ops->enable(dev_priv, power_well);
dev_priv->csr.target_dc_state = state; dev_priv->dmc.target_dc_state = state;
if (!dc_off_enabled) if (!dc_off_enabled)
power_well->desc->ops->disable(dev_priv, power_well); power_well->desc->ops->disable(dev_priv, power_well);
...@@ -1181,7 +1181,7 @@ static void gen9_disable_dc_states(struct drm_i915_private *dev_priv) ...@@ -1181,7 +1181,7 @@ static void gen9_disable_dc_states(struct drm_i915_private *dev_priv)
{ {
struct intel_cdclk_config cdclk_config = {}; struct intel_cdclk_config cdclk_config = {};
if (dev_priv->csr.target_dc_state == DC_STATE_EN_DC3CO) { if (dev_priv->dmc.target_dc_state == DC_STATE_EN_DC3CO) {
tgl_disable_dc3co(dev_priv); tgl_disable_dc3co(dev_priv);
return; return;
} }
...@@ -1220,10 +1220,10 @@ static void gen9_dc_off_power_well_enable(struct drm_i915_private *dev_priv, ...@@ -1220,10 +1220,10 @@ static void gen9_dc_off_power_well_enable(struct drm_i915_private *dev_priv,
static void gen9_dc_off_power_well_disable(struct drm_i915_private *dev_priv, static void gen9_dc_off_power_well_disable(struct drm_i915_private *dev_priv,
struct i915_power_well *power_well) struct i915_power_well *power_well)
{ {
if (!dev_priv->csr.dmc_payload) if (!dev_priv->dmc.dmc_payload)
return; return;
switch (dev_priv->csr.target_dc_state) { switch (dev_priv->dmc.target_dc_state) {
case DC_STATE_EN_DC3CO: case DC_STATE_EN_DC3CO:
tgl_enable_dc3co(dev_priv); tgl_enable_dc3co(dev_priv);
break; break;
...@@ -5090,10 +5090,10 @@ int intel_power_domains_init(struct drm_i915_private *dev_priv) ...@@ -5090,10 +5090,10 @@ int intel_power_domains_init(struct drm_i915_private *dev_priv)
dev_priv->params.disable_power_well = dev_priv->params.disable_power_well =
sanitize_disable_power_well_option(dev_priv, sanitize_disable_power_well_option(dev_priv,
dev_priv->params.disable_power_well); dev_priv->params.disable_power_well);
dev_priv->csr.allowed_dc_mask = dev_priv->dmc.allowed_dc_mask =
get_allowed_dc_mask(dev_priv, dev_priv->params.enable_dc); get_allowed_dc_mask(dev_priv, dev_priv->params.enable_dc);
dev_priv->csr.target_dc_state = dev_priv->dmc.target_dc_state =
sanitize_target_dc_state(dev_priv, DC_STATE_EN_UPTO_DC6); sanitize_target_dc_state(dev_priv, DC_STATE_EN_UPTO_DC6);
BUILD_BUG_ON(POWER_DOMAIN_NUM > 64); BUILD_BUG_ON(POWER_DOMAIN_NUM > 64);
...@@ -5573,7 +5573,7 @@ static void skl_display_core_init(struct drm_i915_private *dev_priv, ...@@ -5573,7 +5573,7 @@ static void skl_display_core_init(struct drm_i915_private *dev_priv,
gen9_dbuf_enable(dev_priv); gen9_dbuf_enable(dev_priv);
if (resume && dev_priv->csr.dmc_payload) if (resume && dev_priv->dmc.dmc_payload)
intel_csr_load_program(dev_priv); intel_csr_load_program(dev_priv);
} }
...@@ -5640,7 +5640,7 @@ static void bxt_display_core_init(struct drm_i915_private *dev_priv, bool resume ...@@ -5640,7 +5640,7 @@ static void bxt_display_core_init(struct drm_i915_private *dev_priv, bool resume
gen9_dbuf_enable(dev_priv); gen9_dbuf_enable(dev_priv);
if (resume && dev_priv->csr.dmc_payload) if (resume && dev_priv->dmc.dmc_payload)
intel_csr_load_program(dev_priv); intel_csr_load_program(dev_priv);
} }
...@@ -5706,7 +5706,7 @@ static void cnl_display_core_init(struct drm_i915_private *dev_priv, bool resume ...@@ -5706,7 +5706,7 @@ static void cnl_display_core_init(struct drm_i915_private *dev_priv, bool resume
/* 6. Enable DBUF */ /* 6. Enable DBUF */
gen9_dbuf_enable(dev_priv); gen9_dbuf_enable(dev_priv);
if (resume && dev_priv->csr.dmc_payload) if (resume && dev_priv->dmc.dmc_payload)
intel_csr_load_program(dev_priv); intel_csr_load_program(dev_priv);
} }
...@@ -5863,7 +5863,7 @@ static void icl_display_core_init(struct drm_i915_private *dev_priv, ...@@ -5863,7 +5863,7 @@ static void icl_display_core_init(struct drm_i915_private *dev_priv,
if (DISPLAY_VER(dev_priv) >= 12) if (DISPLAY_VER(dev_priv) >= 12)
tgl_bw_buddy_init(dev_priv); tgl_bw_buddy_init(dev_priv);
if (resume && dev_priv->csr.dmc_payload) if (resume && dev_priv->dmc.dmc_payload)
intel_csr_load_program(dev_priv); intel_csr_load_program(dev_priv);
/* Wa_14011508470 */ /* Wa_14011508470 */
...@@ -6222,9 +6222,9 @@ void intel_power_domains_suspend(struct drm_i915_private *i915, ...@@ -6222,9 +6222,9 @@ void intel_power_domains_suspend(struct drm_i915_private *i915,
* resources as required and also enable deeper system power states * resources as required and also enable deeper system power states
* that would be blocked if the firmware was inactive. * that would be blocked if the firmware was inactive.
*/ */
if (!(i915->csr.allowed_dc_mask & DC_STATE_EN_DC9) && if (!(i915->dmc.allowed_dc_mask & DC_STATE_EN_DC9) &&
suspend_mode == I915_DRM_SUSPEND_IDLE && suspend_mode == I915_DRM_SUSPEND_IDLE &&
i915->csr.dmc_payload) { i915->dmc.dmc_payload) {
intel_display_power_flush_work(i915); intel_display_power_flush_work(i915);
intel_power_domains_verify_state(i915); intel_power_domains_verify_state(i915);
return; return;
...@@ -6414,19 +6414,19 @@ void intel_display_power_resume(struct drm_i915_private *i915) ...@@ -6414,19 +6414,19 @@ void intel_display_power_resume(struct drm_i915_private *i915)
if (DISPLAY_VER(i915) >= 11) { if (DISPLAY_VER(i915) >= 11) {
bxt_disable_dc9(i915); bxt_disable_dc9(i915);
icl_display_core_init(i915, true); icl_display_core_init(i915, true);
if (i915->csr.dmc_payload) { if (i915->dmc.dmc_payload) {
if (i915->csr.allowed_dc_mask & if (i915->dmc.allowed_dc_mask &
DC_STATE_EN_UPTO_DC6) DC_STATE_EN_UPTO_DC6)
skl_enable_dc6(i915); skl_enable_dc6(i915);
else if (i915->csr.allowed_dc_mask & else if (i915->dmc.allowed_dc_mask &
DC_STATE_EN_UPTO_DC5) DC_STATE_EN_UPTO_DC5)
gen9_enable_dc5(i915); gen9_enable_dc5(i915);
} }
} else if (IS_GEMINILAKE(i915) || IS_BROXTON(i915)) { } else if (IS_GEMINILAKE(i915) || IS_BROXTON(i915)) {
bxt_disable_dc9(i915); bxt_disable_dc9(i915);
bxt_display_core_init(i915, true); bxt_display_core_init(i915, true);
if (i915->csr.dmc_payload && if (i915->dmc.dmc_payload &&
(i915->csr.allowed_dc_mask & DC_STATE_EN_UPTO_DC5)) (i915->dmc.allowed_dc_mask & DC_STATE_EN_UPTO_DC5))
gen9_enable_dc5(i915); gen9_enable_dc5(i915);
} else if (IS_HASWELL(i915) || IS_BROADWELL(i915)) { } else if (IS_HASWELL(i915) || IS_BROADWELL(i915)) {
hsw_disable_pc8(i915); hsw_disable_pc8(i915);
......
...@@ -669,7 +669,7 @@ tgl_dc3co_exitline_compute_config(struct intel_dp *intel_dp, ...@@ -669,7 +669,7 @@ tgl_dc3co_exitline_compute_config(struct intel_dp *intel_dp,
if (crtc_state->enable_psr2_sel_fetch) if (crtc_state->enable_psr2_sel_fetch)
return; return;
if (!(dev_priv->csr.allowed_dc_mask & DC_STATE_EN_DC3CO)) if (!(dev_priv->dmc.allowed_dc_mask & DC_STATE_EN_DC3CO))
return; return;
/* B.Specs:49196 DC3CO only works with pipeA and DDIA.*/ /* B.Specs:49196 DC3CO only works with pipeA and DDIA.*/
......
...@@ -328,7 +328,7 @@ struct drm_i915_display_funcs { ...@@ -328,7 +328,7 @@ struct drm_i915_display_funcs {
void (*read_luts)(struct intel_crtc_state *crtc_state); void (*read_luts)(struct intel_crtc_state *crtc_state);
}; };
struct intel_csr { struct intel_dmc {
struct work_struct work; struct work_struct work;
const char *fw_path; const char *fw_path;
u32 required_version; u32 required_version;
...@@ -817,7 +817,7 @@ struct drm_i915_private { ...@@ -817,7 +817,7 @@ struct drm_i915_private {
struct intel_wopcm wopcm; struct intel_wopcm wopcm;
struct intel_csr csr; struct intel_dmc dmc;
struct intel_gmbus gmbus[GMBUS_NUM_PINS]; struct intel_gmbus gmbus[GMBUS_NUM_PINS];
......
...@@ -789,13 +789,13 @@ static void __err_print_to_sgl(struct drm_i915_error_state_buf *m, ...@@ -789,13 +789,13 @@ static void __err_print_to_sgl(struct drm_i915_error_state_buf *m,
err_printf(m, "IOMMU enabled?: %d\n", error->iommu); err_printf(m, "IOMMU enabled?: %d\n", error->iommu);
if (HAS_CSR(m->i915)) { if (HAS_CSR(m->i915)) {
struct intel_csr *csr = &m->i915->csr; struct intel_dmc *dmc = &m->i915->dmc;
err_printf(m, "DMC loaded: %s\n", err_printf(m, "DMC loaded: %s\n",
yesno(csr->dmc_payload != NULL)); yesno(dmc->dmc_payload));
err_printf(m, "DMC fw version: %d.%d\n", err_printf(m, "DMC fw version: %d.%d\n",
CSR_VERSION_MAJOR(csr->version), CSR_VERSION_MAJOR(dmc->version),
CSR_VERSION_MINOR(csr->version)); CSR_VERSION_MINOR(dmc->version));
} }
err_printf(m, "RPM wakelock: %s\n", yesno(error->wakelock)); err_printf(m, "RPM wakelock: %s\n", yesno(error->wakelock));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment