Jump to content

please help me fix Brightness Control Nvidia Graphics Only Laptop


onejay09
 Share

199 posts in this topic

Recommended Posts

That's not good:

post-1506069-0-71623100-1515944072_thumb.png

Probably, Device Specific properties are not injected correctly. Try to apply patches directly to DSDT. Copy origin folder to desktop. Then download latest iasl from here: https://github.com/acpica/acpica/archive/master.zip

Open terminal and write:

cd ~/Downloads/acpica-master/
make
cd ~/Desktop/origin
rm SSDT-*x*.aml
iasl -da -dl DSDT.aml SSDT-*.aml

Open DSDT.dsl and fix errors (if you have problems, ask here). Then search for dGPU:

grep -l \_SB.PCI0.PEG0.PEGP *.dsl

Add this code to an existing dGPU _DSM Method or create a _DSM Method into DSDT:

Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
{
    If (LEqual (Arg2, Zero))
    {
        Return (Buffer (One)
        {
            0x037
        })
    }
    Return (Package (0x04)
    {
        "@1,built-in", 
        Buffer (Zero) {}, 
        "hda-gfx", 
        Buffer (0x0A)
        {
            "onboard-1"
        }
    })
} 

You can rename PEGP to GFX0 from config.plist (as you already do) or you can apply directly the rename to Acpi tables that have it (you can see a list from the grep -l command above).

Then, you should add those DSDT + SSDTs to patched folder. From what i can see, you have brightness methods in SSDT-15, so you have a good chance to enable a full working brightness slider.

  • Like 1
Link to comment
Share on other sites

You should avoid injecting "cosmetic properties" from _DSM Methods

device_type=NVDA,Parent should appear in ioreg without any injections.

ACPIBacklight.kext doesn't work on High Sierra. Real macs with Nvidia cards use AppleBackight.kext.

Finally, you have a PS2 keyboard, so try to remap brightness hotkeys from DSDT (you need to patch _Qxx Methods depending on your hardware).

Do you have brightness slider without ACPIBacklight.kext?

 

PS.

Where did you find the code in the patched DSDT about the dGPU?

Thanks for your help!

 

I just add the DSDT _Q11 and _Q12 brightness remapping according the guide.

Even I have Brightness slider enabled and the Keyboard is working, I still not having luck with brightness at all, maybe @onejay09 could share the ASUSACPIBACKLIGHT Kext and I will give it a try.

 

Thanks!

Link to comment
Share on other sites

My backlight is semi working with asusacpibacklight.kext, And brightness slider from berg designs, but the brightness slider doesn’t work in settings.

My fn keys don’t work never managed to get them working I think my keyboard isn’t ps2?

I'm under the same situation:

I have installed ASUSACPIBACKLIGHT.KEXT and now I have Brightness working with Brightness Slider from Berg Designs (Looks like inverted, to the top the brightness is the lowest, to bottom is the maximum brightness), but even that my Brightness Keys are working, they do not response at all, nor does the System Brightness Slider, only with the one from Berg Designs.

 

What can we do to?

Thanks for your help!!!

Link to comment
Share on other sites

Brightness fn keys don't work with brightness by bergdesign. To enable a working slider you need to use AppleBacklight.kext and the right PNLF patch. If i remember correctly, you are using the ACPI 100 patch. Remove previous attempts and start with the basic patch. Into DSDT:

Scope (_SB)
{
    Device (PNLF)
    {
        Name (_ADR, Zero)  // _ADR: Address
        Name (_HID, EisaId ("APP0002"))  // _HID: Hardware ID
        Name (_CID, "backlight")  // _CID: Compatible ID
        Name (_UID, 0x0A)  // _UID: Unique ID
        Name (_STA, 0x0B)  // _STA: Status
    }
}

Then you can try this one (from iMac14,2):

Scope (_SB)
{
    Device (PNLF)
    {
        Name (_ADR, 0x00)  // _ADR: Address
        Name (_HID, EisaId ("APP0002"))  // _HID: Hardware ID
        Name (_CID, "backlight")  // _CID: Compatible ID
        Name (_UID, 0x0A)  // _UID: Unique ID
        Name (_STA, 0x0B)  // _STA: Status
        Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
        {
            If (LEqual (Arg2, Zero))
            {
                Return (Buffer (One)
                {
                    0x03                                           
                })
            }

            Return (Package (0x04)
            {
                "refnum", 
                0x00, 
                "type", 
                0x4d434353
            })
        }
    }
}
  • Like 2
Link to comment
Share on other sites

 

Brightness fn keys don't work with brightness by bergdesign. To enable a working slider you need to use AppleBacklight.kext and the right PNLF patch. If i remember correctly, you are using the ACPI 100 patch. Remove previous attempts and start with the basic patch. Into DSDT:

Scope (_SB)
{
    Device (PNLF)
    {
        Name (_ADR, Zero)  // _ADR: Address
        Name (_HID, EisaId ("APP0002"))  // _HID: Hardware ID
        Name (_CID, "backlight")  // _CID: Compatible ID
        Name (_UID, 0x0A)  // _UID: Unique ID
        Name (_STA, 0x0B)  // _STA: Status
    }
}

Then you can try this one (from iMac14,2):

Scope (_SB)
{
    Device (PNLF)
    {
        Name (_ADR, 0x00)  // _ADR: Address
        Name (_HID, EisaId ("APP0002"))  // _HID: Hardware ID
        Name (_CID, "backlight")  // _CID: Compatible ID
        Name (_UID, 0x0A)  // _UID: Unique ID
        Name (_STA, 0x0B)  // _STA: Status
        Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
        {
            If (LEqual (Arg2, Zero))
            {
                Return (Buffer (One)
                {
                    0x03                                           
                })
            }

            Return (Package (0x04)
            {
                "refnum", 
                0x00, 
                "type", 
                0x4d434353
            })
        }
    }
}

Thanks for your time!

I've tried, and I get a Black Screen...

I'm with AsusACPIBackLight by now, Any Idea how to "connect" bergdesign to the sliderto the slider by DSDT or something?

Thanks!

Link to comment
Share on other sites

Nope, they are a separate thing. You can remap fn keys with Karabiner Elements, but it won't be the same as with AppleBacklight.kext

By default, fn keys move only the slider in System Preferences which is related to AppleBacklight for Intel or Nvidia or AppleMCCSControl (still not sure) for AMD.

  • Like 1
Link to comment
Share on other sites

I have another issue, my hackintosh is 99% complete, the only problem I have now is that the computer shutdown when I press Sleep, I do not know that the problem can be...

I think this is Off Topic. Open a topic in DSDT -> Laptops.

In config.plist (post #42) you are dropping OEM SSDTs, but in in patched folder you don't have them. IMHO, you should avoid DropOEM=true unless it's strictly necessary.

Link to comment
Share on other sites

i would like to thank you too @foskvs, your help is much appreciated!

 

though i gave up and settled for the alternative asusacpibacklight for now.

Scope (_SB)
{
    Device (PNLF)
    {
        Name (_ADR, 0x00)  // _ADR: Address
        Name (_HID, EisaId ("APP0002"))  // _HID: Hardware ID
        Name (_CID, "backlight")  // _CID: Compatible ID
        Name (_UID, 0x0A)  // _UID: Unique ID
        Name (_STA, 0x0B)  // _STA: Status
        Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
        {
            If (LEqual (Arg2, Zero))
            {
                Return (Buffer (One)
                {
                    0x03                                           
                })
            }

            Return (Package (0x04)
            {
                "refnum", 
                0x00, 
                "type", 
                0x4d434353
            })
        }
    }
}

what is special about this pnlf what does 0x4d434353 do?

 

i would like to know more about the nvidia setup on real macs and maybe you could share acpi Files and an ioreg from the real mac please?

Link to comment
Share on other sites

what is special about this pnlf what does 0x4d434353 do?

I'm not completely sure (i have to check it on my hack), but it loads AGDCBacklightControl.kext

 

i would like to know more about the nvidia setup on real macs and maybe you could share acpi Files and an ioreg from the real mac please?

 

Here you can find Darwin Dumps (Acpi, ioregs, ...) from most of the Macs -> https://applelife.ru/threads/darwindumper-dampy-nastojaschix-macov.39174/

You can find other dumps on Github.

 

Basically, there are 3 kinds of Nvidia Macs:

1) iMac: IGPU enabled without displays and dGPU (GFX0) set as onboard-1 (example: iMac14,2)

2) MacBookPro with DG: IGPU enabled with one port (internal display, connector-type 02000000) and onboard-1. dGPU (GFX0) onboard-2 and connector type for internal display set as 02040000 and ports for external displays (example: MacBookPro11,3)

3) MacBookPro with dual Nvidia: IGPU (low-performance Nvidia) with two displays and GFX0 (high-performance Nvidia) with two displays (example: MacBookPro5,3)

 

All three use AppleBacklight.kext and IMHO we should focus on iMacs as they are more similar to non-Apple laptops (and, of course, desktops).

  • Like 1
Link to comment
Share on other sites

My backlight is semi working with asusacpibacklight.kext, And brightness slider from berg designs, but the brightness slider doesn’t work in settings.

My fn keys don’t work never managed to get them working I think my keyboard isn’t ps2?

Hi,

 

According to the OP you attempted this on macOS Sierra.  Will this work on macOS High Sierra?  What I've done:

  • Installed AsusACPIBackLightPanel to EFI/CLOVER/KEXTS/Other.  Can confirm it is loading via kextstat.
  • Tried different combinations of the _DSM / PNLF patches from this thread.  Also tried the PNLF patch from the AsusACPIBackLightPanel thread, modified as best as possible to meet my system.  Without these modifications the DSDT would not compile.
  • Tried PikerAlpha's patch of AppleGraphicsDevicePolicy, as well as manually adding my board-id.  The latter was successful in bypassing the black screen.

The farthest I got was getting the display recognized as Internal.  There was no native brightness slider, and the one by Berg Design was unresponsive.

 

Specs:

  • ASUS FX502VM-AH51
  • Intel Core i5-6300HQ
  • NVIDIA GeForce GTX 1060 3GB
  • macOS High Sierra 10.13.3

IOReg and untouched DSDT.dsl (compiled with iasl -da -dl) attached.

 

Thanks!

Lacedaemon's HacBook Pro.zip

  • Like 1
Link to comment
Share on other sites

yes it works on hight sierra on running 10.13.3, ill take a look at your dsdt


Hi,

 

According to the OP you attempted this on macOS Sierra.  Will this work on macOS High Sierra?  What I've done:

  • Installed AsusACPIBackLightPanel to EFI/CLOVER/KEXTS/Other.  Can confirm it is loading via kextstat.
  • Tried different combinations of the _DSM / PNLF patches from this thread.  Also tried the PNLF patch from the AsusACPIBackLightPanel thread, modified as best as possible to meet my system.  Without these modifications the DSDT would not compile.
  • Tried PikerAlpha's patch of AppleGraphicsDevicePolicy, as well as manually adding my board-id.  The latter was successful in bypassing the black screen.

The farthest I got was getting the display recognized as Internal.  There was no native brightness slider, and the one by Berg Design was unresponsive.

 

Specs:

  • ASUS FX502VM-AH51
  • Intel Core i5-6300HQ
  • NVIDIA GeForce GTX 1060 3GB
  • macOS High Sierra 10.13.3

IOReg and untouched DSDT.dsl (compiled with iasl -da -dl) attached.

 

Thanks!

 

 

 

decompile with refs.txt first then copy the changes i made


here is your dsdt, note you will need lilu.kext and nvidiagraphicsfixup.kext


            Device (PEG0)
            {
                Name (_ADR, 0x00010000)  // _ADR: Address
                Method (_PRT, 0, NotSerialized)  // _PRT: PCI Routing Table
                {
                    Store (One, ^GFX0.HDAE)                    
                    If (PICM)
                    {
                        Return (AR01)
                    }

                    Return (PR01)
                }
            }

theis first one enables your hdmi audio pci slot but you may need toleda's clover hdmi ssdt also, nvidiagraphicsfixup.kext

 

also your HDAU device is named NVAF in dsdt maybe rename nvaf to HDAU before adding toledas ssdt

    Scope (_SB.PCI0.PEG0)
    {
        Device (GFX0)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Method (_PRW, 0, NotSerialized)  // _PRW: Power Resources for Wake
            {
                Return (GPRW (0x09, 0x04))
            }

            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If (LEqual (Arg2, Zero))
                {
                    Return (Buffer (One)
                    {
                         0x03                                           
                    })
                }

                Return (Package (0x18)
                {
                    "@0,connector-type", 
                    Buffer (0x04)
                    {
                         0x02, 0x00, 0x00, 0x00                         
                    }, 

                    "@0,AAPL,boot-display", 
                    Buffer (0x04)
                    {
                         0x01, 0x00, 0x00, 0x00                         
                    }, 

                    "@0,built-in", 
                    Buffer (Zero) {}, 
                    "@0,display-connect-flags", 
                    Buffer (0x04)
                    {
                         0x04, 0x00, 0x00, 0x00                         
                    }, 

                    "@0,use-backlight-blanking", 
                    Buffer (0x04) {}, 
                    "AAPL,backlight-control", 
                    Buffer (0x04)
                    {
                         0x01, 0x00, 0x00, 0x00                         
                    }, 

                    "@0,backlight-control", 
                    Buffer (0x04)
                    {
                         0x01, 0x00, 0x00, 0x00                         
                    }, 

                    "@0,display-type", 
                    "LCD", 
                    "@1,connector-type", 
                    Buffer (0x04)
                    {
                         0x00, 0x08, 0x00, 0x00                         
                    }, 

                    "@2,connector-type", 
                    Buffer (0x04)
                    {
                         0x00, 0x08, 0x00, 0x00                         
                    }, 

                    "@3,connector-type", 
                    Buffer (0x04)
                    {
                         0x00, 0x08, 0x00, 0x00                         
                    }, 

                    "hda-gfx", 
                    Buffer (0x0A)
                    {
                        "onboard-1"
                    }
                })
            }

for this you have to rename original dsm method to xdsm

    Scope (_SB)
    {
        Device (PNLF)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, EisaId ("APP0002"))  // _HID: Hardware ID
            Name (_CID, "backlight")  // _CID: Compatible ID
            Name (_UID, 0x0E)  // _UID: Unique ID
            Name (_STA, 0x0B)  // _STA: Status
            Method (_BCL, 0, NotSerialized)  // _BCL: Brightness Control Levels
            {
                Return (^^PCI0.PEG0.GFX0.EDPD._BCL ())
            }

            Method (_BCM, 1, NotSerialized)  // _BCM: Brightness Control Method
            {
                Store (^^PCI0.PEG0.GFX0.GCBL (Arg0), Local0)
                Subtract (0x0A, Local0, LBTN)
                ^^PCI0.LPCB.EC0.STBR ()
            }

            Method (_BQC, 0, NotSerialized)  // _BQC: Brightness Query Current
            {
                Return (LBTN)
            }

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

DSDT.dsl.zip

  • Like 2
Link to comment
Share on other sites

Thanks for the DSDT!

 

note you will need lilu.kext and nvidiagraphicsfixup.kext

 

I've tried NvidiaGraphicsFixup on this laptop before, and it would hang at boot, no loading bar at all.  Here's the output of my kextstat:

Index Refs Address            Size       Wired      Name (Version) UUID <Linked Against>
   38    1 0xffffff7f83af2000 0x19000    0x19000    as.vit9696.Lilu (1.2.1) 556769C6-DA78-33EB-977F-C39420638467 <7 5 4 3 2 1>
   39    0 0xffffff7f83b0b000 0x11000    0x11000    org.netkas.driver.FakeSMC (1759) 987B8DEE-6600-3463-BFFA-DF500771FA5B <11 7 5 4 3 1>
   40    0 0xffffff7f83b1c000 0xbe000    0xbe000    as.vit9696.AppleALC (1.2.1) 8F814EF4-A74D-3289-BB62-FCD1016E5AE9 <38 7 5 4 3 2 1>
   41    0 0xffffff7f83bda000 0x9000     0x9000     org.rehabman.driver.AppleSmartBatteryManager (1.60.5) 75A24811-F4EB-3665-AD7F-E46DF06E538C <11 4 3>
   53    1 0xffffff7f83be6000 0xa000     0xa000     org.emlydinesh.driver.ApplePS2Controller (4.6.8) 34755F6A-A94B-3B41-B7F9-E7E533789C8D <11 7 5 4 3 1>
   55    0 0xffffff7f83bf0000 0x9000     0x9000     org.emlydinesh.driver.AsusNBFnKeys (2.6) 069C27E9-EE6D-395D-BE98-1364C275EFBC <54 18 11 7 6 5 4 3 1>
   58    0 0xffffff7f83bfe000 0x3000     0x3000     org.emlydinesh.driver.AsusACPIBackLightPanel (1.7) 36FC05E4-BBD4-3410-AB86-56DCEB2E927C <57 11 7 4 3 1>
   64    0 0xffffff7f83c03000 0x1a000    0x1a000    com.alexandred.VoodooI2C (1.0.4) ACE1CACC-56CC-3CAE-859B-9A16C2E0D4C4 <54 12 11 5 4 3>
   67    0 0xffffff7f83c26000 0xd000     0xd000     org.emlydinesh.driver.ApplePS2Keyboard (4.6.8) 8628ADB8-A873-3841-B155-70BFE0785990 <54 53 18 7 6 5 4 3 1>
   69    0 0xffffff7f83c53000 0x3a000    0x3a000    com.insanelymac.RealtekRTL8111 (2.0.0) 54A33BAE-C115-361F-A956-7FFE91E04329 <16 12 5 4 3 1>
   75    0 0xffffff7f83c8f000 0x7000     0x7000     org.rehabman.driver.FakePCIID (1.3.7) 3ED2499F-AFCB-3D10-A7CA-3D3295B8A78D <12 7 5 4 3 1>
   89    1 0xffffff7f83c96000 0x25a000   0x25a000   com.no-one.BrcmFirmwareStore (2.2.7) 160DD596-DFC2-35BD-B0F9-28D95F0B8190 <5 4 3>
   90    0 0xffffff7f83ef0000 0x6000     0x6000     com.no-one.BrcmPatchRAM2 (2.2.7) 76FC3024-9FF8-3607-A616-DF7C550751CB <89 27 5 4 3 1>
  107    0 0xffffff7f81901000 0x4000     0x4000     com.intel.driver.EnergyDriver (2.0) 4E0262A2-B79C-3386-8824-C106A5DFAF94 <7 5 4 3>
  116    2 0xffffff7f80dfa000 0x62e000   0x62e000   com.nvidia.web.NVDAResmanWeb (10.2.9) 97A4893A-52D0-37FA-B640-08744AE78F38 <110 108 57 12 7 5 4 3 1>
  117    0 0xffffff7f8143c000 0x198000   0x198000   com.nvidia.web.NVDAGP100HalWeb (10.2.9) DD0C2BBD-3256-3D2D-B131-B9663E11ABFB <116 12 4 3>
  120    0 0xffffff7f81800000 0xa6000    0xa6000    com.nvidia.web.GeForceWeb (10.2.9) EBED009A-BA34-3020-A78C-81C64F53E7F4 <119 116 110 57 12 7 5 4 3 1>

Am I missing any requirements?

 

I'll decompile w/ refs.txt (the suggested one in RehabMan's guide on TMX86), add your changes, and report back.  Thanks again!

Link to comment
Share on other sites

Good news!  After switching to AptioMemoryFix, getting NvidiaGraphicsFixup to work, and adding your patches, the display brightness is no longer stuck at full blast!  I can also (sort of) control it with Brightness by Berg Design, just as you said.

 

However, now the display seems to be stuck at or near the lowest possible brightness, with the Brightness by Berg Design only slightly affecting the screen brightness.  Setting different BrightnessAtBoot values in the kext doesn't seem to help.

 

Any ideas?  How do you effectively change the brightness?

 

Thanks for helping get this working!

  • Like 1
Link to comment
Share on other sites

Good news!  After switching to AptioMemoryFix, getting NvidiaGraphicsFixup to work, and adding your patches, the display brightness is no longer stuck at full blast!  I can also (sort of) control it with Brightness by Berg Design, just as you said.

 

However, now the display seems to be stuck at or near the lowest possible brightness, with the Brightness by Berg Design only slightly affecting the screen brightness.  Setting different BrightnessAtBoot values in the kext doesn't seem to help.

 

Any ideas?  How do you effectively change the brightness?

 

Thanks for helping get this working!

you need osi to xosi patch in clover.plist and SSDT-XOSI.aml in acpi/patched and add SSDT-XOSI.aml to sorted order in clover config.plist

also remove old windows patches for osi darwin

  • Like 1
Link to comment
Share on other sites

you need osi to xosi patch in clover.plist and SSDT-XOSI.aml in acpi/patched and add SSDT-XOSI.aml to sorted order in clover config.plist

also remove old windows patches for osi darwin

I see what that patch is trying to do, however I already have an _OSI patch applied:

Method (_INI, 0, Serialized)  // _INI: Initialize
        {
            Store (0x07D0, OSYS)
            If (CondRefOf (\_OSI, Local0))
            {
                If (_OSI ("Linux"))
                {
                    Store (0x03E8, OSYS)
                }

                If (_OSI ("Windows 2001"))
                {
                    Store (0x07D1, OSYS)
                }

                If (_OSI ("Windows 2001 SP1"))
                {
                    Store (0x07D1, OSYS)
                }

                If (_OSI ("Windows 2001 SP2"))
                {
                    Store (0x07D2, OSYS)
                }

                If (_OSI ("Windows 2001.1"))
                {
                    Store (0x07D3, OSYS)
                }

                If (_OSI ("Windows 2006"))
                {
                    Store (0x07D6, OSYS)
                }

                If (_OSI ("Windows 2009"))
                {
                    Store (0x07D9, OSYS)
                }

                If(_OSI("Windows 2012"))
                {
                    Store (0x07DC, OSYS)
                }

                If (_OSI ("Windows 2013"))
                {
                    Store (0x07DD, OSYS)
                }

                If(LOr(_OSI("Darwin"),_OSI("Windows 2015")))
                {
                    Store (0x07DF, OSYS)
                }
            }

            If (CondRefOf (\_PR.DTSE))
            {
                If (LGreaterEqual (\_PR.DTSE, One))
                {
                    Store (One, \_PR.DSAE)
                }
            }
        }

What would that XOSI do fundamentally different than the above?

Link to comment
Share on other sites

you wanted to know how to fix the backlight, remove the osi patch and use xosi.

 

Prior to windows 8 the backlight methods are different, you'll have full backlight control

 

Don't worry about audio and trackpad and other stuff relying on osi as xosi fixes those issues.

Link to comment
Share on other sites

you wanted to know how to fix the backlight, remove the osi patch and use xosi.

 

Prior to windows 8 the backlight methods are different, you'll have full backlight control

 

Don't worry about audio and trackpad and other stuff relying on osi as xosi fixes those issues.

I understand, I was just genuinely curious of the machinations behind the scenes.  Apologies if it came across as confrontational.

 

I'll try out those patches and report back.  Does the SSDT-XOSI.dsl need any changes, or is it fine as-is?

Link to comment
Share on other sites

Its no problem, i Just added it to acpi patched and add it to sorted order from rehabmans repo

It worked!  Couple notes:

  • It doesn't look like I need SortedOrder, the SSDT appears to be loading just fine.
  • I got my SSDT-XOSI from RehabMan's OS-X-Clover-Laptop-Config repo, which has Windows 2012 enabled by default.  Commenting it out in favor of Windows 2009 solved everything.

The Brightness slider is still a bit finicky (it's out of sync; midway through the bar it'll hit max brightness and then jump to lowest) but at least I can more finely control it now.

 

This is gonna help a lot with battery life, and I think I can finally start using macOS as a daily driver on this laptop again!  Thanks for all your help!

Link to comment
Share on other sites

 Share

×
×
  • Create New...