Contribute
Register

[Guide] ASUS ZENBOOK UX305FA using Clover UEFI

Status
Not open for further replies.
No idea what that is all about... Want to clarify?



_BCL table will be scaled by the PNLF patch as needed. No need to customize it really, no matter whether you're using BIOS PWM max or other.

IntelBacklight.kext doesn't use _BCL at all.



No need to patch the framebuffer to match. It is ignored when using either ACPIBacklght.kext or IntelBacklight.kext as each kext/PNLF patch constantly resets the value.


1. I meant before, that Vanilla OS X only reads the _BCL table from acpi... But doesn't control the backlight via _BCM...
Thats why i stroked the text...
I wrote before, that its possible via dsdt code, to get transition working... but i forgot, that i did it long ago, and i used ACPI Backlight to get transition working via DSDT and not via ACPIBacklight itself...
ACPIBacklight calls _BCM/XBCM to change backlight...
I have removed the code, because it was useless...

"No need to patch the framebuffer to match. It is ignored when using either ACPIBacklght.kext or IntelBacklight.kext as each kext/PNLF patch constantly resets the value."
---> PNLF Patch reset the value of Framebuffer... thanks, thats what i wanted to know....

Here is my PNLF Device, that i did for yosemite long ago, with ACPIBacklight compatibility...
Code:
Device (PNLF)        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, EisaId ("APP0002"))  // _HID: Hardware ID
            Name (_CID, "backlight")  // _CID: Compatible ID
            Name (_UID, 0x0F)  // _UID: Unique ID
            Name (_STA, 0x0B)  // _STA: Status
            Name (LMAX, 0x056C)
            Name (SCFT, 0x08)
            Name (BMIN, Zero)
            Name (BMAX, 0x64)
            Name (ACBR, 0x50)
            Name (BATB, 0x3C)
            Name (XOPT, Zero)
            OperationRegion (BRIT, SystemMemory, (^PCI0.IGPU.BAR1 + 0x000C824F), 0x05)
            Field (BRIT, AnyAcc, Lock, Preserve)
            {
                SLBT,   8, 
                XBQC,   16, 
                MAXL,   16
            }


            Method (_INI, 0, NotSerialized)  // _INI: Initialize
            {
                SLBT = 0xC0
                If ((LMAX > 0x0200))
                {
                    MAXL = LMAX /* \_SB_.PNLF.LMAX */
                }
                Else
                {
                    If ((!MAXL || (MAXL < 0x0200)))
                    {
                        MAXL = 0x0AD9
                        LMAX = 0x0AD9
                    }
                    Else
                    {
                        LMAX = MAXL /* \_SB_.PNLF.MAXL */
                    }
                }
            }


            Method (XBCM, 1, NotSerialized)
            {
                Local0 = DerefOf (_BCL () [(BMIN + 0x02)])
                Local1 = DerefOf (_BCL () [(BMAX + 0x02)])
                If ((Arg0 < Local0))
                {
                    Arg0 = Local0
                }


                If ((Arg0 > Local1))
                {
                    Arg0 = Local1
                }


                MAXL = LMAX /* \_SB_.PNLF.LMAX */
                XBQC = Arg0
            }


            Method (_DOS, 1, NotSerialized)  // _DOS: Disable Output Switching
            {
                ^^PCI0.IGPU._DOS (Arg0)
            }


            Method (_BCL, 0, Serialized)  // _BCL: Brightness Control Levels
            {
                Name (PKBC, Package (0x67) {})
                Local0 = (((0x64 * (SCFT + 0x64)) * 0x64) / 
                    MAXL)
                PKBC [Zero] = (((ACBR * (SCFT + ACBR)
                    ) * 0x64) / Local0)
                PKBC [One] = (((BATB * (SCFT + BATB)
                    ) * 0x64) / Local0)
                Local1 = Zero
                While ((Local1 < 0x65))
                {
                    PKBC [(Local1 + 0x02)] = (((Local1 * (
                        SCFT + Local1)) * 0x64) / Local0)
                    Local1++
                }


                PKBC [0x66] = MAXL /* \_SB_.PNLF.MAXL */
                Return (PKBC) /* \_SB_.PNLF._BCL.PKBC */
            }
        }

Since El Capitan, 50% of the code is useless now...
There is only _BCL, _INI and _DOS usefull only...
_BCL is a completely generated version, that reads bios value if you set LMAX = 0... if there is no bios value its going to use 0x0AD9...

With a custom injector:
View attachment CustomBacklight.kext.zip


However, this is my old way of using backlight :)

Cheers :)
 
1. I meant before, that Vanilla OS X only reads the _BCL table from acpi... But doesn't control the backlight via _BCM...

No... Vanilla OS X doesn't use any of the ACPI backlight methods. Not _BCM, not _BCL, not _BQC.

Thats why i stroked the text...
I wrote before, that its possible via dsdt code, to get transition working... but i forgot, that i did it long ago, and i used ACPI Backlight to get transition working via DSDT and not via ACPIBacklight itself...

Smooth transitions with ACPIBacklight.kext are implemented both in the kext and the PNLF patch. It is a partnership.

With IntelBacklight.kext it is all done in the kext, but you still need a PNLF device to cause IntelBacklight.kext to be loaded properly.



Here is my PNLF Device, that i did for yosemite long ago, with ACPIBacklight compatibility...
Code:
Device (PNLF)        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, EisaId ("APP0002"))  // _HID: Hardware ID
            Name (_CID, "backlight")  // _CID: Compatible ID
            Name (_UID, 0x0F)  // _UID: Unique ID
            Name (_STA, 0x0B)  // _STA: Status
            Name (LMAX, 0x056C)
            Name (SCFT, 0x08)
            Name (BMIN, Zero)
            Name (BMAX, 0x64)
            Name (ACBR, 0x50)
            Name (BATB, 0x3C)
            Name (XOPT, Zero)
            OperationRegion (BRIT, SystemMemory, (^PCI0.IGPU.BAR1 + 0x000C824F), 0x05)
            Field (BRIT, AnyAcc, Lock, Preserve)
            {
                SLBT,   8, 
                XBQC,   16, 
                MAXL,   16
            }


            Method (_INI, 0, NotSerialized)  // _INI: Initialize
            {
                SLBT = 0xC0
                If ((LMAX > 0x0200))
                {
                    MAXL = LMAX /* \_SB_.PNLF.LMAX */
                }
                Else
                {
                    If ((!MAXL || (MAXL < 0x0200)))
                    {
                        MAXL = 0x0AD9
                        LMAX = 0x0AD9
                    }
                    Else
                    {
                        LMAX = MAXL /* \_SB_.PNLF.MAXL */
                    }
                }
            }


            Method (XBCM, 1, NotSerialized)
            {
                Local0 = DerefOf (_BCL () [(BMIN + 0x02)])
                Local1 = DerefOf (_BCL () [(BMAX + 0x02)])
                If ((Arg0 < Local0))
                {
                    Arg0 = Local0
                }


                If ((Arg0 > Local1))
                {
                    Arg0 = Local1
                }


                MAXL = LMAX /* \_SB_.PNLF.LMAX */
                XBQC = Arg0
            }


            Method (_DOS, 1, NotSerialized)  // _DOS: Disable Output Switching
            {
                ^^PCI0.IGPU._DOS (Arg0)
            }


            Method (_BCL, 0, Serialized)  // _BCL: Brightness Control Levels
            {
                Name (PKBC, Package (0x67) {})
                Local0 = (((0x64 * (SCFT + 0x64)) * 0x64) / 
                    MAXL)
                PKBC [Zero] = (((ACBR * (SCFT + ACBR)
                    ) * 0x64) / Local0)
                PKBC [One] = (((BATB * (SCFT + BATB)
                    ) * 0x64) / Local0)
                Local1 = Zero
                While ((Local1 < 0x65))
                {
                    PKBC [(Local1 + 0x02)] = (((Local1 * (
                        SCFT + Local1)) * 0x64) / Local0)
                    Local1++
                }


                PKBC [0x66] = MAXL /* \_SB_.PNLF.MAXL */
                Return (PKBC) /* \_SB_.PNLF._BCL.PKBC */
            }
        }

Since El Capitan, 50% of the code is useless now...

All of it is useless (for versions prior to 10.11 as well)...

My patches at my repo can be used instead: https://github.com/RehabMan/Laptop-DSDT-Patch
 
No... Vanilla OS X doesn't use any of the ACPI backlight methods. Not _BCM, not _BCL, not _BQC.



Smooth transitions with ACPIBacklight.kext are implemented both in the kext and the PNLF patch. It is a partnership.

With IntelBacklight.kext it is all done in the kext, but you still need a PNLF device to cause IntelBacklight.kext to be loaded properly.





All of it is useless (for versions prior to 10.11 as well)...

My patches at my repo can be used instead: https://github.com/RehabMan/Laptop-DSDT-Patch

SLBT overwrite to 0xC0 and MAXL is needed in the _INI at least + Calling SLBT overwrite from _WAK is needed if you don't use intelbacklight or acpibacklight...

I have a problem here with intelbacklight, (wrong thread i know...)
I have removed all my code from pnlf and use the default code that you recommend for intelbacklight,
but the problem is,
1. It hangs extremely long on stage 1 (almost 20-30secounds)
2. i have no backlight... Intel backlight is attached to PNLF device but in IGFX/display0 i have only ApplePanel attached, not AppleBacklightPanel...

i looked into config.plist from intelbacklight, but there is no 0a2e8086 in the Matches section, only a 0a1e8086 entry...

Typo? didn't seen any 0a1e devices...

The debug version haven't much debug too, i see only this:
Code:
Oct 19 23:09:22 localhost kernel[0]: IntelBacklight: IntelBacklightPanel::probe()Oct 19 23:09:22 localhost kernel[0]: IntelBacklight: IntelBacklightPanel::start()
Oct 19 23:09:22 localhost kernel[0]: IntelBacklight: Version 1.0.0d1 starting on OS X Darwin 15.0.
Oct 19 23:09:22 localhost kernel[0]: IntelBacklight: no /chosen/nvram, trying IODTNVRAM
Oct 19 23:09:22 localhost kernel[0]: IntelBacklight: no intel-backlight-level in nvram
Oct 19 23:09:22 localhost kernel[0]: IntelBacklight: loadFromNVRAM returns -1
Oct 19 23:09:22 localhost kernel[0]: IntelBacklight: Waiting for BacklightHandler

Cheers :)


EDIT:
Yep, 0a1e8086 to 0a2e8086 fixed that bug above...
was just a typo in your kext...

Cheers :)
 
SLBT overwrite to 0xC0 and MAXL is needed in the _INI at least + Calling SLBT overwrite from _WAK is needed if you don't use intelbacklight or acpibacklight...

We are off-topic here. But no idea what you're talking about here...

My patches are for using IntelBacklight.kext and ACPIBacklight.kext. Using native AppleBacklight.kext is possible, but requires a custom AppleBacklightInjector.kext.

I have a problem here with intelbacklight, (wrong thread i know...)
I have removed all my code from pnlf and use the default code that you recommend for intelbacklight,
but the problem is,
1. It hangs extremely long on stage 1 (almost 20-30secounds)
2. i have no backlight... Intel backlight is attached to PNLF device but in IGFX/display0 i have only ApplePanel attached, not AppleBacklightPanel...

i looked into config.plist from intelbacklight, but there is no 0a2e8086 in the Matches section, only a 0a1e8086 entry...

Typo? didn't seen any 0a1e devices...

I think you mean Info.plist, not config.plist. The IDs in the Info.plist came from work on FakePCIID. 0xa2e8086 is not there. I can certainly add it. If that is your native device-id, it will not work without (and yes, you'll get a long pause at startup, as IOKit times out).
 
We are off-topic here. But no idea what you're talking about here...

My patches are for using IntelBacklight.kext and ACPIBacklight.kext. Using native AppleBacklight.kext is possible, but requires a custom AppleBacklightInjector.kext.



I think you mean Info.plist, not config.plist. The IDs in the Info.plist came from work on FakePCIID. 0xa2e8086 is not there. I can certainly add it. If that is your native device-id, it will not work without (and yes, you'll get a long pause at startup, as IOKit times out).
Exactly, i meant info.plist....
By the way, if i set "PWMMax", 0, (i get inverted PWM)
But doesn't matter, i set it anyway to 0x56c and its working perfect...

Cheers :)
 
Exactly, i meant info.plist....
By the way, if i set "PWMMax", 0, (i get inverted PWM)

No idea what you mean by "inverted PWM"...

Using PWMMax=0 will use BIOS PWM range. I use it on all my laptops (4530s, 4540s, u430).
 
No idea what you mean by "inverted PWM"...

Using PWMMax=0 will use BIOS PWM range. I use it on all my laptops (4530s, 4540s, u430).

Its really off topic now, but i found out... if i compile the latest sources (1.0.1), the kext Inverts PWM...
What i mean is, if you increase the brightness, you get brightness decreased^^ if you decrease, its gonna be increased...

You can PM me if you want, i have no rights here for PM...
Cheers :)
 
Its really off topic now, but i found out... if i compile the latest sources (1.0.1), the kext Inverts PWM...
What i mean is, if you increase the brightness, you get brightness decreased^^ if you decrease, its gonna be increased...

You can PM me if you want, i have no rights here for PM...
Cheers :)

You should open a separate thread. You have something strange with your system.

The kext is working here on 3 different computers, all different graphics architecture: HD3000, HD4000, and HD4400.
 
FastLanePackages have all patches applied. As noted in guide.

jhawk

Is there a guide on how to patch using FastLanePackages? The previous link RehabMan gave me leads to other patches, but they are specific files to download.
 
Is there a guide on how to patch using FastLanePackages? The previous link RehabMan gave me leads to other patches, but they are specific files to download.

I'm not sure what you want here. The FastLanePackages are all ready patched. If you are looking for instructions to build your own. Take a look at Install Guide PDF 'Slow Lane' contains all instructions for patching your own build. FYI some updated patches for kexts AssusNBFnkey and AppleSmartTouchPad can be downloaded from OSXLatitude.

jhawk
 
Status
Not open for further replies.
Back
Top