Contribute
Register

[Guide] Disabling discrete graphics in dual-GPU laptops

thanks for the suggestion. But just took a chance a straight installed over the old. No problems.;)



This really hurt my brain.:crazy: But my understanding of it from reading the guide, is that I needed to open the DSDT and apply the Disable from _REG patch. I added the \_SB.PCI0.HGOF path to the patch. It compiled with no errors. here's the modified DSDT code.
Code:
Method (_REG, 2, NotSerialized)  // _REG: Region Availability
            {
                If (LEqual (Arg0, 0x03))
                {
                    Store (Arg1, ECFL)
                }
                //added to turn nvidia/radeon off
                If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))
                {
                    External(\_SB.PCI0.RP01.PEGP._OFF, MethodObj)
                    \_SB.PCI0.RP01.PEGP._OFF()
                }
                //added to turn nvidia/radeon off
                If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))
                {
                    External(\_SB.PCI0.HGOF , MethodObj)
                    \_SB.PCI0.HGOF ()
Is that right? If not, could you please provide some steps and additional info. THANKS!

No. You need to modify the patch such that it adds the EC related code you find in HGOF... or you can make the required edits to _REG manually (generally, we make a patch such that it is easy to repeat the edits if ACPI needs re-extract/re-patch).

Bad idea to call HGOF twice. You'd be calling it from _INI (as in INI->_OFF->HGOF) and _REG.
Understand the guide example completely before trying to apply to your own situation.

This is the EC related code in HGOF:
Code:
            Store (\_SB.PCI0.LPCB.EC0.RRAM (0x0521), Local0)
            And (Local0, 0xCF, Local0)
            \_SB.PCI0.LPCB.EC0.WRAM (0x0521, Local0)
            \_SB.PCI0.LPCB.EC0.WRAM (0x0520, 0x89)
            \_SB.PCI0.LPCB.EC0.WRAM (0x03A4, Zero)
            \_SB.PCI0.LPCB.EC0.WRAM (0x03A5, Zero)

Did this too before testing/rebooting. I just moved it from patched folder. my laptop booted just fine without it! Does that mean the patch worked?

The _INI->_OFF sequence will likely disable the device, but may leave the EC in a confused state.
Important to get the _REG code correct to take care of those EC related WRAM calls.


Got it and installed it before doing any of the things i just mentioned above. My machine booted fine! Hope this fixes the bugs you found!

Yup.
Your Clover bootlog regarding AutoMerge now looks as expected.
And so does your patchmatic -extract output regarding SSDT-8.
 
No. You need to modify the patch such that it adds the EC related code you find in HGOF... or you can make the required edits to _REG manually (generally, we make a patch such that it is easy to repeat the edits if ACPI needs re-extract/re-patch).

Bad idea to call HGOF twice. You'd be calling it from _INI (as in INI->_OFF->HGOF) and _REG.
Understand the guide example completely before trying to apply to your own situation.

This is the EC related code in HGOF:
Code:
            Store (\_SB.PCI0.LPCB.EC0.RRAM (0x0521), Local0)
            And (Local0, 0xCF, Local0)
            \_SB.PCI0.LPCB.EC0.WRAM (0x0521, Local0)
            \_SB.PCI0.LPCB.EC0.WRAM (0x0520, 0x89)
            \_SB.PCI0.LPCB.EC0.WRAM (0x03A4, Zero)
            \_SB.PCI0.LPCB.EC0.WRAM (0x03A5, Zero)



The _INI->_OFF sequence will likely disable the device, but may leave the EC in a confused state.
Important to get the _REG code correct to take care of those EC related WRAM calls.

Ok will go through the example in the guide again. I'm obviously not understanding this. But, can you confirm that my nvidia in fact does still need to be disabled. I just can't seem to find any indication that it's running somewhere. when i look at my System Report from About MY Mac only Intel shows up in Graphics. How can I tell if NVIDIA is using system resources?
 
Ok will go through the example in the guide again. I'm obviously not understanding this. But, can you confirm that my nvidia in fact does still need to be disabled. I just can't seem to find any indication that it's running somewhere. when i look at my System Report from About MY Mac only Intel shows up in Graphics. How can I tell if NVIDIA is using system resources?

Since you're successfully calling _OFF, the device is disabled (you can verify by comparing ioreg with _OFF vs. without the _OFF call).
But the EC may be confused as it doesn't know it is off (eg. may affect thermal management behavior or other...)
 
No. You need to modify the patch such that it adds the EC related code you find in HGOF... or you can make the required edits to _REG manually (generally, we make a patch such that it is easy to repeat the edits if ACPI needs re-extract/re-patch).

Bad idea to call HGOF twice. You'd be calling it from _INI (as in INI->_OFF->HGOF) and _REG.
Understand the guide example completely before trying to apply to your own situation.

This is the EC related code in HGOF:
Code:
            Store (\_SB.PCI0.LPCB.EC0.RRAM (0x0521), Local0)
            And (Local0, 0xCF, Local0)
            \_SB.PCI0.LPCB.EC0.WRAM (0x0521, Local0)
            \_SB.PCI0.LPCB.EC0.WRAM (0x0520, 0x89)
            \_SB.PCI0.LPCB.EC0.WRAM (0x03A4, Zero)
            \_SB.PCI0.LPCB.EC0.WRAM (0x03A5, Zero)





The _INI->_OFF sequence will likely disable the device, but may leave the EC in a confused state.
Important to get the _REG code correct to take care of those EC related WRAM calls.

ok. I think was able to modify the patch to add the EC related code. so now _REG looks like this in DSDT.dsl



Code:
Method (_REG, 2, NotSerialized)  // _REG: Region Availability
            {
                If (LEqual (Arg0, 0x03))
                {
                    Store (Arg1, ECFL)
                }
                //added to turn nvidia/radeon off
                If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))
                {
                    External(\_SB.PCI0.RP01.PEGP._OFF, MethodObj)
                    \_SB.PCI0.RP01.PEGP._OFF()
                }
                //added to turn nvidia/radeon off
                If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))
                {
                    Store (\_SB.PCI0.LPCB.EC0.RRAM (0x0521), Local0)            And (Local0, 0xCF, Local0)            \_SB.PCI0.LPCB.EC0.WRAM (0x0521, Local0)            \_SB.PCI0.LPCB.EC0.WRAM (0x0520, 0x89)            \_SB.PCI0.LPCB.EC0.WRAM (0x03A4, Zero)            \_SB.PCI0.LPCB.EC0.WRAM (0x03A5, Zero)}
            }

is that correct? anyway i provided fresh report files. thanks for your patience
 

Attachments

  • jacknick_report_disabledualgpu2.zip
    2.4 MB · Views: 76
ok. I think was able to modify the patch to add the EC related code. so now _REG looks like this in DSDT.dsl



Code:
Method (_REG, 2, NotSerialized)  // _REG: Region Availability
            {
                If (LEqual (Arg0, 0x03))
                {
                    Store (Arg1, ECFL)
                }
                //added to turn nvidia/radeon off
                If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))
                {
                    External(\_SB.PCI0.RP01.PEGP._OFF, MethodObj)
                    \_SB.PCI0.RP01.PEGP._OFF()
                }
                //added to turn nvidia/radeon off
                If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))
                {
                    Store (\_SB.PCI0.LPCB.EC0.RRAM (0x0521), Local0)            And (Local0, 0xCF, Local0)            \_SB.PCI0.LPCB.EC0.WRAM (0x0521, Local0)            \_SB.PCI0.LPCB.EC0.WRAM (0x0520, 0x89)            \_SB.PCI0.LPCB.EC0.WRAM (0x03A4, Zero)            \_SB.PCI0.LPCB.EC0.WRAM (0x03A5, Zero)}
            }

is that correct? anyway i provided fresh report files. thanks for your patience

Looks good.
 

Attachments

  • dangquang9a_report.zip
    2.4 MB · Views: 69
Okay i attached my reporting files

Calling _OFF from _REG is a mistake. It can be too late.
No EC related code in _OFF, but there is in HGOF (_OFF calls HGOF). Only EC related code in HGOF should be removed from HGOF and moved to _REG.

Also, your ACPI configuration is wrong.
SSDT-0.aml should be named SSDT.aml.
SSDT-1.aml is actually patched SSDT-7.aml, so should be named SSDT-7.aml.

Also, you don't need SSDT.aml (you have it named SSDT-0.aml) as you already have config.plist/ACPI/SSDT/Generate/PluginType=true (the two methods are mutually exclusive and actually conflict).

Summary:
You should remove SSDT-0.aml (named wrongly, and not needed anyway).
You should patch SSDT-7.aml to remove EC related code from HGOF, call _OFF from _INI.
You should patch _REG in DSDT.aml so the EC related code from HGOF is within.
 
Calling _OFF from _REG is a mistake. It can be too late.
No EC related code in _OFF, but there is in HGOF (_OFF calls HGOF). Only EC related code in HGOF should be removed from HGOF and moved to _REG.

Also, your ACPI configuration is wrong.
SSDT-0.aml should be named SSDT.aml.
SSDT-1.aml is actually patched SSDT-7.aml, so should be named SSDT-7.aml.

Also, you don't need SSDT.aml (you have it named SSDT-0.aml) as you already have config.plist/ACPI/SSDT/Generate/PluginType=true (the two methods are mutually exclusive and actually conflict).

Summary:
You should remove SSDT-0.aml (named wrongly, and not needed anyway).
You should patch SSDT-7.aml to remove EC related code from HGOF, call _OFF from _INI.
You should patch _REG in DSDT.aml so the EC related code from HGOF is within.
Does it mean i will have to move the code of HGOF Method from SSDT-7.aml to the _REG Method in DSDT.aml ?
 
Last edited:
I followed your instructions, but NVIDIA is still present. My laptop is Asus R556L with intel i5 4210U, intel HD 4400 and NVIDIA 840m. I patched DSDT for audio, PM, brightness and battery. Only sleep and patch for discrete GPU doesn't work. I attached dumped *.aml files, original *.dsl files, patched *.dsl files without patch for nvidia, *.aml files with patch for nvidia and my config.plist.

Please for help :(
 

Attachments

  • DSDT and config.zip
    279.3 KB · Views: 75
Back
Top