Patchwork [2/2] drm/i915: return actual brightness to .get_brightness callback

login
register
mail settings
Submitter Jani Nikula
Date March 12, 2013, 9:44 a.m.
Message ID <1363081456-3990-2-git-send-email-jani.nikula@intel.com>
Download mbox | patch
Permalink /patch/2254221/
State New, archived
Headers show

Comments

Jani Nikula - March 12, 2013, 9:44 a.m.
The backlight device .get_brightness callback is supposed to return the
actual brightness by querying the hardware, not the cached value. See
Documentation/ABI/stable/sysfs-class-backlight. The callback is there to
support the actual_brightness sysfs file.

With the backlight_level and backlight device brightness now in sync, one
can reliably get the cached value through the brightness sysfs file.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_panel.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch

diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index 725d726..ca2179d 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -415,8 +415,7 @@  static int intel_panel_update_status(struct backlight_device *bd)
 static int intel_panel_get_brightness(struct backlight_device *bd)
 {
 	struct drm_device *dev = bl_get_data(bd);
-	struct drm_i915_private *dev_priv = dev->dev_private;
-	return dev_priv->backlight_level;
+	return intel_panel_get_backlight(dev);
 }
 
 static const struct backlight_ops intel_panel_bl_ops = {