OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 8:20 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: basic ACPI questions (power button, brightness control)
PostPosted: Wed Jul 27, 2022 12:35 am 
Offline
Member
Member

Joined: Mon Dec 07, 2020 8:09 am
Posts: 212
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?


Top
 Profile  
 
 Post subject: Re: basic ACPI questions (power button, brightness control)
PostPosted: Wed Jul 27, 2022 11:44 am 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1593
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!


Top
 Profile  
 
 Post subject: Re: basic ACPI questions (power button, brightness control)
PostPosted: Wed Jul 27, 2022 12:56 pm 
Offline
Member
Member
User avatar

Joined: Fri Aug 07, 2015 6:13 am
Posts: 1134
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


Top
 Profile  
 
 Post subject: Re: basic ACPI questions (power button, brightness control)
PostPosted: Thu Jul 28, 2022 9:20 pm 
Offline
Member
Member

Joined: Mon Dec 07, 2020 8:09 am
Posts: 212
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:
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: SemrushBot [Bot] and 55 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group