Screen Brightness

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
osmiumusa
Posts: 20
Joined: Sun Dec 12, 2010 5:47 pm

Screen Brightness

Post by osmiumusa »

Hello world!

What would be the easiest way to control screen brightness? If its using ACPI (which I really don't want to do just yet) then I need to know how to do it without ASL because I don't have that implemented AT ALL quite yet.
Any help is appreciated.

~osmiumusa :mrgreen:
quok
Member
Member
Posts: 490
Joined: Wed Oct 18, 2006 10:43 pm
Location: Kansas City, KS, USA

Re: Screen Brightness

Post by quok »

Use the controls on your monitor to take care of it.
osmiumusa
Posts: 20
Joined: Sun Dec 12, 2010 5:47 pm

Re: Screen Brightness

Post by osmiumusa »

No. Like on a LCD screen of a laptop. I want to dim the screen after a period of inactivity. I want this function written right into the kernel, but I don't know how to do it.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Screen Brightness

Post by bluemoon »

How about using ASL compiler from http://www.acpi.info/toolkit.htm to turn the ASL into AML byte code,
and use that AML directly in your code?

I believe LCD brightness is controlled with ACPI _BCM (Brightness Control Method).
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: Screen Brightness

Post by Brynet-Inc »

osmiumusa wrote:No. Like on a LCD screen of a laptop. I want to dim the screen after a period of inactivity. I want this function written right into the kernel, but I don't know how to do it.
Sometimes it's implemented by the laptop's EC and can be controlled using a Fn key combo, no OS intervention required, not always however.

ACPI is the only "standard" method of controlling brightness, the publicly available specification has more information about this.. start on page 695, "ACPI Extensions for Display adapters". Indeed it appears an AML interpreter may be necessary.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
terry
Posts: 13
Joined: Tue Mar 17, 2009 12:43 pm

Re: Screen Brightness

Post by terry »

One ACPI Implementation with a license that allows it to be used in both closed and open-source projects is ACPICA (http://www.acpica.org/).

I believe several major operating systems use this to implement ACPI so it is pretty good.
osmiumusa
Posts: 20
Joined: Sun Dec 12, 2010 5:47 pm

Re: Screen Brightness

Post by osmiumusa »

In the "ACPI Shutdown" thread somewhere on this forum (linked from the wiki page about shutdowns), the author shows that you can control acpi by finding the specific values in objects in acpi memory? How do find the _BCL object using "C-acpi", or how do I find out where it is? Is there any documentation about where this is? I currently don't have the time to implement acpica, even though it looks very helpful. I don't think you, but can you do it with APM? Just wondering...

Thank you :)
Cognition
Member
Member
Posts: 191
Joined: Tue Apr 15, 2008 6:37 pm
Location: Gotham, Batmanistan

Re: Screen Brightness

Post by Cognition »

You need to deal with ASL and AML to do it properly. The only reason that little shutdown hack can work is because there's currently a standardized proceedure for invoking a shutdown on a ACPI based computer (you write a specific value to a specific port). Virtually anything else that depends on AML can implement customized methods that could invoke multiple interactions with multiple buses and registers. That's pretty much the entire purpose of AML to begin with. That said, it's important to keep in mind that the shutdown hack described is just that, a hack. There's nothing that prevents a motherboard from having a signature identical to that of the shutdown object stored in a random buffer somewhere that's declared before the shutdown object itself. You basically need an AML interpreter to safely interact with anything in the AML, and that includes all the methods described in the ACPI specification.
Reserved for OEM use.
osmiumusa
Posts: 20
Joined: Sun Dec 12, 2010 5:47 pm

Re: Screen Brightness

Post by osmiumusa »

Last ditch effort before the realization of the inevitability of implementing ACPICA...

Using a program like iASL, can I write a program that controls screen brightness in ASL, and have it churn out ASM or C source code? I only ask because I haven't gotten iASL to work from the examples in the ACPI documentation.

The two reasons why I'm so reluctant to integrate a whole ACPI layer is because it would add size to the kernel and suck speed from its quick loading time.

osmiumusa :mrgreen:
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: Screen Brightness

Post by Owen »

iASL is for compiling ASL source code to AML bytecode. It is primarily a tool for motherboard developers (and motherboard AML reverse engineers)

Sorry, but there is no way to do this but use an AML interpreter.
Post Reply