public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Aaron Lu <aaron.lu@intel.com>
To: Danny Baumann <dannybaumann@web.de>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Zhang Rui <rui.zhang@intel.com>, Len Brown <lenb@kernel.org>
Subject: Re: [PATCH 3/3] ACPI video: Fix applying indexed initial brightness value.
Date: Fri, 15 Mar 2013 17:01:39 +0800	[thread overview]
Message-ID: <5142E373.1020006@intel.com> (raw)
In-Reply-To: <5142E20C.40805@web.de>

On 03/15/2013 04:55 PM, Danny Baumann wrote:
> Hi,
> 
>  >> +static unsigned long long
>>> +acpi_video_index_to_level(struct acpi_video_device *device,
>>> +			  unsigned long long index)
>>> +{
>>> +	if (device->brightness->flags._BCL_reversed)
>>> +		index = device->brightness->count - 3 - index;
>>> +
>>> +	return device->brightness->levels[index + 2];
>>> +}
>>
>> What about making this function also take care of the
>> bqc_offset_aml_bug_workaround? so that this function serves more like a
>> conversion from raw value to fixed value, the function name can perhaps
>> be named as: acpi_video_fix_bqc_value, or whatever you think is more
>> appropriate.
> 
> Makes sense to me. How about acpi_video_bqc_to_level? I'd suggest 
> acpi_video_bqc_value_to_level, but that makes it hard to keep the 80 
> char limit in acpi_video_device_lcd_get_level_current.

Right, so let's go with acpi_video_bqc_to_level.

> 
>>> @@ -742,9 +749,7 @@ acpi_video_init_brightness(struct acpi_video_device *device)
>>>   				}
>>>   		}
>>>   	} else {
>>> -		if (br->flags._BCL_reversed)
>>> -			level_old = (br->count - 1) - level_old;
>>> -		level = br->levels[level_old];
>>> +		level = acpi_video_index_to_level(device, level_old);
>>
>> And here, that new function should be used, which also takes care of the
>> offset_aml_bug problem(though in theory, the two problems may not happen
>> on the same BIOS table).
> 
> But that new function (whatever it's named) is already used here?

Yes, I mean the new function that also takes care of offset_aml_bug :-)

> 
> BTW, shouldn't the use_bios_initial_backlight also be respected for the 
> BQC-returns-index case? Currently it's only used for the 
> BQC-returns-level case.

Definitely, we should care that.

> 
>> And the acpi_video_device_lcd_get_level_current's param init can
>> probably be renamed as raw, meaning if raw value is desired or fixed
>> value, but it's not a big deal.
> 
> Agreed. I'll send a new patch set (this time with signed-off-by) once I 
> get opinion on the question above.

Cool, thanks.

-Aaron


      reply	other threads:[~2013-03-15  9:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14 10:34 [PATCH 0/3] ACPI video: Fix brightness control initialization sequence Danny Baumann
2013-03-14 10:34 ` [PATCH 1/3] ACPI video: Fix brightness control initialization for some laptops Danny Baumann
2013-03-15  8:38   ` Aaron Lu
2013-03-14 10:34 ` [PATCH 2/3] ACPI video: Make logic a little easier to understand Danny Baumann
2013-03-15  8:39   ` Aaron Lu
2013-03-14 10:34 ` [PATCH 3/3] ACPI video: Fix applying indexed initial brightness value Danny Baumann
2013-03-15  8:48   ` Aaron Lu
2013-03-15  8:55     ` Danny Baumann
2013-03-15  9:01       ` Aaron Lu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5142E373.1020006@intel.com \
    --to=aaron.lu@intel.com \
    --cc=dannybaumann@web.de \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox