Help - Search - Members - Calendar
Full Version: Pnlf
Project OS X Forums > Snow Leopard Guides & Tutorials > DSDT Patching
18seven
Add PNLF under SB scope to enable lid0 (clamshell). In my case I also added "Darwin" _OSI, to make lid0 agreeable, however, I could have simply cut to the chase and commented out OSI queries ala Slices suggestion.

I placed PNLF above PWRB, like OS X.
CODE
        Device (PNLF)
        {
            Name (_HID, EisaId ("APP0002"))
            Name (_CID, "backlight")
            Name (_UID, 0x0A)
            Name (_STA, 0x0B)
        }
prasys
Hey

I've tested it out , yes it works and now I've a brightness slider thingy in Display. However it does nothing as in if I slide it to maximum , it just pretty much does nothing. its more of a dummy , do you know how to integrate it

This is on a MSI Wind. I've tried adding AAPL,has brightness and other things to efi strings to make it working. but that did not help
tea
Ask Slice smile.gif We use this trick. You need do:
1. Add PNLF to DSDT
2. Inject to GFX proper data (include HasPanel and Haslid)
3. Use patched gma950 + framebuffer (replaced devid).
prasys
1. Check
2. Check , I've added even backlight control to it , haspanel , haslid (I'm using EFI strings for this as I dont see any GFX/Video on my DSDT)
3. I am using 0x27ae , its a netbook. Hence its a patched kext

I get the brightness control slider but it does nothing. I can just slide but it doesn't really control the brightness of the device.
18seven
Tea,

Can you go into detail about functionality? i.e. Do your fn keys use os x' fine backlight control, hud, etc..? I would love to have much finer intensity control, however, os x does not respect acpi's bcl calls and have injected the info you listed + into gfx dsdt to no avail.

Would you mind posting an ioreg dump?
tea
About keys: for me work with Fn+F12 and Fn+Ins, original key not work.
_DSM method for my GFX device:
CODE
                Method (_DSM, 4, NotSerialized)
                {
                    Store (Package ()
                        {
                            "AAPL,slot-name",
                                 Buffer () {"Built in"},
                            "AAPL,Haslid",
                                 Buffer () {0x01, 0x00, 0x00, 0x00},
                            "AAPL,aux-power-connected",
                                 Buffer () {0x01, 0x00, 0x00, 0x00},
                            "AAPL,backlight-control",
                                 Buffer () {0x01, 0x00, 0x00, 0x00},
                            "AAPL,BacklightRestore",
                                 Buffer () {0x01, 0x00, 0x00, 0x00},
                            "AAPL,HasPanel",
                                 Buffer () {0x01, 0x00, 0x00, 0x00},
                            "AAPL01,BacklightIntensity",
                                 Buffer () {0x4E, 0x00, 0x00, 0x00},
                            "device_type",
                                 Buffer () {"display"},
                            "model",
                                 Buffer () {"GMA950"},
                            "built-in",
                                 Buffer () {0x00}
                        }, Local0)
                    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                    Return (Local0)
                }


My DSDT here.
Ioreg here.
18seven
Thanks for the info tea, alas no love. Your ec looks much more compatible than mine, hmm.
Slice
With this patch I have a little problem.
I have brightness control in System Preferences. I can move it. It moved also by hotkeys Fn+ScrollLk/Fn+Pause. I see sun on screen when typing these hotkeys. But it doesn't influence on brightness.
I can adjust brightness by hotkeys Fn+Up/Fn+Down.

Can I change these keys to be the same? Where they are defined? I didn't find anything in my DSDT.
Click to view attachment
18seven
QUOTE (Slice @ Jan 18 2010, 08:35 AM) *
With this patch I have a little problem.
I have brightness control in System Preferences. I can move it. It moved also by hotkeys Fn+ScrollLk/Fn+Pause. I see sun on screen when typing these hotkeys. But it doesn't influence on brightness.
I can adjust brightness by hotkeys Fn+Up/Fn+Down.

Can I change these keys to be the same? Where they are defined? I didn't find anything in my DSDT.
Click to view attachment


I use this patch for lid functionality and have not had any results with brightness control. However you may, start here in your dsdt...

CODE
Method (CESM, 0, NotSerialized)
{
SX10 ()
SX30 (0x18)
SX11 ()
Store (SX42 (), Local0)
SX12 ()
If (LGreaterEqual (OSID (), 0x20))
{
If (And (Local0, One))
{
Notify (\_SB.MBTN, 0x80)
}
}

If (LGreaterEqual (OSID (), 0x20))
{
If (And (Local0, 0x04))
{
Notify (\_SB.PCI0.GFX0.LCD, 0x86) // <-- remember this... (increase)
}

If (And (Local0, 0x02))
{
Notify (\_SB.PCI0.GFX0.LCD, 0x87) // <-- ..and this? (decrease)
}
}
}
Slice
I don't think that it is right place. The method CESM called when event from MBTN is occured. What is the device? Media Button? OK! But where is Sound Volume control Fn+Left/Fn+Right? It works!
Slice
QUOTE (18seven @ Jan 18 2010, 08:17 PM) *
I use this patch for lid functionality and have not had any results with brightness control. However you may, start here in your dsdt...

CODE
Method (CESM, 0, NotSerialized)
{
SX10 ()
SX30 (0x18)
SX11 ()
Store (SX42 (), Local0)
SX12 ()
If (LGreaterEqual (OSID (), 0x20))
{
If (And (Local0, One))
{
Notify (\_SB.MBTN, 0x80)
}
}

If (LGreaterEqual (OSID (), 0x20))
{
If (And (Local0, 0x04))
{
Notify (\_SB.PCI0.GFX0.LCD, 0x86) // <-- remember this... (increase)
}

If (And (Local0, 0x02))
{
Notify (\_SB.PCI0.GFX0.LCD, 0x87) // <-- ..and this? (decrease)
}
}
}

I changed 86 and 87
CODE
            If (And (Local0, 0x04))
            {
                Notify (\_SB.PCI0.GFX0.LCD, 0x87)
            }

            If (And (Local0, 0x02))
            {
                Notify (\_SB.PCI0.GFX0.LCD, 0x86)
            }

Now I see that all works as previous but working from battery display lighter then working from AC adapter!
This is event from AC<->Battery change!
Slice
QUOTE (tea @ Nov 16 2009, 11:02 AM) *
About keys: for me work with Fn+F12 and Fn+Ins, original key not work.
_DSM method for my GFX device:

My DSDT here.
Ioreg here.

I see you have no any brightness control in your DSDT.
18seven
QUOTE (Slice @ Jan 19 2010, 01:49 AM) *
Now I see that all works as previous but working from battery display lighter then working from AC adapter!
This is event from AC<->Battery change!


That makes sense since device and method follow battery. I don't see anything that interacts with BTVL in your dsdt. However, neither does an os x dsdt. com.apple.driver.AppleBacklight is loaded with PNLF and has brightness entries.
humph
QUOTE (THe KiNG @ Mar 7 2010, 09:37 AM) *
....

I get the same, IMHO is a keyboard scancode that does a apple known combination...
Here brightness control works if ACPIEC is loaded.

B....


EDITED 3/10/10, links added.

Hello all,

Just to report that after reading these threads, and also Prasys' article on getting Fn keys to work, I've finally managed to get this whole backlight control thing sorted out.

Means full OS control over LID & backlighting, with direct F1/F2 keys (not Fn+F1) for brightness control (and 3/4/5 for volume!), rather than having to rely on the (Fn+) arrow keys. Displays Prefpane has backlight slider. LID sleep also via PNLF and not nasty hacks or kexts.

Machine Lenovo S9e:
- ACPIEC is loading (there was already an EC section in the DSDT) EDIT: Attached Click to view attachment
EDIT 3/22: Was asked by PM for complete DSDT. Here it is. Some messy bits commented out, as still messing around...Click to view attachment
- DSDT patched with PNLF:
http://www.projectosx.com/forum/index.php?showtopic=779
- DSDT patched with GFX for GMA:
http://www.projectosx.com/forum/index.php?...post&p=3760
- DSDT patched with additional PS2k Fn info from Prasys' blog, and following his other guidance:
http://prasys.co.cc/2009/12/getting-fn-tog...rk-on-hackbooks

- Various other DSDT changes, but I'm pretty sure that they have nothing to do with this particular issue, although adding "Darwin or Win2006" to various OSYS checks in DSDT (based on Tea's DSDT) may also be necessary as well as PNLF on my machine, as it has OS-related If/then's in DSDT related to GFX/backlight (the Notify ..0x86/0x87 stuff).

Prior to doing Prasys' stuff, PNLF enabled backlight slider and the Fn+F8 decrease brightness "sun" others have observed. Just there was no way to increase backlight, as Fn+up/down keys did not "work" any more.

The key was I guess following Prasys' notes on DSDT adders and use of FunctionFlip. Worked with both old or Prasys' newly compiled PS2Keyboard.

Anyway, thanks to the information provided in this forum, I can now assign F1 as backlight down, F2 as up and get the 'sun' etc...
Very, very happy.
THe KiNG
QUOTE (humph @ Mar 9 2010, 02:59 PM) *
....

Try to post something that make sense, so far you are the only one who knows what you did...
And is known that brightness control works on some notebooks with gma950.
humph
QUOTE (THe KiNG @ Mar 10 2010, 10:33 AM) *
..
Try to post something that make sense, so far you are the only one who knows what you did...
And is known that brightness control works on some notebooks with gma950.


"My Nonsense" - Yep, you're right - Updated the original post with some links & info.

On reflection, I see that this is probably not the right thread to have posted to (better in PNLF or a noob-solutions).
I guess I was focussed on the various comments about why brightness control on Fn u/d, Fn/Scroll, F8 etc.
As I'd understood things the reason you'd "automatically" get Fn up/down changing backlight on some notebook was that it was still under "BIOS control", and even once you've got OS taking control (but then say having Fn+F8=decrease), the final step is getting OS to make use of F1/F2 as backlight control.

Now I see that this thread is really about getting EC working on machines that don't already have it in mfg's DSDT/unknown EC chip+chip I/O config.
THe KiNG
Moved to the right place...

When I said that you should post something with sense, I mean to post your modifications, like post your dsdt before/after, or part of it before/after then explain what you did and why...
That way if someone read can easy understand, who knows maybe someone with same notebook or with same gfx and so...
humph
QUOTE (THe KiNG @ Mar 10 2010, 06:16 PM) *
Moved to the right place...

Thank you for moving my posts to the right place, Mr KING.

One additional note for others, the F1 etc keys are not recognized until FunctionFlip is loaded, which means when you are logged on as a user (and not immediately when you see the account selection/login window).

Also, the setting for backlight is not retained thru a power off/on or reboot cycle. Not found a solution yet, I guess it may be due to not having/using NVRAM.
lanbing
hi all
my nootbook is lenovo Y450 with video card gt240m
i driver my video card with adding PEGP inthe dadt !
and before i modefy my dadt the lcd's brightness could change by fn+up/down
once i add PEGP inthe dadt i lose the brightness change ,the quick key do not work any more.and another problem is when wake up from sleep the lcd'bright was changed highest level!
here is my dsdt and ioreg
Click to view attachment
Click to view attachment
nobb1x
am i wrong if i say that none mac use 0x87/0x86 acpi to control/adjust display brightness?
i have about the same code as Slice's Dell in my Acer but changing or even removing it at all does not change
anything. i have too the fn+up/down keys control volume (with icon on screen) and fn+left/right keys control the
brightness (no icon), pause/interr key bring on screen the brightness up icon but it don't change the brightness.
i found an interesting article about Acer acpi methods here
http://forum.notebookreview.com/acer/41911...aks-2-a-31.html
but macs use a different approach (no signs of a similar code in any mac dsdt i have seen)

Slice
Now I got brightness working with PNLF device and special kext by ivik. Thanks him!
CODE

Device (PNLF)
{
Name (_HID, EisaId ("APP0002"))
Name (_CID, "backlight")
Name (_UID, 0x0A)
Name (_STA, 0x0B)

Name (PTVL, 0x64)
Name (PBCL, Package (0x0A) {})
Method (_BCL, 0, NotSerialized)
{
SX10 ()
SX30 (0x19)
SX30 (Zero)
SX11 ()
Store (SX40 (), Index (PBCL, Zero))
Store (SX40 (), Index (PBCL, One))
Store (SX40 (), Index (PBCL, 0x02))
Store (SX40 (), Index (PBCL, 0x03))
Store (SX40 (), Index (PBCL, 0x04))
Store (SX40 (), Index (PBCL, 0x05))
Store (SX40 (), Index (PBCL, 0x06))
Store (SX40 (), Index (PBCL, 0x07))
Store (SX40 (), Index (PBCL, 0x08))
Store (SX40 (), Index (PBCL, 0x09))
SX12 ()
Return (PBCL)
}

Method (_BCM, 1, NotSerialized)
{
SX10 ()
SX30 (0x19)
SX30 (One)
SX30 (Arg0)
Store (Arg0, PTVL)
SX11 ()
SX12 ()
}

Method (_BQC, 0, NotSerialized)
{
SX10 ()
SX30 (0x19)
SX30 (0x02)
SX11 ()
Store (SX40 (), Local0)
Store (Local0, PTVL)
SX12 ()
Return (Local0)
}

}
}
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.