Re: i915/kms/backlight-combo mode problem

From: Keith Packard
Date: Sat Jan 21 2012 - 17:31:32 EST


On Sat, 21 Jan 2012 21:25:56 +0000, Chris Diamand <chris.diamand@xxxxxxxxx> wrote:

> 0x00 is the brightest. It gets very gradually dimmer up to about 0xB0,
> when the gaps between
> brightness levels are slightly bigger.
> 0xFE is very low but still works.
> Barely any difference between 0x80 and 0x7f, same with 0x00 and 0x01,
> etc.

Here's a patch which just flips the interpretation of that value over;
does this work?

diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index 04d79fd..43faa9d 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -207,6 +207,7 @@ u32 intel_panel_get_backlight(struct drm_device *dev)
u8 lbpc;

pci_read_config_byte(dev->pdev, PCI_LBPC, &lbpc);
+ lbpc = 0xff - lbpc;
val *= lbpc;
}
}
@@ -238,7 +239,7 @@ static void intel_panel_actually_set_backlight(struct drm_device *dev, u32 level

lbpc = level * 0xfe / max + 1;
level /= lbpc;
- pci_write_config_byte(dev->pdev, PCI_LBPC, lbpc);
+ pci_write_config_byte(dev->pdev, PCI_LBPC, 0xff - lbpc);
}

tmp = I915_READ(BLC_PWM_CTL);


--
keith.packard@xxxxxxxxx

Attachment: pgp00000.pgp
Description: PGP signature