2011-05-10 03:29:07

by Michael Chang

[permalink] [raw]
Subject: Re: i915/kms/backlight-combo mode problem

Melchior,

Could you please try this patch and get the log ? We wonder why
is_backlight_combination_mode () returns false. We all knew that it
returns true during booting (and takashi's fix works to fix the
blackscreen for you) and it's unlikely to become false afterward.
Perhaps it was changed wrongly ..

I speculate that if it returns true matters because it would touch the
LPBC register and your problem might get fixed.

Thanks in advance. :)

diff --git a/drivers/gpu/drm/i915/intel_panel.c
b/drivers/gpu/drm/i915/intel_panel.c
index a06ff07..8f14bfa 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -116,12 +116,21 @@ static int Melchior(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;

- if (INTEL_INFO(dev)->gen >= 4)
- return I915_READ(BLC_PWM_CTL2) & BLM_COMBINATION_MODE;
+ if (INTEL_INFO(dev)->gen >= 4) {

- if (IS_GEN2(dev))
- return I915_READ(BLC_PWM_CTL) & BLM_LEGACY_MODE;
+ int ret = I915_READ(BLC_PWM_CTL2) & BLM_COMBINATION_MODE;
+ DRM_DEBUG_DRIVER("BLM_COMBINATION_MODE = %d\n", ret);
+ return ret;
+ }
+
+ if (IS_GEN2(dev)) {

+ int ret = I915_READ(BLC_PWM_CTL) & BLM_LEGACY_MODE;
+ DRM_DEBUG_DRIVER("BLM_LEGACY_MODE = %d\n", ret);
+ return ret;
+ }
+
+ DRM_DEBUG_DRIVER("Do nothing, return false\n");
return 0;
}


2011/5/9 Michael Chang <[email protected]>:
>
> From the log, it looks like is_backlight_combination_mode is evaluated false
> which contradicts with the topic we are discussed. Regardless of the
> combination_mode, the log seems to work ..? weird.
>
> 2011/5/9 Melchior FRANZ <[email protected]>
>>
>> * Joey Lee -- Monday 09 May 2011:
>> > The following is debug patch, and please add kernel parameter
>> > drm.debug=0x02 :
>>
>> The result is with acpi_osi=Linux:
>>
>>
>> boot phase:
>> [ ? ?3.310274] [drm:intel_panel_get_backlight], get backlight val = 2890
>> [ ? ?3.310280] [drm:intel_panel_get_backlight], get backlight PWM = 2890
>> [ ? ?3.310615] [drm:intel_panel_get_backlight], get backlight val = 2890
>> [ ? ?3.310617] [drm:intel_panel_get_backlight], get backlight PWM = 2890
>> [ ? ?3.310619] [drm:intel_panel_set_backlight], set backlight PWM = 0
>> [ ? ?3.310622] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189401930
>> [ ? ?3.310624] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ? ?3.310626] [drm:intel_panel_set_backlight], set backlight level = 0
>>
>> [ ? ?3.641522] [drm:intel_panel_set_backlight], set backlight PWM = 2890
>> [ ? ?3.641525] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189399040
>> [ ? ?3.641527] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ? ?3.641529] [drm:intel_panel_set_backlight], set backlight level = 2890
>>
>> [ ? 11.410563] video LNXVIDEO:01: Restoring backlight state
>>
>>
>>
>> brightness up:
>> ? [no output]
>>
>>
>>
>> brightness down:
>> [ ?152.697127] [drm:intel_panel_get_max_backlight], max backlight PWM =
>> 2890
>> [ ?152.697136] [drm:intel_panel_set_backlight], set backlight PWM = 283
>> [ ?152.697141] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189401930
>> [ ?152.697146] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ?152.697150] [drm:intel_panel_set_backlight], set backlight level = 283
>>
>> [ ?166.720631] [drm:intel_panel_get_max_backlight], max backlight PWM =
>> 2890
>> [ ?166.720640] [drm:intel_panel_set_backlight], set backlight PWM = 578
>> [ ?166.720645] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189399323
>> [ ?166.720649] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ?166.720654] [drm:intel_panel_set_backlight], set backlight level = 578
>>
>> [ ?178.091776] [drm:intel_panel_get_max_backlight], max backlight PWM =
>> 2890
>> [ ?178.091784] [drm:intel_panel_set_backlight], set backlight PWM = 861
>> [ ?178.091789] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189399618
>> [ ?178.091793] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ?178.091797] [drm:intel_panel_set_backlight], set backlight level = 861
>>
>> [ ?188.888370] [drm:intel_panel_get_max_backlight], max backlight PWM =
>> 2890
>> [ ?188.888379] [drm:intel_panel_set_backlight], set backlight PWM = 1156
>> [ ?188.888383] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189399901
>> [ ?188.888388] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ?188.888392] [drm:intel_panel_set_backlight], set backlight level = 1156
>>
>> [ ?196.411657] [drm:intel_panel_get_max_backlight], max backlight PWM =
>> 2890
>> [ ?196.411665] [drm:intel_panel_set_backlight], set backlight PWM = 1439
>> [ ?196.411670] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189400196
>> [ ?196.411674] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ?196.411678] [drm:intel_panel_set_backlight], set backlight level = 1439
>>
>> [ ?201.256229] [drm:intel_panel_get_max_backlight], max backlight PWM =
>> 2890
>> [ ?201.256238] [drm:intel_panel_set_backlight], set backlight PWM = 1734
>> [ ?201.256243] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189400479
>> [ ?201.256247] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ?201.256252] [drm:intel_panel_set_backlight], set backlight level = 1734
>>
>> [ ?206.939838] [drm:intel_panel_get_max_backlight], max backlight PWM =
>> 2890
>> [ ?206.939846] [drm:intel_panel_set_backlight], set backlight PWM = 2017
>> [ ?206.939851] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189400774
>> [ ?206.939856] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ?206.939860] [drm:intel_panel_set_backlight], set backlight level = 2017
>>
>> [ ?213.779732] [drm:intel_panel_get_max_backlight], max backlight PWM =
>> 2890
>> [ ?213.779740] [drm:intel_panel_set_backlight], set backlight PWM = 2312
>> [ ?213.779744] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189401057
>> [ ?213.779749] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ?213.779753] [drm:intel_panel_set_backlight], set backlight level = 2312
>>
>> [ ?222.583806] [drm:intel_panel_get_max_backlight], max backlight PWM =
>> 2890
>> [ ?222.583814] [drm:intel_panel_set_backlight], set backlight PWM = 2595
>> [ ?222.583819] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189401352
>> [ ?222.583824] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ?222.583828] [drm:intel_panel_set_backlight], set backlight level = 2595
>>
>> [ ?229.345860] [drm:intel_panel_get_max_backlight], max backlight PWM =
>> 2890
>> [ ?229.345870] [drm:intel_panel_set_backlight], set backlight PWM = 2595
>> [ ?229.345874] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189401635
>> [ ?229.345879] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ?229.345883] [drm:intel_panel_set_backlight], set backlight level = 2595
>>
>>
>>
>> brightness up:
>> [ ?240.594464] [drm:intel_panel_get_max_backlight], max backlight PWM =
>> 2890
>> [ ?240.594474] [drm:intel_panel_set_backlight], set backlight PWM = 2312
>> [ ?240.594479] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189401635
>> [ ?240.594483] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ?240.594487] [drm:intel_panel_set_backlight], set backlight level = 2312
>>
>> [ ?240.816722] [drm:intel_panel_get_max_backlight], max backlight PWM =
>> 2890
>> [ ?240.816730] [drm:intel_panel_set_backlight], set backlight PWM = 2017
>> [ ?240.816734] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189401352
>> [ ?240.816739] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ?240.816743] [drm:intel_panel_set_backlight], set backlight level = 2017
>>
>> [ ?240.999973] [drm:intel_panel_get_max_backlight], max backlight PWM =
>> 2890
>> [ ?240.999981] [drm:intel_panel_set_backlight], set backlight PWM = 1734
>> [ ?240.999985] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189401057
>> [ ?240.999990] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ?240.999994] [drm:intel_panel_set_backlight], set backlight level = 1734
>>
>> [ ?241.212456] [drm:intel_panel_get_max_backlight], max backlight PWM =
>> 2890
>> [ ?241.212464] [drm:intel_panel_set_backlight], set backlight PWM = 1439
>> [ ?241.212469] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189400774
>> [ ?241.212473] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ?241.212478] [drm:intel_panel_set_backlight], set backlight level = 1439
>>
>> [ ?241.395611] [drm:intel_panel_get_max_backlight], max backlight PWM =
>> 2890
>> [ ?241.395619] [drm:intel_panel_set_backlight], set backlight PWM = 1156
>> [ ?241.395624] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189400479
>> [ ?241.395628] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ?241.395633] [drm:intel_panel_set_backlight], set backlight level = 1156
>>
>> [ ?242.039460] [drm:intel_panel_get_max_backlight], max backlight PWM =
>> 2890
>> [ ?242.039470] [drm:intel_panel_set_backlight], set backlight PWM = 283
>> [ ?242.039475] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189400196
>> [ ?242.039479] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ?242.039484] [drm:intel_panel_set_backlight], set backlight level = 283
>>
>> [ ?242.044495] [drm:intel_panel_get_max_backlight], max backlight PWM =
>> 2890
>> [ ?242.044502] [drm:intel_panel_set_backlight], set backlight PWM = 283
>> [ ?242.044507] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189399323
>> [ ?242.044511] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ?242.044515] [drm:intel_panel_set_backlight], set backlight level = 283
>>
>> [ ?242.077032] [drm:intel_panel_get_max_backlight], max backlight PWM =
>> 2890
>> [ ?242.077038] [drm:intel_panel_set_backlight], set backlight PWM = 0
>> [ ?242.077043] [drm:intel_panel_set_backlight], set backlight tmp(1) =
>> 189399323
>> [ ?242.077047] [drm:intel_panel_set_backlight], set backlight tmp(2) =
>> 189399040
>> [ ?242.077052] [drm:intel_panel_set_backlight], set backlight level = 0
>>
>> m.
>
>


2011-05-10 11:08:31

by Melchior FRANZ

[permalink] [raw]
Subject: Re: i915/kms/backlight-combo mode problem

* Michael Chang -- Tuesday 10 May 2011:
> Could you please try this patch and get the log ? We wonder why
> is_backlight_combination_mode () returns false.

This information was already buried in the bugzilla thread:

https://bugzilla.kernel.org/show_bug.cgi?id=31522
"It turned out that on this machine INTEL_INFO(dev)->gen equals 4,
and is_backlight_combination_mode() returns 0x40000000."


But to say it again in your words: :-)

[drm:is_backlight_combination_mode], BLM_COMBINATION_MODE = 1073741824 (0x40000000)

6x during boot-up, and several times later when changing the backlight
brightness.


This was with 8b061610dac3a3b89770c85ad63b481a47b0c38e. And now
I have a little shocker for you (and me): because this was a
vanilla kernel (apart from these debug messages), the screen went
black again, like I knew it. But pressing the "brightness down"
key turns the backlight on! I can't believe that I haven't tested
that. I guess I've only tried "brightness up" and "display toggle".
Those don't turn backlight on. Or maybe somethine else relevant
meanwhile changed in the i915 drivers. (I've regularly been
updating to HEAD.)

So, the problem was just the initial state all the time?

m.

2011-05-15 10:08:50

by Takashi Iwai

[permalink] [raw]
Subject: Re: i915/kms/backlight-combo mode problem

At Tue, 10 May 2011 13:08:23 +0200,
Melchior FRANZ wrote:
>
> * Michael Chang -- Tuesday 10 May 2011:
> > Could you please try this patch and get the log ? We wonder why
> > is_backlight_combination_mode () returns false.
>
> This information was already buried in the bugzilla thread:
>
> https://bugzilla.kernel.org/show_bug.cgi?id=31522
> "It turned out that on this machine INTEL_INFO(dev)->gen equals 4,
> and is_backlight_combination_mode() returns 0x40000000."
>
>
> But to say it again in your words: :-)
>
> [drm:is_backlight_combination_mode], BLM_COMBINATION_MODE = 1073741824 (0x40000000)
>
> 6x during boot-up, and several times later when changing the backlight
> brightness.
>
>
> This was with 8b061610dac3a3b89770c85ad63b481a47b0c38e. And now
> I have a little shocker for you (and me): because this was a
> vanilla kernel (apart from these debug messages), the screen went
> black again, like I knew it. But pressing the "brightness down"
> key turns the backlight on! I can't believe that I haven't tested
> that. I guess I've only tried "brightness up" and "display toggle".
> Those don't turn backlight on. Or maybe somethine else relevant
> meanwhile changed in the i915 drivers. (I've regularly been
> updating to HEAD.)
>
> So, the problem was just the initial state all the time?

Looks so, indeed. Now, the question is what's the real cause.

IIRC, you reported that the backlight gets normal when you revert my
commit in 2.6.38.x. So, this was regarded as a regression at first.
But, one question remains: whether the backlight level control worked
with the reverted kernel?
Judging from the attempts so far, it looks like that only LBPC can
adjust the level on your machine. If it's true, 2.6.38.0 shouldn't be
able to adjust the level. If you can still change the level without
LBPC, the former analysis was incorrect.

Also, with the latest 2.6.38.x, you found that the backlight gets back
when you adjust the level down. Another question now is what happens
if you again turn it up to the max level. Is the backlight still on?

If the backlight is kept on even with the max level, it implies that
the problem is only the initial value; once when set correctly, it'll
work fine after that. OTOH, if the backlight gets off again at max,
it means that the max value (LBPC 0xfe) is a sort of out-of-range.
Then LBPC calculation in the driver has to be modified.


thanks,

Takashi

2011-05-16 12:21:57

by Melchior FRANZ

[permalink] [raw]
Subject: Re: i915/kms/backlight-combo mode problem

* Takashi Iwai -- Sunday 15 May 2011:
> IIRC, you reported that the backlight gets normal when you revert my
> commit in 2.6.38.x. So, this was regarded as a regression at first.

Yes. And it *is* a regression, which is the whole point of my
initial complaint, as reported by Maciej in
https://bugzilla.kernel.org/show_bug.cgi?id=31522



> But, one question remains: whether the backlight level control worked
> with the reverted kernel?

Good point. Turns out it didn't work with 2.6.38-rc8 either. But it
did work at some time before. (I use this notebook mainly as a
terminal ATM, so I didn't care much for backlight level. This came
up later during investigation.)

So the only thing that 2.6.38 broke was that the backlight
was initially off. Adjustment had already been broken before
(and works now again; sigh ... confused? I am! :-).



> If you can still change the level without
> LBPC, the former analysis was incorrect.

I don't even know what an LBPC is, other than a variable named like that.
So I'd need a hint for how to test that.



> Also, with the latest 2.6.38.x, you found that the backlight gets back
> when you adjust the level down.

When I reported this, it was about 2.6.39-* and HEAD, not stable
versions. But I tried now, and openSuSE's 2.6.38.6 behaves the same.



> Another question now is what happens if you again turn it up to the
> max level. Is the backlight still on?

Yes. If the backlight was on at one point, then increasing the level
to maximum never turned if off.



> If the backlight is kept on even with the max level, it implies that
> the problem is only the initial value; once when set correctly, it'll
> work fine after that.

Yes, that's the case. (Except that after closing the lid it's off again.)

m.

2011-05-17 07:56:12

by Michael Chang

[permalink] [raw]
Subject: Re: i915/kms/backlight-combo mode problem

2011/5/16 Melchior FRANZ <[email protected]>:

> I don't even know what an LBPC is, other than a variable named like that.
> So I'd need a hint for how to test that.

It resides at your vga adapter's pci configuration space, offset 0xf4.

You can know your LPBC value by:
$ lspci -xxx -s 00:02.0 | awk '/^f0:/ {print $6}'

And alter it's value via setpci (assuming set it to max)
$ setpci -s 00:02.0 F4.B=ff

I assume you've tried this .. as you report setpci works for you. :)

>From your new attached log, In booting phase your LPBC is set to 255
and actual brightness is maximum (255*2890=736950). I see no other
change after it until manual brightness change. This is a totally
reversed to your problem.

Could you help to get the LPBC value in the initial dark condition? If
it's not corresponds to 255, maybe something sneaks and changes it but
not logged.

[ 3.125522] [drm:is_backlight_combination_mode],
BLM_COMBINATION_MODE = 1073741824
[ 3.125525] [drm:intel_panel_get_max_backlight], max backlight PWM = 736950
[ 3.125527] [drm:intel_panel_set_backlight], set backlight PWM = 736950
[ 3.125529] [drm:is_backlight_combination_mode],
BLM_COMBINATION_MODE = 1073741824
[ 3.125531] [drm:is_backlight_combination_mode],
BLM_COMBINATION_MODE = 1073741824
[ 3.125533] [drm:intel_panel_get_max_backlight], max backlight PWM = 736950
[ 3.125535] [drm:intel_panel_set_backlight], set backlight max = 736950
[ 3.125537] [drm:intel_panel_set_backlight], set backlight lbpc = 255
[ 3.125544] [drm:intel_panel_set_backlight], set backlight level = 2890

> Yes, that's the case. (Except that after closing the lid it's off again.)

Maybe this is another clue for root cause. Would it be convenient for
you to gather the log?

1. $ dmesg -c
2. Close the lid
3. Open the lid
4. $ dmesg > dmesg.lid

Thanks a lot,
Michael Chang

2011-05-17 08:58:44

by Melchior FRANZ

[permalink] [raw]
Subject: Re: i915/kms/backlight-combo mode problem

* Michael Chang -- Tuesday 17 May 2011:
[LBPC]
> You can know your LPBC value by:
> $ lspci -xxx -s 00:02.0 | awk '/^f0:/ {print $6}'
>
> And alter it's value via setpci (assuming set it to max)
> $ setpci -s 00:02.0 F4.B=ff
>
> I assume you've tried this .. as you report setpci works for you. :)

Ahh, yes, indeed. This lspci line (almost) always shows a value that
corresponds with the actual backlight brightness, and both lines work
with and without acpi_osi=Linux. (Whereas adjustment via keys only works
*with* acpi_osi=Linux.) (Tested with 2.6.39-rc7/bd1a643e10)



> Could you help to get the LPBC value in the initial dark condition? If
> it's not corresponds to 255, maybe something sneaks and changes it but
> not logged.

Initially (with acpi_osi=Linux) LPBC=0xff. After "brightness down"
it's 0x19, and after then pressing "brightness up" it's 0x01. The lowest
value I can achieve after pressing "brightness down" a few times is 0xe5,
the highest is 0x01. Neither 0xff nor 0x00 can be reached via keys, but
can (most of the time -- see below!) be set with the setpci line and give
the expected results, backlight off and fully on. ("display toggle" has
no effect on LBPC, btw.)

Setting 0xFF doesn't always turn the backlight off, though! If LBPC is
at the (key) maximum 0x01, then setting 0xFF via setpci changes only the
LBPC value as shown by lspci, but the backlight isn't actually turned off!
If I then press "backlight darker" once (LBPC=0x19), then setting 0xFF
via setpci works again.



> 1. $ dmesg -c
> 2. Close the lid
> 3. Open the lid
> 4. $ dmesg > dmesg.lid

The results are:

[ 188.571040] [drm:intel_panel_set_backlight], set backlight PWM = 736950
[ 188.571048] [drm:is_backlight_combination_mode], BLM_COMBINATION_MODE = 1073741824
[ 188.571054] [drm:is_backlight_combination_mode], BLM_COMBINATION_MODE = 1073741824
[ 188.571059] [drm:intel_panel_get_max_backlight], max backlight PWM = 736950
[ 188.571064] [drm:intel_panel_set_backlight], set backlight max = 736950
[ 188.571069] [drm:intel_panel_set_backlight], set backlight lbpc = 255
[ 188.571075] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399040
[ 188.571080] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040
[ 188.571084] [drm:intel_panel_set_backlight],
[ 188.571088] [drm:intel_opregion_asle_intr], non asle set request??
[ 188.571093] set backlight level = 2890

The backlight is off now, as always after closing/reopening the lid,
and LPBC=0xff.

m.



PS: I'd be willing to join an irc.freenode.net channel in case you or
anyone else wants quicker ("live") responses to such queries.

2011-05-17 10:12:25

by Michael Chang

[permalink] [raw]
Subject: Re: i915/kms/backlight-combo mode problem

Melchior,

I want to double check with you. If you change brightness from lowest
to highest, the LPBC value changes this way

Highest Lowest
0x10 , 0x19 ...... 0xe5

And vice versa, from Lowest to Highest

Lowest Highest
0xe5 , ...... 0x19 0x10

If above is true, then you have a very particular notebook that
reverse the sense of the LPBC values .... I don't know who ever came
across such device. wow.

Regarding that your brightness control key, due to that it is
controlled by acer_wmi and likely that BIOS aware this, it would do
brightness in a reversed way. I think Joey would check DSDT and see
any clue or evidence for this. OTOH the i915 driver didn't aware of
this and operates as usual sense that means falling into the trap.

PS. I see your log always reverse the sense of this LPBC value, now I
know why. :)

Regards,
Michael Chang

2011/5/17 Melchior FRANZ <[email protected]>:
> * Michael Chang -- Tuesday 17 May 2011:
> [LBPC]
>> You can know your LPBC value by:
>> ? $ lspci -xxx -s 00:02.0 | awk '/^f0:/ {print $6}'
>>
>> And alter it's value via setpci (assuming set it to max)
>> ? $ setpci -s 00:02.0 F4.B=ff
>>
>> I assume you've tried this .. as you report setpci works for you. :)
>
> Ahh, yes, indeed. This lspci line (almost) always shows a value that
> corresponds with the actual backlight brightness, and both lines work
> with and without acpi_osi=Linux. (Whereas adjustment via keys only works
> *with* acpi_osi=Linux.) ?(Tested with 2.6.39-rc7/bd1a643e10)
>
>
>
>> Could you help to get the LPBC value in the initial dark condition? If
>> it's not corresponds to 255, maybe something sneaks and changes it but
>> not logged.
>
> Initially (with acpi_osi=Linux) LPBC=0xff. After "brightness down"
> it's 0x19, and after then pressing "brightness up" it's 0x01. The lowest
> value I can achieve after pressing "brightness down" a few times is 0xe5,
> the highest is 0x01. Neither 0xff nor 0x00 can be reached via keys, but
> can (most of the time -- see below!) be set with the setpci line and give
> the expected results, backlight off and fully on. ("display toggle" has
> no effect on LBPC, btw.)
>
> Setting 0xFF doesn't always turn the backlight off, though! If LBPC is
> at the (key) maximum 0x01, then setting 0xFF via setpci changes only the
> LBPC value as shown by lspci, but the backlight isn't actually turned off!
> If I then press "backlight darker" once (LBPC=0x19), then setting 0xFF
> via setpci works again.
>
>
>
>> ?1. $ dmesg -c
>> ?2. Close the lid
>> ?3. Open the lid
>> ?4. $ dmesg > dmesg.lid
>
> The results are:
>
> [ ?188.571040] [drm:intel_panel_set_backlight], set backlight PWM = 736950
> [ ?188.571048] [drm:is_backlight_combination_mode], BLM_COMBINATION_MODE = 1073741824
> [ ?188.571054] [drm:is_backlight_combination_mode], BLM_COMBINATION_MODE = 1073741824
> [ ?188.571059] [drm:intel_panel_get_max_backlight], max backlight PWM = 736950
> [ ?188.571064] [drm:intel_panel_set_backlight], set backlight max = 736950
> [ ?188.571069] [drm:intel_panel_set_backlight], set backlight lbpc = 255
> [ ?188.571075] [drm:intel_panel_set_backlight], set backlight tmp(1) = 189399040
> [ ?188.571080] [drm:intel_panel_set_backlight], set backlight tmp(2) = 189399040
> [ ?188.571084] [drm:intel_panel_set_backlight],
> [ ?188.571088] [drm:intel_opregion_asle_intr], non asle set request??
> [ ?188.571093] set backlight level = 2890
>
> The backlight is off now, as always after closing/reopening the lid,
> and LPBC=0xff.
>
> m.
>
>
>
> PS: I'd be willing to join an irc.freenode.net channel in case you or
> ? ?anyone else wants quicker ("live") responses to such queries.
>

2011-05-17 11:40:14

by Melchior FRANZ

[permalink] [raw]
Subject: Re: i915/kms/backlight-combo mode problem

Hey,

* Michael Chang -- Tuesday 17 May 2011:
> If you change brightness from lowest to highest, the LPBC value changes
> this way
>
> Highest Lowest
> 0x10 , 0x19 ...... 0xe5

Yes. (Though it's 0x01, not 0x10.)

---0xFF ... initial value and after closing/reopening lid
| 0xE5 \ ... dark
| 0xCC |
| 0xB2 |
(1)| 0x99 |
| 0x7F |_____key adjustable range
| 0x66 |
| 0x4C |
| 0x33 |
-->0x19 |
0x01 / ... bright
0x00 ... also bright, only settable with setpci


(1) is the jump that resurrects the backlight from darkness by
pressing the "brightness down" key

And again, if fully turned up via keys (and therefore at 0x01),
then setting to 0xff with setpci doesn't turn it off. At all other
key steps it does. :-)



> If above is true, then you have a very particular notebook that
> reverse the sense of the LPBC values .... I don't know who ever came
> across such device. wow.

Maybe they screwed it up and therefore sold it with Linux ("linpus")
and a custom driver preinstalled ...



> Regarding that your brightness control key, due to that it is
> controlled by acer_wmi and likely that BIOS aware this, it would do
> brightness in a reversed way.

acer_wmi doesn't do the brightness adjustment. But maybe under "linpus"
some variant of it did. (BTW: there are two keys on this notebook that
aren't handled by the kernel, by X11 or even acer_wmi. There are just no
events for them. Looks like another ACER brain damage err.. "capability". :-)

m.