public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Aaron Lu <aaron.lu@intel.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
	"Rafael J. Wysocki" <rjw@sisk.pl>, Len Brown <lenb@kernel.org>,
	Zhang Rui <rui.zhang@intel.com>
Subject: Re: [PATCH] acpi: video: fix reversed indexed BQC
Date: Fri, 02 Aug 2013 12:59:08 +0800	[thread overview]
Message-ID: <51FB3C9C.6070002@intel.com> (raw)
In-Reply-To: <CAMP44s1honSdnoMnmpEcsXtdkJuPYgQgnLwcN+oxs5f=a+3Stg@mail.gmail.com>

On 08/02/2013 12:50 PM, Felipe Contreras wrote:
> On Thu, Aug 1, 2013 at 11:30 PM, Aaron Lu <aaron.lu@intel.com> wrote:
>> On 08/02/2013 12:11 PM, Felipe Contreras wrote:
>>> On Thu, Aug 1, 2013 at 9:03 PM, Aaron Lu <aaron.lwe@gmail.com> wrote:
>>>> On 08/02/2013 07:34 AM, Felipe Contreras wrote:
>>>>> Commit 1a7c618 (ACPI video: support _BQC/_BCL/_BCM methods that use
>>>>> index values) assumed that bl->levels were not reverted, but at this
>>>>> point they already are, so there's no need to revert them yet again.
>>>>
>>>> When acpi_video_bqc_value_to_level is called, bl->levels is not
>>>> reverted.
>>>
>>> This is the code that turns br->flags._BCL_reversed on:
>>>
>>>       if (max_level == br->levels[2]) {
>>>               br->flags._BCL_reversed = 1;
>>>               sort(&br->levels[2], count - 2, sizeof(br->levels[2]),
>>>                       acpi_video_cmp_level, NULL);
>>>       }
>>>
>>> Now tell me how br->flags._BCL_reversed can be on, and the br->levels
>>> *not* reverted.
>>
>> Oh yes, it is reverted to be in increase order, so it is not in reverse
>> order. I'm a little confused by these words.
> 
> br->levels is always ascending, but that doesn't mean _BCL is.

Right.

> 
>> Please see acpi_video_bqc_quirk, we set _BQC_use_index by revert the
>> level on a reversed _BCL, so we will need to revert level here too.
> 
> I cannot parse that sentence, but nothing needs to change there; to
> find out if _BQC is using an index, we need to see if the returned
> value is the index of the level we are looking for, and to find that
> out we need the original list of levels, which can be found by
> reverting the already reverted list. If this wasn't the case there

Yes, but instead of reverting the already reverted list, we revert the
returned value to get the correct index in the reverted list. But your
patch removes the revert, is it correct?

> would not be any need for the _BCL_reversed flag.
> 
-Aaron

  reply	other threads:[~2013-08-02  4:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-01 23:34 [PATCH] acpi: video: fix reversed indexed BQC Felipe Contreras
2013-08-02  2:03 ` Aaron Lu
2013-08-02  4:11   ` Felipe Contreras
2013-08-02  4:30     ` Aaron Lu
2013-08-02  4:50       ` Felipe Contreras
2013-08-02  4:59         ` Aaron Lu [this message]
2013-08-02  6:44           ` Felipe Contreras
2013-08-02  6:56             ` Aaron Lu
2013-08-02  7:59               ` Felipe Contreras
2013-08-02  8:06                 ` Aaron Lu
2013-08-02  8:14                   ` Felipe Contreras
2013-08-02  8:25                     ` Aaron Lu
2013-08-02 11:20                       ` Felipe Contreras

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=51FB3C9C.6070002@intel.com \
    --to=aaron.lu@intel.com \
    --cc=felipe.contreras@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --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