Bug 34524 - Display brightness become dim after change resolution from high to low and back to high
Display brightness become dim after change resolution from high to low and ba...
Status: RESOLVED FIXED
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i915
unspecified
x86 (IA32) Linux (All)
: medium normal
Assigned To: Jesse Barnes
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-21 02:08 UTC by Michael Chang
Modified: 2011-02-23 00:38 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Chang 2011-02-21 02:08:22 UTC
Distro: SLED11 SP1
Kernel: 2.6.38-rc5
Platform: Intel Montevina with GM45 Integrated Graphics
Rate: 100%

A resolution change will induce unexpected brightness change, especially when you change from high to low then back to high.

For better understanding, the script used to reproduce it is provided.

  #!/bin/bash

  CNT=10
  while (( CNT-- > 0 )); do
  xrandr --output LVDS1 --mode 800x600
  xrandr --output LVDS1 --mode 1366x768
  done

You will end with a dimmest brightness level in 1366x768. Also each iteration would dim brightness level by 1.
Comment 1 Wang Zhenyu 2011-02-21 23:17:02 UTC
Could you test with upstream linux-2.6 git with below commit?
 
commit 951f3512dba5bd44cda3e5ee22b4b522e4bb09fb
Author: Indan Zupancic <indan@nul.nu>
Date:   Thu Feb 17 02:41:49 2011 +0100

    drm/i915: Do not handle backlight combination mode specially
Comment 2 Indan Zupancic 2011-02-21 23:48:40 UTC
(In reply to comment #1)
> Could you test with upstream linux-2.6 git with below commit?
> 
> commit 951f3512dba5bd44cda3e5ee22b4b522e4bb09fb
> Author: Indan Zupancic <indan@nul.nu>
> Date:   Thu Feb 17 02:41:49 2011 +0100
> 
>     drm/i915: Do not handle backlight combination mode specially

That patch made it upstream, it's in rc6 now.
Comment 3 Michael Chang 2011-02-22 00:33:44 UTC
This morning I tested a patch from Takashi that fixed the issue.

-----------

From f6b8a45b9544072e6ddbb944a4c03a9ec8cbca3a Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Mon, 21 Feb 2011 14:19:27 +0100
Subject: [PATCH] drm/i915: Fix calculation of backlight value in combined mode

The commit a95735569312f2ab0c80425e2cd1e5cb0b4e1870
    drm/i915: Refactor panel backlight controls
causes a regression for GM45 that is using the combined mode for
controlling the backlight brightness.  The commit introduced a wrong
bit shift for computing the current backlight level.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=672946
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34524

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
---
 drivers/gpu/drm/i915/intel_panel.c |    1 -
 1 file changed, 1 deletion(-)

--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -176,7 +176,6 @@
 			val &= ~1;
 			pci_read_config_byte(dev->pdev, PCI_LBPC, &lbpc);
 			val *= lbpc;
-			val >>= 1;
 		}
 	}

-----------

Therefore, a quick glance of the upstream patch should work, because we know it is wrong backlight calculation in combination mode made the trouble.

I will try this patch and update it later. Many thanks for every kernel experts' help. :)
Comment 4 Michael Chang 2011-02-23 00:38:50 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Could you test with upstream linux-2.6 git with below commit?
> > 
> > commit 951f3512dba5bd44cda3e5ee22b4b522e4bb09fb
> > Author: Indan Zupancic <indan@nul.nu>
> > Date:   Thu Feb 17 02:41:49 2011 +0100
> > 
> >     drm/i915: Do not handle backlight combination mode specially
> 
> That patch made it upstream, it's in rc6 now.

Verified fixed in 2.6.38-rc6. Thanks.