Contribute
Register

Full range of brightness using ACPIBacklight

Status
Not open for further replies.
I was wondering if this would somehow be applicable to nVidia graphics... MCP79 chipset graphics, particularly ? Has anyone had success in achieving full range of brightness control using ACPI backlight or native backlight kext (w/ direct access to registers) on an nVidia based (non-optimus) laptops?

Many optimus machines use the Intel backlight controls (perhaps even if you have an option to turn optimus off).

Some machines have working backlight methods in DSDT. Some with up to 100 levels (for Win8), which is rather helpful for smooth transitions/etc...

Also, if you can figure out what hardware locations are used for backlight control, a similar patch could be written for such hardware.
 
Many optimus machines use the Intel backlight controls (perhaps even if you have an option to turn optimus off).

Some machines have working backlight methods in DSDT. Some with up to 100 levels (for Win8), which is rather helpful for smooth transitions/etc...

Also, if you can figure out what hardware locations are used for backlight control, a similar patch could be written for such hardware.
Would you happen to know anything about the original quote from the author?
Added an optional DSDT optimization : you can add a method SAVE with same parameters than _BCM and on the same device in order to split the DSDT code that set the backlight value in the PWM control register (usually located in EC) and the DSDT code that save the value in CMOS (usually in the RTC second bank of RAM : OperationRegion (xxxx, SystemIO, 0x72, 0x02) but triggered by a SMI interrupt to ensure CMOS checksum computation)

I'm seeing CMOS corruption with every brightness adjustment using your newest version of ACPIBacklight. The LCD device has the following control methods:
Code:
                        Method (_BCL, 0, NotSerialized)
                        {
                            Return (Package (0x10)
                            {
                                Zero, 
                                One, 
                                0x02, 
                                0x03, 
                                0x04, 
                                0x05, 
                                0x06, 
                                0x07, 
                                0x08, 
                                0x09, 
                                0x0A, 
                                0x0B, 
                                0x0C, 
                                0x0D, 
                                0x0E, 
                                0x0F
                            })
                        }

                        Method (_BCM, 1, NotSerialized)
                        {
                            Store (Arg0, LBTN)
                            ^^^^LPCB.EC0.STBR ()
                        }

                        Method (_BQC, 0, NotSerialized)
                        {
                            Return (GNVS (0x4498))
                        }
Here LBTN is the aforementioned CMOS register that is being written and produces CRC computation issues which upon reset causes CMOS corruption. STBR (set brightness) method on the other hand writes the value to EC register matching it with a value from a name field against the value stored in CMOS:
Code:
                       Method (STBR, 0, Serialized)
                        {
                            Sleep (0x32)
                            Store (DerefOf (Index (PWAC, LBTN)), Local0)
                            ECBR (Local0)
                        }

                        Name (PWAC, Buffer (0x10)
                        {
                            /* 0000 */    0x02, 0x07, 0x0B, 0x10, 0x15, 0x19, 0x1E, 0x22, 
                            /* 0008 */    0x27, 0x2C, 0x32, 0x39, 0x41, 0x4A, 0x54, 0x5F
                        })

Where ECBR (EC brightness) is the method that directly addressed EC register:
Code:
                    Method (ECBR, 1, Serialized)
                    {
                        If (ECAV ()) // if EC is available, as in, laptop is powered on
                        {
                            If (LNot (Acquire (MUEC, 0xFFFF)))
                            {
                                Store (Arg0, SC00) // EC memory space offset 0x61 stores the level
                                Release (MUEC)
                            }
                        }
                    }

Registers are the following:
Code:
                    OperationRegion (ECOR, EmbeddedControl, Zero, 0x0100)
                    Field (ECOR, ByteAcc, Lock, Preserve)
                    {
                                Offset (0x61), 
                        SC00,   8, 
                        SC01,   8, 
                        SC02,   8, 
                        SC03,   8, 
                        SC04,   8, 
                        SC05,   8, 
                        SC06,   8
                    }

and

        OperationRegion (ECMS, SystemIO, 0x72, 0x02)
        Field (ECMS, ByteAcc, Lock, Preserve)
        {
            EIND,   8, 
            EDAT,   8
        }

        IndexField (EIND, EDAT, ByteAcc, NoLock, Preserve)
        {
                    Offset (0x93), 
            LBTN,   4
        }
The LBTN register is also addressed in EC queries:
Code:
                        Method (_Q0B, 0, NotSerialized)
                        {
                            Notify (PS2K, 0x0205)
                            Notify (PS2K, 0x0285)

                            Store (LBTN, Local0)
                            If (LGreater (Local0, Zero))
                            {
                                Decrement (Local0)
                            }

                            If (LGreater (Local0, 0x0E))
                            {
                                Store (0x0E, Local0)
                            }

                            Store (Local0, LBTN)
                            STBR ()
                        }

                        Method (_Q0D, 0, NotSerialized)
                        {
                            Notify (PS2K, 0x0206)
                            Notify (PS2K, 0x0286)

                            Store (LBTN, Local0)
                            If (LLess (Local0, 0x0F))
                            {
                                Increment (Local0)
                            }
                            Else
                            {
                                Store (0x0F, Local0)
                            }

                            Store (Local0, LBTN)
                            STBR ()
                        }

I can't quite grasp the concept of separating EC and CMOS access using the SAVE method on PNLF?
 
I seem to have found the remark from the author ..
Same way original _BQC uses GNVS to read CMOS value, the value should be stored into CMOS using SNVS, instead of direct access to LBTN register. Seems to be working flawlessly so far with no CMOS CRC corruption and brightness is being preserved across reboots at BIOS level.

The tip is to use SNVS (0x4498, newValue) to store to CMOS the brightness level instead of writing directly into LBTN.
 
I seem to have found the remark from the author ..
Same way original _BQC uses GNVS to read CMOS value, the value should be stored into CMOS using SNVS, instead of direct access to LBTN register. Seems to be working flawlessly so far with no CMOS CRC corruption and brightness is being preserved across reboots at BIOS level.

I pretty much ignored that feature. I'd rather have OS X remember the brightness level. But you can use it to save the brightness level for that period during boot, provided you can figure out where/how to store it.
 
Hello RehabMan,

I have DELL XPS 14 laptop. I don't know if I can use your ACPIBakclight kext with that. Previously I used genericBrightness but it does too much KP. Then I found your kext, but after installation and reboot the kext is not loaded.

I hope you can help me about that. I attached my HW info + edited dsdt in zip.
 

Attachments

  • HWInfo.zip
    29.5 KB · Views: 86
Hello RehabMan,

I have DELL XPS 14 laptop. I don't know if I can use your ACPIBakclight kext with that. Previously I used genericBrightness but it does too much KP. Then I found your kext, but after installation and reboot the kext is not loaded.

I hope you can help me about that. I attached my HW info + edited dsdt in zip.

According to kextstat.txt, you did not install the kext.

HD3000/HD4000 Brightness Fix:
DSDT Patches from here: https://github.com/RehabMan/Laptop-DSDT-Patch

Apply:
"Rename GFX0 to IGPU"
"Brightness Fix (HD3000/HD4000)"
- rename patch must be done first and to all DSDT/SSDT that contain references to GFX0 that you're including in your final SSDT set
- Brightness patch must be done to the DSDT or SSDT that contains the definition for Device GFX0 (search for 'Device (GFX0)'
- Place DSDT and SSDT (if necessary) into a place where the bootloader will load them. For Clover, EFI/CLOVER/ACPI/patched (DSDT.aml, SSDT-x.aml where 'x' is a number). For Chameleon, /Extra/ssdt.aml, /Exra/ssdt-1.aml, /Extra/ssdt-2.aml, etc.

Install: https://github.com/RehabMan/OS-X-ACPI-Backlight
 
According to kextstat.txt, you did not install the kext.

HD3000/HD4000 Brightness Fix:
DSDT Patches from here: https://github.com/RehabMan/Laptop-DSDT-Patch

Apply:
"Rename GFX0 to IGPU"
"Brightness Fix (HD3000/HD4000)"
- rename patch must be done first and to all DSDT/SSDT that contain references to GFX0 that you're including in your final SSDT set
- Brightness patch must be done to the DSDT or SSDT that contains the definition for Device GFX0 (search for 'Device (GFX0)'
- Place DSDT and SSDT (if necessary) into a place where the bootloader will load them. For Clover, EFI/CLOVER/ACPI/patched (DSDT.aml, SSDT-x.aml where 'x' is a number). For Chameleon, /Extra/ssdt.aml, /Exra/ssdt-1.aml, /Extra/ssdt-2.aml, etc.

Install: https://github.com/RehabMan/OS-X-ACPI-Backlight

Hi,


Thanks your reply. I guess I used wrong DSDT brightness patch that was the reason why didn't loaded the ACPIBacklight.kext.

After I did the things you wrote me the kext was loaded.But now the brightness slider does not change the brightness.

I was wondering if you can give me some hint how can I fix it?
I attached the actual state of my HW info + DSDT + SSDTs + CLOVER config.

View attachment HWInfo.zip
 
Hi,


Thanks your reply. I guess I used wrong DSDT brightness patch that was the reason why didn't loaded the ACPIBacklight.kext.

After I did the things you wrote me the kext was loaded.But now the brightness slider does not change the brightness.

I was wondering if you can give me some hint how can I fix it?
I attached the actual state of my HW info + DSDT + SSDTs + CLOVER config.

View attachment 105578

Post ioreg: http://www.tonymacx86.com/audio/58368-guide-how-make-copy-ioreg.html
 
Status
Not open for further replies.
Back
Top