basic ACPI questions (power button, brightness control)

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
xeyes
Member
Member
Posts: 212
Joined: Mon Dec 07, 2020 8:09 am

basic ACPI questions (power button, brightness control)

Post by xeyes »

Built ACPICA while looking into a different problem and have some basic questions on it:

Power button:

I registered a fixed event handler for this event, and it works once in Qemu, but subsequet presses no longer triggers SCI or my handler.

Do I need to do something in the handler for it to be called again? I saw that AcpiEvFixedEventDispatch() already clears the status bit.

It doesn't work at all on real hardware, pressing power button doesn't trigger either SCI or the handler. Is it required that a power botton is always wired to trigger this fixed event or the vendors can become creative and do something else?


Brightness control:

In the spec there is a section on "Extensions for Display Adapters". But ACPICA didn't print any of those method names (such as _BCL) during initialization.

Didn't find much about backlight in ACPICA's documents either. Could folks with experience of this help give some pointers on where to look?


Also wondering whether this is a commonly supported and used interface to change brightness on laptops? Or is it like the "protected mode VBE interface", that is not supported by most devices thus a device specific GPU driver is needed for brightness control in most cases once ACPI is enabled?
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Re: basic ACPI questions (power button, brightness control)

Post by nullplan »

Well, I can tell you that my laptop does implement _BCL and _BCM, and they appear to work at least at a glance.
Carpe diem!
User avatar
Octacone
Member
Member
Posts: 1138
Joined: Fri Aug 07, 2015 6:13 am

Re: basic ACPI questions (power button, brightness control)

Post by Octacone »

xeyes wrote: thus a device specific GPU driver is needed for brightness control in most cases once ACPI is enabled?
Hmm... while writing a Intel HD Graphics driver I've seen a lot of paragraphs about brightness control. It seems straight forward and I think you don't even need ACPI.
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
xeyes
Member
Member
Posts: 212
Joined: Mon Dec 07, 2020 8:09 am

Re: basic ACPI questions (power button, brightness control)

Post by xeyes »

nullplan wrote:Well, I can tell you that my laptop does implement _BCL and _BCM, and they appear to work at least at a glance.
Consider yourself lucky :lol:

Tried 3 laptops and ACPI brightness control works only on 1 out of the 3 under Linux.

I got the only supported one half working before looking at its AML code. _BCM works for some levels, but _BCL always return a fake list of 102 items, values from 0 to 100, many of which don't do anything when given to _BCM.

Can't figure out why, I dumped the tables and found out that the logic inside _BCL is similar to

Code: Select all

if (win8 or later)
    return fake list of 102 items levels
else
    return real list of supported levels
What's special about Win8? I searched the internet and learned that Windows stopped using ACPI brightness control from Win 8 onwards, which was 10 years ago. Maybe it isn't a surprise that only 1 out of 3 laptops still support an interface that "nobody" is using now.

Thus, the current situation is :

1. You lie to FW, claiming that you are Windows, for AML to work well
2. FW also lie to Windows (fake or real), claiming that it supports 100 levels in its _BCL return value, knowing that Windows doesn't use _BCM

Maybe ACPI brightness control isn't exactly another VBE 3.0 PM interface yet, but it seems to be quickly on its way to become one.


On the other hand, the power button events work much better on laptops that don't support _BCM, do both work on yours?
Octacone wrote:
xeyes wrote: thus a device specific GPU driver is needed for brightness control in most cases once ACPI is enabled?
Hmm... while writing a Intel HD Graphics driver I've seen a lot of paragraphs about brightness control. It seems straight forward and I think you don't even need ACPI.
Thanks! Good to hear that it might not be too difficult to do this from the GPU side.

Probably not a good idea to start writing graphics driver because a timer interrupt was lost though, so maybe later.
Post Reply