Commit 2d72f6c7 authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Daniel Vetter

drm/i915: Skip .get_backlight() when backlight isn't enabled

On VLV/CHV 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.
Currently we end up reading a bigus register due to passing
INVALID_PIPE to VLV_BLC_PWM_CTL().

Skip the entire .get_backlight() call if the backlight isn't enabled
according to backlight.enabled.

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

Cc: Jani Nikula <jani.nikula@intel.com>
Suggested-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 23ec0a88
...@@ -539,12 +539,15 @@ static u32 intel_panel_get_backlight(struct intel_connector *connector) ...@@ -539,12 +539,15 @@ static u32 intel_panel_get_backlight(struct intel_connector *connector)
{ {
struct drm_device *dev = connector->base.dev; struct drm_device *dev = connector->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
u32 val; struct intel_panel *panel = &connector->panel;
u32 val = 0;
mutex_lock(&dev_priv->backlight_lock); mutex_lock(&dev_priv->backlight_lock);
if (panel->backlight.enabled) {
val = dev_priv->display.get_backlight(connector); val = dev_priv->display.get_backlight(connector);
val = intel_panel_compute_brightness(connector, val); val = intel_panel_compute_brightness(connector, val);
}
mutex_unlock(&dev_priv->backlight_lock); mutex_unlock(&dev_priv->backlight_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment