Commit 700c3401 authored by Luca Coelho's avatar Luca Coelho Committed by Jani Nikula

drm/i915/display: tie DMC wakelock to DC5/6 state transitions

We only need DMC wakelocks when we allow DC5 and DC6 states.  Add the
calls to enable and disable DMC wakelock accordingly.
Reviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240412094148.808179-5-luciano.coelho@intel.comSigned-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 8a8dcb23
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "intel_dkl_phy.h" #include "intel_dkl_phy.h"
#include "intel_dkl_phy_regs.h" #include "intel_dkl_phy_regs.h"
#include "intel_dmc.h" #include "intel_dmc.h"
#include "intel_dmc_wl.h"
#include "intel_dp_aux_regs.h" #include "intel_dp_aux_regs.h"
#include "intel_dpio_phy.h" #include "intel_dpio_phy.h"
#include "intel_dpll.h" #include "intel_dpll.h"
...@@ -821,6 +822,8 @@ void gen9_enable_dc5(struct drm_i915_private *dev_priv) ...@@ -821,6 +822,8 @@ void gen9_enable_dc5(struct drm_i915_private *dev_priv)
intel_de_rmw(dev_priv, GEN8_CHICKEN_DCPR_1, intel_de_rmw(dev_priv, GEN8_CHICKEN_DCPR_1,
0, SKL_SELECT_ALTERNATE_DC_EXIT); 0, SKL_SELECT_ALTERNATE_DC_EXIT);
intel_dmc_wl_enable(dev_priv);
gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC5); gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC5);
} }
...@@ -850,6 +853,8 @@ void skl_enable_dc6(struct drm_i915_private *dev_priv) ...@@ -850,6 +853,8 @@ void skl_enable_dc6(struct drm_i915_private *dev_priv)
intel_de_rmw(dev_priv, GEN8_CHICKEN_DCPR_1, intel_de_rmw(dev_priv, GEN8_CHICKEN_DCPR_1,
0, SKL_SELECT_ALTERNATE_DC_EXIT); 0, SKL_SELECT_ALTERNATE_DC_EXIT);
intel_dmc_wl_enable(dev_priv);
gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC6); gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC6);
} }
...@@ -970,6 +975,8 @@ void gen9_disable_dc_states(struct drm_i915_private *dev_priv) ...@@ -970,6 +975,8 @@ void gen9_disable_dc_states(struct drm_i915_private *dev_priv)
if (!HAS_DISPLAY(dev_priv)) if (!HAS_DISPLAY(dev_priv))
return; return;
intel_dmc_wl_disable(dev_priv);
intel_cdclk_get_cdclk(dev_priv, &cdclk_config); intel_cdclk_get_cdclk(dev_priv, &cdclk_config);
/* Can't read out voltage_level so can't use intel_cdclk_changed() */ /* Can't read out voltage_level so can't use intel_cdclk_changed() */
drm_WARN_ON(&dev_priv->drm, drm_WARN_ON(&dev_priv->drm,
......
...@@ -552,6 +552,8 @@ void intel_dmc_disable_program(struct drm_i915_private *i915) ...@@ -552,6 +552,8 @@ void intel_dmc_disable_program(struct drm_i915_private *i915)
pipedmc_clock_gating_wa(i915, true); pipedmc_clock_gating_wa(i915, true);
disable_all_event_handlers(i915); disable_all_event_handlers(i915);
pipedmc_clock_gating_wa(i915, false); pipedmc_clock_gating_wa(i915, false);
intel_dmc_wl_disable(i915);
} }
void assert_dmc_loaded(struct drm_i915_private *i915) void assert_dmc_loaded(struct drm_i915_private *i915)
...@@ -1081,6 +1083,8 @@ void intel_dmc_suspend(struct drm_i915_private *i915) ...@@ -1081,6 +1083,8 @@ void intel_dmc_suspend(struct drm_i915_private *i915)
if (dmc) if (dmc)
flush_work(&dmc->work); flush_work(&dmc->work);
intel_dmc_wl_disable(i915);
/* Drop the reference held in case DMC isn't loaded. */ /* Drop the reference held in case DMC isn't loaded. */
if (!intel_dmc_has_payload(i915)) if (!intel_dmc_has_payload(i915))
intel_dmc_runtime_pm_put(i915); intel_dmc_runtime_pm_put(i915);
......
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