Jump to content

ACPI Backlight Driver


hotKoffy
 Share

224 posts in this topic

Recommended Posts

To determine the values to enter, you need to determine the actual values being used, and how they affect the brightness. Look in ioreg at RawBrightness as you change the slider. The percentage of slider position is meaningless.

 

Note: you will find the current value under PNLF:ApplePanelRawBrightness

Yes thats what I did, I was just trying to describe the weird behavior when the slider goes from 0% to 100%.

Link to comment
Share on other sites

Yes thats what I did, I was just trying to describe the weird behavior when the slider goes from 0% to 100%.

It doesn't sound like weird behavior at all. Your feeding it values that are out of range, so you should expect something to not work correctly. Once you correct the range, all should be good.

 

What was the valid range?

Link to comment
Share on other sites

It doesn't sound like weird behavior at all. Your feeding it values that are out of range, so you should expect something to not work correctly. Once you correct the range, all should be good.

 

What was the valid range?

Lowest visible value was 0x1f and highest was 0x6f6.

Link to comment
Share on other sites

Lowest visible value was 0x1f and highest was 0x6f6.

But I thought you said that at 40% the brightness went to black? Are you saying with the slider at 40% (or slightly less than), the ApplePanelRawBrightness is at 0x6f6?

 

Here's the procedure:

- brightness slider at full left (display should be black) Keep your mouse button down...

- move brightness slider slowly to the right until full brightness is reached (just before it "rolls over" and turns black)

- record the value of ApplePanelRawBrightness (that is your maximum value)

 

Then... build a new data block for the plist taking into account that maximum value (eg. 17 values, from 0 to that max value).

Link to comment
Share on other sites

But I thought you said that at 40% the brightness went to black? Are you saying with the slider at 40% (or slightly less than), the ApplePanelRawBrightness is at 0x6f6?

 

Here's the procedure:

- brightness slider at full left (display should be black) Keep your mouse button down...

- move brightness slider slowly to the right until full brightness is reached (just before it "rolls over" and turns black)

- record the value of ApplePanelRawBrightness (that is your maximum value)

 

Then... build a new data block for the plist taking into account that maximum value (eg. 17 values, from 0 to that max value).

Wait a minute.

But I thought you said that at 40% the brightness went to black? Are you saying with the slider at 40% (or slightly less than), the ApplePanelRawBrightness is at 0x6f6?

No it Rolls over at around 40%, then again, again... until rolls over at around 99% for the final time and is the highest value 0x6f6.

 

Here's the procedure:

- brightness slider at full left (display should be black) Keep your mouse button down...

- move brightness slider slowly to the right until full brightness is reached (just before it "rolls over" and turns black)

- record the value of ApplePanelRawBrightness (that is your maximum value)

 

Then... build a new data block for the plist taking into account that maximum value (eg. 17 values, from 0 to that max value).

Thats what I did but this 'rolls over' multiple times. It don't make much sense to me.

 

first value is 0x1f, increases until 0xfa, turns almost black 0x102, increases until 0x1fc, then turns almost black 0x202, increases until 0x2f7, then turns almost black again at 0x302. This goes on until it gets to last 'roll over' increasing until 0x6f6 (slider at about 99%), then turns almost black at 0x710 (slider 100%).

Link to comment
Share on other sites

Wait a minute.

No it Rolls over at around 40%, then again, again... until rolls over at around 99% for the final time and is the highest value 0x6f6.

All you care about is the first rollover.

 

Thats what I did but this 'rolls over' multiple times. It don't make much sense to me.

It makes a ton of sense. Read below...

 

first value is 0x1f, increases until 0xfa, turns almost black 0x102, increases until 0x1fc, then turns almost black 0x202, increases until 0x2f7, then turns almost black again at 0x302. This goes on until it gets to last 'roll over' increasing until 0x6f6 (slider at about 99%), then turns almost black at 0x710 (slider 100%).

So your range is likely 0-0xFF. In other words, eight significant bits, higher order bits ignored (thus the rolling over where it does)... valid values between 0-255 (decimal). If you look at existing entries in AppleBacklight.kext, you will find many that end at 0xFF. I suggest you experiment with some of those and find one that pleases you.

Link to comment
Share on other sites

All you care about is the first rollover.

 

 

It makes a ton of sense. Read below...

 

 

So your range is likely 0-0xFF. In other words, eight significant bits, higher order bits ignored (thus the rolling over where it does)... valid values between 0-255 (decimal). If you look at existing entries in AppleBacklight.kext, you will find many that end at 0xFF. I suggest you experiment with some of those and find one that pleases you.

Ok, can use my own values or do I have to use existing entries?

 

I also tried to check what values Windows uses. On RW Everything my BAR1 was 0xC000000C, added 4824c (why that value?) into it and got C0048258.

 

RWEverything>Access>Memory

 

Changed Address like this 'Address=00000000C0048258', then tried the fn keys to adjust brightnes, but none of the values changed. I guess I'm not in the correct memory location.

Link to comment
Share on other sites

Ok, can use my own values or do I have to use existing entries?

You can use your own values to your liking. Start with a set of data that already exists, try it out, and tweak from there.

 

I also tried to check what values Windows uses. On RW Everything my BAR1 was 0xC000000C, added 4824c (why that value?) into it and got C0048258.

 

RWEverything>Access>Memory

 

Changed Address like this 'Address=00000000C0048258', then tried the fn keys to adjust brightnes, but none of the values changed. I guess I'm not in the correct memory location.

As we've already discovered, your computer is not using the IntelHD backlight registers (using something on the Radeon chip). It does not make sense to play around with IntelHD hardware when your computer isn't using it.

Link to comment
Share on other sites

You can use your own values to your liking. Start with a set of data that already exists, try it out, and tweak from there.

Wouldn't it make more sense to use the values from the last roll over and not the first, as the final roll over has much brighter higheat value?

 

As we've already discovered, your computer is not using the IntelHD backlight registers (using something on the Radeon chip). It does not make sense to play around with IntelHD hardware when your computer isn't using it.

I thought I't would be possible to check what backlight values Windows uses By using the AMD BAR1 value.

Device/Vendor ID	0x68411002
Revision ID	0x00
Class Code	0x030000
Cacheline Size	0x10
Latency Timer	0x00
Interrupt Pin	INTA
Interrupt Line	None
BAR1		0xC000000C
BAR2		0x00000000
BAR3		0xD4300004
BAR4		0x00000000
BAR5		0x00004001
BAR6		0x00000000
Expansion ROM	0x00000000
Subsystem ID	0x17A9103C

Is there any other way to check backlight values on Windows?

Link to comment
Share on other sites

Wouldn't it make more sense to use the values from the last roll over and not the first, as the final roll over has much brighter higheat value?

Brightness is likely the same with 0xFF, 0x1FF, 0x2FF, 0x3FF, 0xFFFF. I think only the low-order 8-bit are significant. The rest are ignored.

 

I thought I't would be possible to check what backlight values Windows uses By using the AMD BAR1 value.

Device/Vendor ID	0x68411002
Revision ID	0x00
Class Code	0x030000
Cacheline Size	0x10
Latency Timer	0x00
Interrupt Pin	INTA
Interrupt Line	None
BAR1		0xC000000C
BAR2		0x00000000
BAR3		0xD4300004
BAR4		0x00000000
BAR5		0x00004001
BAR6		0x00000000
Expansion ROM	0x00000000
Subsystem ID	0x17A9103C
Is there any other way to check backlight values on Windows?

 

It is not likely that the AMD chip stores the brightness values in the same location as Intel.

 

Finding where it is stored for the Radeon would be a completely different/separate process of investigating AMD docs/Linux drivers, etc.

Link to comment
Share on other sites

I install OS X 10.9, Panasonic Lets note CF-R7D.

This laptop's video card is Intel GMA X3100.

 

I make DSDT.aml using DSDT Editer, modified post #1.
And install ACPIBacklight.kext using kext utility.
 
AppleBacklightDisplay and ACPIBacklight is loading.(see attached picture)
 

Use modify DSDT.aml and OS X boot up, kernel log:

Jan 19 17:13:26 alphonse-no-MacBook-Pro kernel[0]: ACPIBacklightPanel: Found Backlight Device: DD02
Jan 19 17:13:26 alphonse-no-MacBook-Pro kernel[0]: ACPIBacklightPanel: ACPI Method _DOS found. Device path: _SB.PCI0.GFX0
Jan 19 17:13:26 alphonse-no-MacBook-Pro kernel[0]: ACPIBacklightPanel: ACPI Methods _BCL _BCM _BQC found. Device path: _SB.PCI0.GFX0.DD02
Jan 19 17:13:26 alphonse-no-MacBook-Pro kernel[0]: ACPIBacklightPanel: getIndexForLevel(-10) not found in _BCL table !
Jan 19 17:13:26 alphonse-no-MacBook-Pro kernel[0]: ACPIBacklightPanel: Version 1.2

Lever of brightness adjustment is displayed on the pref.panel, display tab.
The brightness of the screen does not change even when move the lever.
 
Pressing Fn + ScrLk, the Fn + Pause, level of display brightness will change, but the brightness of the screen does not change.
my DSDT.isl:
 
        Device (PNLF)
        {
            Name (_HID, EisaId ("APP0002"))
            Name (_CID, "backlight")
            Name (_UID, 0x0A)
            Name (_STA, 0x0B)
        }

           Device (GFX0)
            {
                Name (_ADR, 0x00020000)
                Method (_DSM, 4, NotSerialized)
                {
                    Store (Package (0x60)
                        {
                            "device_type", 
                            Buffer (0x08)
                            {
                                "display"
                            }, 
                            "model", 
                            Buffer (0x0D)
                            {
                                "X3100"
                            }, 
                            "AAPL,HasPanel", 
                            Buffer (0x04)
                            {
                                 0x01, 0x00, 0x00, 0x00
                            }, 
                            "AAPL,Haslid", 
                            Buffer (0x04)
                            {
                                 0x01, 0x00, 0x00, 0x00
                            }, 
                            "AAPL,SelfRefreshSupported", 
                            Buffer (0x04)
                            {
                                 0x01, 0x00, 0x00, 0x00
                            }, 
                            "AAPL,aux-power-connected", 
                            Buffer (0x04)
                            {
                                 0x01, 0x00, 0x00, 0x00
                            }, 
                            "AAPL,backlight-control", 
                            Buffer (0x04)
                            {
                                 0x01, 0x00, 0x00, 0x00
                            }, 
                            "@0,backlight-control", 
                            Buffer (0x04)
                            {
                                 0x01, 0x00, 0x00, 0x00
                            }, 
                            "@0,AAPL,boot-display", 
                            Buffer (0x04)
                            {
                                 0x01, 0x00, 0x00, 0x00
                            }, 
                            "@0,built-in", 
                            Buffer (One)
                            {
                                 0x01
                            }, 
                            "AAPL00,blackscreen-preferences", 
                            Buffer (0x04)
                            {
                                 0x00, 0x00, 0x00, 0x08
                            }, 
                            "AAPL01,BacklightIntensity", 
                            Unicode ("d"), 
                            "AAPL01,blackscreen-preferences", 
                            Buffer (0x04)
                            {
                                 0x00, 0x00, 0x00, 0x08
                            }, 
                            "AAPL01,DataJustify", 
                            Buffer (0x04)
                            {
                                 0x01, 0x00, 0x00, 0x00
                            }, 
                            "AAPL01,Depth", 
                            Unicode (" "), 
                            "AAPL01,Dither", 
                            Buffer (0x04)
                            {
                                 0x00, 0x00, 0x00, 0x00
                            }, 
                            "AAPL01,DualLink", 
                            Buffer (0x04)
                            {
                                 0x01, 0x00, 0x00, 0x00
                            }, 
                            "AAPL01,Height", 
                            Buffer (0x04)
                            {
                                 0x20, 0x03, 0x00, 0x00
                            }, 
                            "AAPL01,Interlace", 
                            Buffer (0x04)
                            {
                                 0x00, 0x00, 0x00, 0x00
                            }, 
                            "AAPL01,Inverter", 
                            Buffer (0x04)
                            {
                                 0x00, 0x00, 0x00, 0x00
                            }, 
                            "AAPL01,InverterCurrent", 
                            Buffer (0x04)
                            {
                                 0x00, 0x00, 0x00, 0x00
                            }, 
                            "AAPL01,LinkFormat", 
                            Buffer (0x04)
                            {
                                 0x00, 0x00, 0x00, 0x00
                            }, 
                            "AAPL01,LinkType", 
                            Buffer (0x04)
                            {
                                 0x00, 0x00, 0x00, 0x00
                            }, 
                            "AAPL01,Pipe", 
                            Buffer (0x04)
                            {
                                 0x01, 0x00, 0x00, 0x00
                            }, 
                            "AAPL01,PixelFormat", 
                            Buffer (0x04)
                            {
                                 0x00, 0x00, 0x00, 0x00
                            }, 
                            "AAPL01,Refresh", 
                            Unicode (";"), 
                            "AAPL01,Stretched", 
                            Buffer (0x04)
                            {
                                 0x00, 0x00, 0x00, 0x00
                            }
                        }, Local0)
                    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                    Return (Local0)
                }
    Method (DTGP, 5, NotSerialized)
    {
        If (LEqual (Arg0, Buffer (0x10)
                {
                    /* 0000 */   0xC6, 0xB7, 0xB5, 0xA0, 0x18, 0x13, 0x1C, 0x44,
                    /* 0008 */   0xB0, 0xC9, 0xFE, 0x69, 0x5E, 0xAF, 0x94, 0x9B
                }))
        {
            If (LEqual (Arg1, One))
            {
                If (LEqual (Arg2, Zero))
                {
                    Store (Buffer (One)
                        {
                             0x03
                        }, Arg4)
                    Return (One)
                }
                If (LEqual (Arg2, One))
                {
                    Return (One)
                }
            }
        }
        Store (Buffer (One)
            {
                 0x00
            }, Arg4)
        Return (Zero)
    }

                Method (_DOS, 1, NotSerialized)
                {
                    Store (And (Arg0, 0x07), DSEN)
                    MCHD ()
                }
                    Method (_BCL, 0, NotSerialized)
                    {
                        Name (BCLD, Package (0x17)
                        {
                            0x64, 
                            Zero, 
                            Zero, 
                            0x05, 
                            0x0A, 
                            0x0F, 
                            0x14, 
                            0x19, 
                            0x1E, 
                            0x23, 
                            0x28, 
                            0x2D, 
                            0x32, 
                            0x37, 
                            0x3C, 
                            0x41, 
                            0x46, 
                            0x4B, 
                            0x50, 
                            0x55, 
                            0x5A, 
                            0x5F, 
                            0x64
                        })
                        Return (BCLD)
                    }
                    Method (_BCM, 1, NotSerialized)
                    {
                        Store (Arg0, Local0)
                        If (CondRefOf (HBCM, Local1))
                        {
                            Store (HBCM (Local0), Local0)
                        }
                        Store (Local0, CUBL)
                        AINT (One, DerefOf (Index (BLTB, Local0)))
                        ECPF (0x0205, DerefOf (Index (BLTB, Local0)), Zero)
                        Notify (HKEY, 0x81)
                    }
                    Method (_BQC, 0, NotSerialized)
                    {
                        Store (BQCD (), Local0)
                        If (CondRefOf (HBQC, Local1))
                        {
                            Store (HBQC (Local0), Local0)
                        }
                        Return (Local0)
                    }

I attach the DSDT.isl. 
Could you advise someone.

 

DSDT_CF-R7D.isl.zip

post-1218950-0-03562200-1390126156_thumb.png

post-1218950-0-76871400-1390126170_thumb.png

post-1218950-0-78497700-1390126576_thumb.png

Link to comment
Share on other sites

  • 1 month later...

Hello,

 

I am trying to fix the brightness in Sony vpceh25en. More than a week has passed and I have haven't succeeded. 

I understand the prerequisite is AppleBacklightDisplay loaded.

 

I can't figure out how to do it. My display is shown as AppleDisplay. It is not detected as a 'built in' display.

 

Going through the ioreg file,

'PEGP' is shown as the PCIDevice which has the graphics card properties.

 

I went through the DSDT and edited the Device section and added DSM method. However even after rebooting with the DSDT, PEGP doesn't load the properties injected.

My Graphics card is Nvidia Geforce 410M.

 

I have fiddled a lot with my DSDT adding and editing various sections.

Nothing seems to work.

 

I am attaching the ioreg and dsdt. I hope someone can help me.

 

The ACPI Backlight kext loads but shows following in log

Feb 25 23:02:13 Sumitis-MacBook-Pro kernel[0]: ACPIBacklightPanel: Found Backlight Device: LCD
Feb 25 23:02:13 Sumitis-MacBook-Pro kernel[0]: ACPIBacklightPanel: ACPI Method _DOS found. Device path: _SB.PCI0.PEG0.DGPU
Feb 25 23:02:13 Sumitis-MacBook-Pro kernel[0]: ACPIBacklightPanel: ACPI Methods _BCL _BCM _BQC found. Device path: _SB.PCI0.PEG0.DGPU.LCD
Feb 25 23:02:13 Sumitis-MacBook-Pro kernel[0]: ACPIBacklightPanel: getIndexForLevel(0) not found in _BCL table !
Feb 25 23:02:13 Sumitis-MacBook-Pro kernel[0]: ACPIBacklightPanel: Version 1.2

The kext loads DGPU. I have tried adding DSM method to the same too. 

 

 

Archive.zip

Link to comment
Share on other sites

Hello,

 

I am trying to fix the brightness in Sony vpceh25en. More than a week has passed and I have haven't succeeded. 

I understand the prerequisite is AppleBacklightDisplay loaded.

 

I can't figure out how to do it. My display is shown as AppleDisplay. It is not detected as a 'built in' display.

 

Going through the ioreg file,

'PEGP' is shown as the PCIDevice which has the graphics card properties.

 

I went through the DSDT and edited the Device section and added DSM method. However even after rebooting with the DSDT, PEGP doesn't load the properties injected.

My Graphics card is Nvidia Geforce 410M.

 

I have fiddled a lot with my DSDT adding and editing various sections.

Nothing seems to work.

 

I am attaching the ioreg and dsdt. I hope someone can help me.

 

The ACPI Backlight kext loads but shows following in log

Feb 25 23:02:13 Sumitis-MacBook-Pro kernel[0]: ACPIBacklightPanel: Found Backlight Device: LCD
Feb 25 23:02:13 Sumitis-MacBook-Pro kernel[0]: ACPIBacklightPanel: ACPI Method _DOS found. Device path: _SB.PCI0.PEG0.DGPU
Feb 25 23:02:13 Sumitis-MacBook-Pro kernel[0]: ACPIBacklightPanel: ACPI Methods _BCL _BCM _BQC found. Device path: _SB.PCI0.PEG0.DGPU.LCD
Feb 25 23:02:13 Sumitis-MacBook-Pro kernel[0]: ACPIBacklightPanel: getIndexForLevel(0) not found in _BCL table !
Feb 25 23:02:13 Sumitis-MacBook-Pro kernel[0]: ACPIBacklightPanel: Version 1.2
The kext loads DGPU. I have tried adding DSM method to the same too.

 

Your _DSM for PEG0.PEGP is coded incorrectly. It shows:

               Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
                {
                    Store (Package (0x60)
                        {
... 6 properties/12 entries ...
                        }, Local0)
                    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                    Return (Local0)
You have 12 entries in the package, yet the package size is set to 96 (0x60).

 

OS X will just ignore the whole _DSM because it is returning a corrupt package.

 

Set the package size to 12 or leave it unspecified so the compiler can calculate it for you.

Link to comment
Share on other sites

Your _DSM for PEG0.PEGP is coded incorrectly. It shows:

               Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
                {
                    Store (Package (0x60)
                        {
... 6 properties/12 entries ...
                        }, Local0)
                    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                    Return (Local0)
You have 12 entries in the package, yet the package size is set to 96 (0x60).

 

OS X will just ignore the whole _DSM because it is returning a corrupt package.

 

Set the package size to 12 or leave it unspecified so the compiler can calculate it for you.

 

You Sir are a legend indeed!

The brightness slider is now visible and it is working! The display shows 'built in' Display.

post-1011795-0-31692900-1393355606_thumb.png

post-1011795-0-50332700-1393355624_thumb.png

Link to comment
Share on other sites

  • 2 weeks later...

hi

 

i'm trying to get working sun bezel animation on my notebook, because brightness regulation work well, anyway i followed your guide and i got:

 

ACPIBacklightPanel: Found Backlight Device: DD03
ACPIBacklightPanel: ACPI Method _DOS found. Device path: _SB.PCI0.GFX0
ACPIBacklightPanel: ACPI Methods _BCL _BCM _BQC found. Device path: _SB.PCI0.GFX0.DD03
ACPIBacklightPanel: Version 1.2

regulation from preference panel, brightness down when dc unplugged and brightness up when plugged in, 10 levels of regulation with fn+f11/f12. but not the animation...why?

 

could you get a look to my dsdt or help me ? thanks :)

 

 

 

 

Schermata 2014-03-05 alle 20.56.23.png

dsdt.aml.zip

Link to comment
Share on other sites

hi

 

i'm trying to get working sun bezel animation on my notebook, because brightness regulation work well, anyway i followed your guide and i got:

 

ACPIBacklightPanel: Found Backlight Device: DD03[/size]

ACPIBacklightPanel: ACPI Method _DOS found. Device path: _SB.PCI0.GFX0[/size]

ACPIBacklightPanel: ACPI Methods _BCL _BCM _BQC found. Device path: _SB.PCI0.GFX0.DD03[/size]

ACPIBacklightPanel: Version 1.2

 

regulation from preference panel, brightness down when dc unplugged and brightness up when plugged in, 10 levels of regulation with fn+f11/f12. but not the animation...why?[/size]

 

could you get a look to my dsdt or help me ? thanks :)

The "sun" only shows when you press the brightness keys (on the keyboard). If you don't have your brightness keys correctly generating the codes for brightness, you'll never see the "sun".

Link to comment
Share on other sites

ehm...how to get this kind of keys?

I assume this is a laptop... It depends on what ps2 drivers you're using (which usually depends on what trackpad you're using).

Link to comment
Share on other sites

so essentially i need to find a proper ps2 kext? or not?

The proper ps2 kext depends on what trackpad you have (you want a ps2 kext that supports your trackpad well).

 

First step, therefore, is to determine the manufacturer of your trackpad.

 

Then you can look at what facilities exist for dealing with the brightness keys. Brightness keycodes are not standardized on PCs (only volume+/volume-/mute). So often, you need to customize the driver to make the brightness keys work. And some brightness keys are handled via ACPI, which requires yet a different technique.

Link to comment
Share on other sites

wow...it seem very complicated

If you're not a programmer with some experience with PCs at the hardware level, yes it is a bit complicated. No one said installing OS X on a laptop would be easy...

 

If you happen to have a Synaptics trackpad, you can use the capabilities in my driver to handle the brightness keys.

Link to comment
Share on other sites

 Share

×
×
  • Create New...