Skip to contentSkip to conversation

drm/i915: Fix inconsistent backlight level during disabled

PATCH In review Takashi Iwai 4 participants 5 messages Nov 16, 2011 – Nov 20, 2011

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

PATCH 1/1 drm/i915: Fix inconsistent backlight level during disabled

When the brightness property is inquired while the backlight is disabled, the driver returns a wrong value (zero) because it probes the value after the backlight was turned off. This caused a black screen even after the backlight is enabled again. It should return the internal backlight_level instead, so that it won't be influenced by the backlight-enable state.

---
 drivers/gpu/drm/i915/intel_panel.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_panel.c +2 -1
index 499d4c0..21f60b7 100644
@@ -326,7 +326,8 @@ 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);
-	return intel_panel_get_backlight(dev);
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	return dev_priv->backlight_level;
 }
 
 static const struct backlight_ops intel_panel_bl_ops = {
Signature · 1 line
1.7.7
#1 lore raw
Quoted 18 lines
drivers/gpu/drm/i915/intel_panel.c +2 -1
index 499d4c0..21f60b7 100644
@@ -326,7 +326,8 @@ 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);
-    return intel_panel_get_backlight(dev);
+    struct drm_i915_private *dev_priv = dev->dev_private;
+    return dev_priv->backlight_level;
 }
 
 static const struct backlight_ops intel_panel_bl_ops = {
Signature · 1 line
1.7.7

I'll test this patch sometime this weekend.

Tested-by
#2 lore raw
Quoted 15 lines
Quoted 15 lines
drivers/gpu/drm/i915/intel_panel.c +2 -1
index 499d4c0..21f60b7 100644
@@ -326,7 +326,8 @@ 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);
-    return intel_panel_get_backlight(dev);
+    struct drm_i915_private *dev_priv = dev->dev_private;
+    return dev_priv->backlight_level;
 }
 
Quoted 5 lines
Quoted 3 lines
drivers/gpu/drm/i915/intel_panel.c +0 -0
 static const struct backlight_ops intel_panel_bl_ops = {
Signature · 1 line
1.7.7

I'll test this patch sometime this weekend.

This patch works for me.

#3 lore raw
In reply to Takashi Iwai
Quoted 5 lines · Takashi Iwai

When the brightness property is inquired while the backlight is disabled, the driver returns a wrong value (zero) because it probes the value after the backlight was turned off. This caused a black screen even after the backlight is enabled again. It should return the internal backlight_level instead, so that it won't be influenced by the backlight-enable state.

Yes, this looks correct by inspection to me. I'll stick it into drm-intel-fixes.

Signature · 1 line
[email protected]

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
In reply to Takashi Iwai
Quoted 22 lines · Takashi Iwai

When the brightness property is inquired while the backlight is disabled, the driver returns a wrong value (zero) because it probes the value after the backlight was turned off. This caused a black screen even after the backlight is enabled again. It should return the internal backlight_level instead, so that it won't be influenced by the backlight-enable state.

---
  drivers/gpu/drm/i915/intel_panel.c |    3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_panel.c +0 -0
index 499d4c0..21f60b7 100644

drivers/gpu/drm/i915/intel_panel.c static int intel_panel_update_status(struct backlight_device *bd) · line 333

Quoted 9 lines
drivers/gpu/drm/i915/intel_panel.c +2 -1
@@ -326,7 +326,8 @@ 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);
-	return intel_panel_get_backlight(dev);
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	return dev_priv->backlight_level;
  }
 
  static const struct backlight_ops intel_panel_bl_ops = {

Seems to be fixing a black-screen regression since 3.0 on EeePC devices as well...

Thanks, Woody