@@ -4836,6 +4836,15 @@ static void gen8_enable_rps(struct drm_device *dev)
struct intel_engine_cs *ring;
uint32_t rc6_mask = 0;
int unused;
+ bool hw_rc6_enabled, sw_rc6_enabled;
+
+ /* Check if BIOS has enabled HW/SW RC6. Only then enable RC6 */
+ hw_rc6_enabled = I915_READ(GEN6_RC_CONTROL) &
+ (GEN6_RC_CTL_RC6_ENABLE | GEN6_RC_CTL_HW_ENABLE);
+ sw_rc6_enabled = !(I915_READ(GEN6_RC_CONTROL) & GEN6_RC_CTL_HW_ENABLE)
+ && (I915_READ(GEN6_RC_STATE) & 0x40000);
+ if (!(hw_rc6_enabled || sw_rc6_enabled))
+ i915.enable_rc6 = 0;
/* 1a: Software RC state - RC0 */
I915_WRITE(GEN6_RC_STATE, 0);
RC6 setup is shared between BIOS and Driver. BIOS sets up subset of RC6 configuration registers. If those are not setup Driver should not enable RC6. For implementing this, driver can check RC_CTRL0 and RC_CTRL1 values to know if BIOS has enabled HW/SW RC6. This will also enable user to control RC6 using BIOS settings alone. Change-Id: If89518708e133be6b3c7c6f90869fb66224b7b87 Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com> --- drivers/gpu/drm/i915/intel_pm.c | 9 +++++++++ 1 file changed, 9 insertions(+)