diff mbox

i915/kms/backlight-combo mode problem (was: Re: Linux 2.6.39-rc5)

Message ID s5hpqo4b1kz.wl%tiwai@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Takashi Iwai April 30, 2011, 8:11 a.m. UTC
At Fri, 29 Apr 2011 22:09:54 +0200,
Melchior FRANZ wrote:
> 
> * Takashi Iwai -- Friday 29 April 2011:
> [https://bugzilla.kernel.org/show_bug.cgi?id=31522]
> > Looking at bugzilla, the problem seems like the case lbpc=0.
> > What about the patch below instead?
> 
> > -			val *= lbpc;
> > +			if (lbpc)
> > +				val *= lbpc;
> 
> Yes, that works as well. (I had assumed that this was the problem,
> but wasn't sure if a zero was even a legitimate value, or rather
> a sign for a problem or wrong assumption elsewhere.)

Well, this was just my wild guess.  I remember vaguely that the value
zero could be interpreted as the max.  It might be depending on the
hardware.

So, the patch below may work better in your case.

Also, with the patch, does the backlight level can be adjusted
correctly to different values?  I wonder whether LBPC adjustment
really works or not on your machine.


Takashi

---
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index a06ff07..aaa1f9e 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -207,6 +207,8 @@  u32 intel_panel_get_backlight(struct drm_device *dev)
 
 			val &= ~1;
 			pci_read_config_byte(dev->pdev, PCI_LBPC, &lbpc);
+			if (!lbpc)
+				lbpc = 0xff; /* max value */
 			val *= lbpc;
 		}
 	}