From: Ville Syrjälä <ville.syrj...@linux.intel.com>

When the display is off, we can't read out the current backlight level
from the hardware since we have no pipe to do so. Catch the INVALID_PIPE
in vlv_get_backlight() rather than pass it to VLV_BLC_PWM_CTL() which
would obviously end accessing some bogus register.

This problem can be reproduced simply by reading the backlight device
actual_brightness file while the display is off.

Signed-off-by: Ville Syrjälä <ville.syrj...@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_panel.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_panel.c 
b/drivers/gpu/drm/i915/intel_panel.c
index ef646b1..847d00f9 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -532,6 +532,9 @@ static u32 vlv_get_backlight(struct intel_connector 
*connector)
        struct drm_device *dev = connector->base.dev;
        enum pipe pipe = intel_get_pipe_from_connector(connector);
 
+       if (pipe == INVALID_PIPE)
+               return 0;
+
        return _vlv_get_backlight(dev, pipe);
 }
 
-- 
2.0.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to