Re: [PATCH] acpi: fix brightness level is initialized to zero when BIOS does not restore the brightness value to _BQC.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



於 一,2012-10-01 於 15:17 +0800,joeyli 提到:
> 於 一,2012-10-01 於 15:03 +0800,Alex Hung 提到:
> > On 10/01/2012 02:47 PM, joeyli wrote:
> > > Hi Alex,
> > >
> > > 於 一,2012-10-01 於 13:39 +0800,Alex Hung 提到:
> > >> Signed-off-by: Alex Hung <alex.hung@xxxxxxxxxxxxx>
> > >> ---
> > >>   drivers/acpi/video.c |    4 ++++
> > >>   1 files changed, 4 insertions(+), 0 deletions(-)
> > >>
> > >> diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
> > >> index 42b226e..eaa9573 100644
> > >> --- a/drivers/acpi/video.c
> > >> +++ b/drivers/acpi/video.c
> > >> @@ -724,6 +724,10 @@ acpi_video_init_brightness(struct acpi_video_device *device)
> > >>   				if (level_old == br->levels[i])
> > >>   					level = level_old;
> > >>   		}
> > >> +
> > >> +		if (level == 0)
> > >> +			level = br->levels[(br->count) / 2 + 1];
> > >
> > > Looks here used the 50% brightness level.
> > >
> > > Per comment in video.c, we want set the backlight to max_level when
> > > level_old is invalid:
> > >
> > >          if (!br->flags._BQC_use_index) {
> > >                  /*
> > >                   * Set the backlight to the initial state.
> > >                   * On some buggy laptops, _BQC returns an uninitialized value
> > >                   * when invoked for the first time, i.e. level_old is invalid.
> > >                   * set the backlight to max_level in this case
> > >                   */
> > >
> > > I think here used max_level to fulfill it, e.g.
> > > 	
> > > +		if (level == 0)
> > > +			level = max_level;
> > >
> > > How do you think?
> > Hi Joey,
> > 
> > I was debating with myself which level to be set, ex. 50%, ~75% or 100%, 
> > and I think 50% *might* be closer to normal use-case (just a personal 
> > guess).
> > 
> > However, "max_level" seems to fit best if we treat the initial zero 
> > brightness in invalid. I can modify it according it that's preferred.
> > 
> > Thanks for the feedback.
> > 
> > Cheers,
> > Alex Hung
> > 
> 
> hm.... I have a question for what's the BIOS's problem that causes
> 'level == 0'?
> That implied the issue machine's max_level is 0?
> 
> 		/*
> 		 * Set the level to maximum and check if _BQC uses indexed value
> 		 */
> 		result = acpi_video_device_lcd_set_level(device, max_level);		/* write max_level purposely, then read level back, compare them */
> 		...
> 		result = acpi_video_device_lcd_get_level_current(device, &level, 0);
> 		...
> 		br->flags._BQC_use_index = (level == max_level ? 0 : 1);
> 		if (!br->flags._BQC_use_index) {				/* _BQC_use_index is 0 will run into if, means level == max_level */
> 
> So, looks the 'level == max_level == 0' when level_old is invalid.
> 
> Just wonder what's defect of BIOS (in _BCL?) causes problem.
> 
> 

Sorry for my misunderstood!

I think that's possible the level_old is 0 and there have a 0 value in
the return package from _BCL. 

Could you please share the _BCL in DSDT from issue machine? Does there
have 0 value in _BCL?


Thanks a lot!
Joey Lee


--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux