aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_runtime_pm.c
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2018-11-09 09:58:20 -0500
committerImre Deak <imre.deak@intel.com>2018-11-14 06:45:15 -0500
commitcb8ef723ab812bf61553d88542b3a37f2ca75b48 (patch)
treee60f5f2d8041f46f575da66b60eec8c265fdb450 /drivers/gpu/drm/i915/intel_runtime_pm.c
parent745aa6cdee6be0dfc8196f8b848325246981d881 (diff)
drm/i915/gen9_bc: Work around DMC bug zeroing power well requests
A DMC bug on GEN9 big core machines fails to restore the driver's request bits for the PW1 and MISC_IO power wells after a DC5/6 entry->exit sequence. As a consequence the driver's subsequent check for the enabled status of these power wells will fail, as the check considers the power wells being enabled only if both the status and request bits are set. To work around this borrow the request bits from BIOS's own request register in which DMC forces on the request bits when exiting from DC5/6. This fixes a problem reported by Ramalingam, where HDCP init failed, since PW1 reported itself as being disabled, while in reality it was enabled. Reported-by: Ramalingam C <ramalingam.c@intel.com> Cc: Ramalingam C <ramalingam.c@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181109145822.15446-1-imre.deak@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_runtime_pm.c')
-rw-r--r--drivers/gpu/drm/i915/intel_runtime_pm.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index 770de2632530..3894e4a63415 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -493,11 +493,25 @@ static bool hsw_power_well_enabled(struct drm_i915_private *dev_priv,
493 struct i915_power_well *power_well) 493 struct i915_power_well *power_well)
494{ 494{
495 const struct i915_power_well_regs *regs = power_well->desc->hsw.regs; 495 const struct i915_power_well_regs *regs = power_well->desc->hsw.regs;
496 enum i915_power_well_id id = power_well->desc->id;
496 int pw_idx = power_well->desc->hsw.idx; 497 int pw_idx = power_well->desc->hsw.idx;
497 u32 mask = HSW_PWR_WELL_CTL_REQ(pw_idx) | 498 u32 mask = HSW_PWR_WELL_CTL_REQ(pw_idx) |
498 HSW_PWR_WELL_CTL_STATE(pw_idx); 499 HSW_PWR_WELL_CTL_STATE(pw_idx);
500 u32 val;
501
502 val = I915_READ(regs->driver);
503
504 /*
505 * On GEN9 big core due to a DMC bug the driver's request bits for PW1
506 * and the MISC_IO PW will be not restored, so check instead for the
507 * BIOS's own request bits, which are forced-on for these power wells
508 * when exiting DC5/6.
509 */
510 if (IS_GEN9(dev_priv) && !IS_GEN9_LP(dev_priv) &&
511 (id == SKL_DISP_PW_1 || id == SKL_DISP_PW_MISC_IO))
512 val |= I915_READ(regs->bios);
499 513
500 return (I915_READ(regs->driver) & mask) == mask; 514 return (val & mask) == mask;
501} 515}
502 516
503static void assert_can_enable_dc9(struct drm_i915_private *dev_priv) 517static void assert_can_enable_dc9(struct drm_i915_private *dev_priv)