[Intel-gfx] [PATCH 2/6] drm/i915: Catch INVALID_PIPE in vlv_get_backlight()
ville.syrjala at linux.intel.com
ville.syrjala at linux.intel.com
Fri Nov 7 10:16:00 CET 2014
From: Ville Syrjälä <ville.syrjala at 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.syrjala at 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
More information about the Intel-gfx
mailing list