Skip to contentSkip to conversation

drm/i915: disable CPU PWM also on LPT/SPT backlight disable

PATCH RESEND In review Jani Nikula 2 participants 3 messages Oct 28, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 drm/i915: disable CPU PWM also on LPT/SPT backlight disable

Although we don't support or enable CPU PWM with LPT/SPT based systems, it may have been enabled prior to loading the driver. Disable the CPU PWM on LPT/SPT backlight disable to avoid warnings on LCPLL disable.

The issue has been present on BDW since BDW enabling, but was recently introduced on HSW with

commit 437b15b8017e0d946453c10794b0c5d4591cf180

Author: Jani Nikula <[email protected]>
Date:   Fri Sep 4 16:55:13 2015 +0300

drm/i915: use pch backlight override on hsw too

Cc: Paulo Zanoni <[email protected]>
Cc: Ville Syrjälä <[email protected]>
Reference: http://mid.gmane.org/[email protected]

---
 drivers/gpu/drm/i915/intel_panel.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_panel.c +14 -0
index b05c6d9b3be7..a24df35e11e7 100644
@@ -732,6 +732,20 @@ static void lpt_disable_backlight(struct intel_connector *connector)
 
 	intel_panel_actually_set_backlight(connector, 0);
 
+	/*
+	 * Although we don't support or enable CPU PWM with LPT/SPT based
+	 * systems, it may have been enabled prior to loading the
+	 * driver. Disable to avoid warnings on LCPLL disable.
+	 *
+	 * This needs rework if we need to add support for CPU PWM on PCH split
+	 * platforms.
+	 */
+	tmp = I915_READ(BLC_PWM_CPU_CTL2);
+	if (tmp & BLM_PWM_ENABLE) {
+		DRM_DEBUG_KMS("cpu backlight was enabled, disabling\n");
+		I915_WRITE(BLC_PWM_CPU_CTL2, tmp & ~BLM_PWM_ENABLE);
+	}
+
 	tmp = I915_READ(BLC_PWM_PCH_CTL1);
 	I915_WRITE(BLC_PWM_PCH_CTL1, tmp & ~BLM_PCH_PWM_ENABLE);
 }
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by on v1 1/1
#1 lore raw
Quoted 11 lines · Jani Nikula

Although we don't support or enable CPU PWM with LPT/SPT based systems, it may have been enabled prior to loading the driver. Disable the CPU PWM on LPT/SPT backlight disable to avoid warnings on LCPLL disable.

The issue has been present on BDW since BDW enabling, but was recently introduced on HSW with

commit 437b15b8017e0d946453c10794b0c5d4591cf180

Author: Jani Nikula <[email protected]>
Date:   Fri Sep 4 16:55:13 2015 +0300
Quoted 7 lines

drm/i915: use pch backlight override on hsw too

Cc: Paulo Zanoni <[email protected]>
Cc: Ville Syrjälä <[email protected]>
Reference: http://mid.gmane.org/[email protected]

Not seeing the warning anymore during ./scripts/run-tests.sh -t basic -x reload -x suspend on my HSW-ULT

Quoted 31 lines
---
 drivers/gpu/drm/i915/intel_panel.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_panel.c +14 -0
index b05c6d9b3be7..a24df35e11e7 100644
@@ -732,6 +732,20 @@ static void lpt_disable_backlight(struct intel_connector *connector)
 
 	intel_panel_actually_set_backlight(connector, 0);
 
+	/*
+	 * Although we don't support or enable CPU PWM with LPT/SPT based
+	 * systems, it may have been enabled prior to loading the
+	 * driver. Disable to avoid warnings on LCPLL disable.
+	 *
+	 * This needs rework if we need to add support for CPU PWM on PCH split
+	 * platforms.
+	 */
+	tmp = I915_READ(BLC_PWM_CPU_CTL2);
+	if (tmp & BLM_PWM_ENABLE) {
+		DRM_DEBUG_KMS("cpu backlight was enabled, disabling\n");
+		I915_WRITE(BLC_PWM_CPU_CTL2, tmp & ~BLM_PWM_ENABLE);
+	}
+
 	tmp = I915_READ(BLC_PWM_PCH_CTL1);
 	I915_WRITE(BLC_PWM_PCH_CTL1, tmp & ~BLM_PCH_PWM_ENABLE);
 }
Signature · 1 line
2.1.4
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 20 lines · Ville Syrjälä
Quoted 11 lines · Jani Nikula

Although we don't support or enable CPU PWM with LPT/SPT based systems, it may have been enabled prior to loading the driver. Disable the CPU PWM on LPT/SPT backlight disable to avoid warnings on LCPLL disable.

The issue has been present on BDW since BDW enabling, but was recently introduced on HSW with

commit 437b15b8017e0d946453c10794b0c5d4591cf180

Author: Jani Nikula <[email protected]>
Date:   Fri Sep 4 16:55:13 2015 +0300
Quoted 7 lines

drm/i915: use pch backlight override on hsw too

Cc: Paulo Zanoni <[email protected]>
Cc: Ville Syrjälä <[email protected]>
Reference: http://mid.gmane.org/[email protected]

Quoted 5 lines

Not seeing the warning anymore during ./scripts/run-tests.sh -t basic -x reload -x suspend on my HSW-ULT

Thanks, pushed to drm-intel-next-fixes.

BR,
Jani.

Quoted 36 lines
Quoted 32 lines
---
 drivers/gpu/drm/i915/intel_panel.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_panel.c +14 -0
index b05c6d9b3be7..a24df35e11e7 100644
@@ -732,6 +732,20 @@ static void lpt_disable_backlight(struct intel_connector *connector)
 
 	intel_panel_actually_set_backlight(connector, 0);
 
+	/*
+	 * Although we don't support or enable CPU PWM with LPT/SPT based
+	 * systems, it may have been enabled prior to loading the
+	 * driver. Disable to avoid warnings on LCPLL disable.
+	 *
+	 * This needs rework if we need to add support for CPU PWM on PCH split
+	 * platforms.
+	 */
+	tmp = I915_READ(BLC_PWM_CPU_CTL2);
+	if (tmp & BLM_PWM_ENABLE) {
+		DRM_DEBUG_KMS("cpu backlight was enabled, disabling\n");
+		I915_WRITE(BLC_PWM_CPU_CTL2, tmp & ~BLM_PWM_ENABLE);
+	}
+
 	tmp = I915_READ(BLC_PWM_PCH_CTL1);
 	I915_WRITE(BLC_PWM_PCH_CTL1, tmp & ~BLM_PCH_PWM_ENABLE);
 }
Signature · 1 line
2.1.4
Signature · 2 lines
Ville Syrjälä
Intel OTC
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx