Commit 443646c7 authored by Patrik Jakobsson's avatar Patrik Jakobsson Committed by Imre Deak

drm/i915/gen9: Add boot parameter for disabling DC6

v2: Use _unsafe (Jani)
v3: Allow specifying specific DC-states instead of just DC6 (Imre)
Signed-off-by: default avatarPatrik Jakobsson <patrik.jakobsson@linux.intel.com>
Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1447682467-6237-3-git-send-email-patrik.jakobsson@linux.intel.com
parent 9f836f90
...@@ -2642,6 +2642,7 @@ struct i915_params { ...@@ -2642,6 +2642,7 @@ struct i915_params {
int panel_use_ssc; int panel_use_ssc;
int vbt_sdvo_panel_type; int vbt_sdvo_panel_type;
int enable_rc6; int enable_rc6;
int enable_dc;
int enable_fbc; int enable_fbc;
int enable_ppgtt; int enable_ppgtt;
int enable_execlists; int enable_execlists;
......
...@@ -32,6 +32,7 @@ struct i915_params i915 __read_mostly = { ...@@ -32,6 +32,7 @@ struct i915_params i915 __read_mostly = {
.panel_use_ssc = -1, .panel_use_ssc = -1,
.vbt_sdvo_panel_type = -1, .vbt_sdvo_panel_type = -1,
.enable_rc6 = -1, .enable_rc6 = -1,
.enable_dc = -1,
.enable_fbc = -1, .enable_fbc = -1,
.enable_execlists = -1, .enable_execlists = -1,
.enable_hangcheck = true, .enable_hangcheck = true,
...@@ -79,6 +80,11 @@ MODULE_PARM_DESC(enable_rc6, ...@@ -79,6 +80,11 @@ MODULE_PARM_DESC(enable_rc6,
"For example, 3 would enable rc6 and deep rc6, and 7 would enable everything. " "For example, 3 would enable rc6 and deep rc6, and 7 would enable everything. "
"default: -1 (use per-chip default)"); "default: -1 (use per-chip default)");
module_param_named_unsafe(enable_dc, i915.enable_dc, int, 0400);
MODULE_PARM_DESC(enable_dc,
"Enable power-saving display C-states. "
"(-1=auto [default]; 0=disable; 1=up to DC5; 2=up to DC6)");
module_param_named_unsafe(enable_fbc, i915.enable_fbc, int, 0600); module_param_named_unsafe(enable_fbc, i915.enable_fbc, int, 0600);
MODULE_PARM_DESC(enable_fbc, MODULE_PARM_DESC(enable_fbc,
"Enable frame buffer compression for power savings " "Enable frame buffer compression for power savings "
......
...@@ -417,6 +417,11 @@ static void gen9_set_dc_state(struct drm_i915_private *dev_priv, uint32_t state) ...@@ -417,6 +417,11 @@ static void gen9_set_dc_state(struct drm_i915_private *dev_priv, uint32_t state)
WARN_ON_ONCE(state & ~mask); WARN_ON_ONCE(state & ~mask);
if (i915.enable_dc == 0)
state = DC_STATE_DISABLE;
else if (i915.enable_dc == 1 && state > DC_STATE_EN_UPTO_DC5)
state = DC_STATE_EN_UPTO_DC5;
if (state & DC_STATE_EN_UPTO_DC5_DC6_MASK) if (state & DC_STATE_EN_UPTO_DC5_DC6_MASK)
gen9_set_dc_state_debugmask_memory_up(dev_priv); gen9_set_dc_state_debugmask_memory_up(dev_priv);
...@@ -525,7 +530,9 @@ static void assert_can_disable_dc6(struct drm_i915_private *dev_priv) ...@@ -525,7 +530,9 @@ static void assert_can_disable_dc6(struct drm_i915_private *dev_priv)
static void gen9_disable_dc5_dc6(struct drm_i915_private *dev_priv) static void gen9_disable_dc5_dc6(struct drm_i915_private *dev_priv)
{ {
assert_can_disable_dc5(dev_priv); assert_can_disable_dc5(dev_priv);
assert_can_disable_dc6(dev_priv);
if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 && i915.enable_dc != 1)
assert_can_disable_dc6(dev_priv);
gen9_set_dc_state(dev_priv, DC_STATE_DISABLE); gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
} }
...@@ -712,7 +719,7 @@ static void gen9_dc_off_power_well_enable(struct drm_i915_private *dev_priv, ...@@ -712,7 +719,7 @@ 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 (IS_SKYLAKE(dev_priv)) if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 && i915.enable_dc != 1)
skl_enable_dc6(dev_priv); skl_enable_dc6(dev_priv);
else else
gen9_enable_dc5(dev_priv); gen9_enable_dc5(dev_priv);
...@@ -724,7 +731,8 @@ static void gen9_dc_off_power_well_sync_hw(struct drm_i915_private *dev_priv, ...@@ -724,7 +731,8 @@ static void gen9_dc_off_power_well_sync_hw(struct drm_i915_private *dev_priv,
if (power_well->count > 0) { if (power_well->count > 0) {
gen9_set_dc_state(dev_priv, DC_STATE_DISABLE); gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
} else { } else {
if (IS_SKYLAKE(dev_priv)) if (IS_SKYLAKE(dev_priv) && i915.enable_dc != 0 &&
i915.enable_dc != 1)
gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC6); gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC6);
else else
gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC5); gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC5);
......
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