Contribute
Register

[Guide] Disabling discrete graphics in dual-GPU laptops

Joined
Jul 26, 2013
Messages
190
Motherboard
Sony VAIO VPCSA
CPU
i5-2430 2.40GHz/HM67
Graphics
Radeon HD 6630M / Intel HD 3000
Mac
iMac
Mobile Phone
iOS
I am trying decrease the amount of DSDT pacthes and use your guide for patching external GPU. I followed your guide but some parts of your guide didn't work for me. I will appreciate if you can comment.

For SSDT-0.dsl:
"Remove _PSS placeholders" (new patch)

I tried this but when I apply this patch I get an error. Before the patch I have below
Code:
            Method (PSDD, 0, NotSerialized)
            {
                Name (PWRV, Package (0x06)
                {
                    0x80000000,
                    0x80000000,
                    0x80000000,
                    0x80000000,
                    0x80000000,
                    0x80000000
                })
                If (\ECON) {}
                Return (PWRV)
            }
After the patch I have
Code:
                Name (PWRV, )
                If (\ECON) {}
                Return (PWRV)
Which doesn’t compile.

Therefore I skipped this patch.

I checked which files has codes that needs to be patched
$ grep -B3 _ADR.*0x00020000 *.dsl
Code:
DSDT.dsl-
DSDT.dsl-        Device (GFX0)
DSDT.dsl-        {
DSDT.dsl:            Name (_ADR, 0x00020000)  // _ADR: Address
$ grep -l GFX0 *.dsl
Code:
DSDT.dsl
SSDT-7.dsl
$ grep -l Method.*_DSM *.dsl
Code:
DSDT.dsl
SSDT-7.dsl
SSDT-8.dsl
SSDT-8.dsl is managing TPM device. It is Trusted Platform Module I think it is not related to Mac so I will not include it as well.

SSD-7.dsl has GPU code
I applied
"Rename _DSM methods to XDSM"
"Rename GFX0 to IGPU"
"Cleanup/Fix Errors (SSDT)"

$ grep -l Method.*_OFF *.dsl
SSDT-7.dsl

So off method is SSDT-7.dsl

$ grep -l Method.*_INI *.dsl
DSDT.dsl
SSDT-7.dsl

So ini methods are in DSDT and SSDT-7
Code:
        Method (_INI, 0, NotSerialized)  // _INI: Initialize
        {
            Store (Zero, \_SB.PCI0.PEG0.PEGP._ADR)
        }
Here is the off method from SSDT-7
Code:
        Method (_OFF, 0, Serialized)  // _OFF: Power Off
        {
            Store (LCTL, ELCT)
            Store (SVID, HVID)
            Store (SDID, HDID)
            Store (One, LNKD)
            While (LLess (LNKS, Zero))
            {
                Sleep (One)
            }

            \_SB.PCI0.PEG0.PEGP.PWRD ()
            Notify (\_SB.PCI0.PEG0, Zero)
        }
There doesn’t seem to have any EC access. I also checked

Code:
 \_SB.PCI0.PEG0.PEGP.PWRD ()

        Method (PWRD, 0, Serialized)
        {
            Store (Zero, \_SB.PCI0.PEG0.PEGP.PO17)
            Store (Zero, \_SB.PCI0.PEG0.PEGP.PO35)
        }
It also doesn’t have any EC access. So I added _OFF to _INI of PEGP
Code:
        Method (_INI, 0, NotSerialized)  // _INI: Initialize
        {
            Store (Zero, \_SB.PCI0.PEG0.PEGP._ADR)
            _OFF()
        }
I saved this file and passed to DSDT. After necessary patches I did following patches to disable external GPU

I added a method to my DSDT
Code:
    Method (POFF, 0, NotSerialized)
    {
        External(\_SB.PCI0.PEG0.PEGP._OFF, MethodObj)
        \_SB.PCI0.PEG0.PEGP._OFF ()
    }
Added following patches to _INI of IGPU, _WAK and _PTS
Code:
//Patched IGPU
        Device (IGPU)
        {
            Name (_ADR, 0x00020000)  // _ADR: Address
            Method (_INI, 0, NotSerialized)  // _INI: Initialize
            {
                POFF ()
                ISTP (0x0A, Zero)
                Store (ISTP (0x07, Zero), Local0)
                Or (Local0, 0x80000000, BCLP)
            }

Patched WAK
    Method (_WAK, 1, Serialized)  // _WAK: Wake
    {
        POFF()
        If (LOr(LLess(Arg0,1),LGreater(Arg0,5))) { Store(3,Arg0) }
My DSDT also has following patches applied
"IRQ Fix"
"SMBUS Fix"
"OS Check Fix (Windows 7)"
"Add IMEI"
"Add MCHC"
"RTC Fix"
"Fix _WAK Arg0 v2"
"Rename GFX0 to IGPU"
"Audio Layout 3"
"Battery Patches"
"EDID Patch"
"Brightness Fix"
"HPET Fix"
"Shutdown Fix"
"6-Series USB"

Could you comment whether my DSDT and SSDT files are patched correctly or whether I am missing any patches? According to your comments, I will write a guide for Sony S Series laptop. Thanks to your help on batteries and function keys, I think Sony S series laptops will have very stable macOS support.

Code:
$ kextstat|grep -y acpiplat
   13    2 0xffffff7f82b58000 0x66000    0x66000    com.apple.driver.AppleACPIPlatform (5.0) 867C81BE-EA01-3A65-89F4-06D78E6514CA <12 11 7 6 5 4 3 1>
$ kextstat|grep -y appleintelcpu
   24    0 0xffffff7f82764000 0x2b000    0x2b000    com.apple.driver.AppleIntelCPUPowerManagement (219.0.0) 9E383328-0713-3AD3-BC4A-3A2A5646FEE5 <7 6 5 4 3 1>
   33    0 0xffffff7f8275f000 0x3000     0x3000     com.apple.driver.AppleIntelCPUPowerManagementClient (219.0.0) B802638B-251C-3602-BA8C-001F87228765 <7 6 5 4 3 1>
I also attached my Clover folder and IORegistryExplorer file.
 

Attachments

Last edited:

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,134
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
I am trying decrease the amount of DSDT pacthes and use your guide for patching external GPU. I followed your guide but some parts of your guide didn't work for me. I will appreciate if you can comment.

For SSDT-0.dsl:
"Remove _PSS placeholders" (new patch)

I tried this but when I apply this patch I get an error. Before the patch I have below
That patch is not applicable to SSDT-0. There are no errors in SSDT-0, so I don't know why you're even trying that patch...

I checked which files has codes that needs to be patched
Nothing unusual in your files...
_OFF is in SSDT-7. So is the associated _INI. _OFF has no EC related code. All you need is to call _OFF from _INI as per guide.

Could you comment whether my DSDT and SSDT files are patched correctly or whether I am missing any patches?
According to ioreg, no AMD graphics device, so it appears to be successfully disabled.
 
Joined
Jul 26, 2013
Messages
190
Motherboard
Sony VAIO VPCSA
CPU
i5-2430 2.40GHz/HM67
Graphics
Radeon HD 6630M / Intel HD 3000
Mac
iMac
Mobile Phone
iOS
Is it enough to call _OFF from SSDT-7 from _INI of SSDT-7 or should I also call _OFF from DSDT _INI of IGPU and _WAK ?
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,134
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Is it enough to call _OFF from SSDT-7 from _INI of SSDT-7 or should I also call _OFF from DSDT _INI of IGPU and _WAK ?
As per guide, you should call _OFF only from the associated _INI (at same scope). No need to call it multiple times.
 
Joined
Dec 17, 2016
Messages
19
Motherboard
Dell
CPU
I5-6200u
Graphics
Hd520
Problem description : I have checked it carefully, _OFF and _PS3 exist in ssdt10, _OFF uses the HGOF method, HGOF does not contain EC, I try to call _OFF or _PS3 method in ssdt9 and tried dsdt,But, I have failed.
 

Attachments

Joined
Dec 22, 2016
Messages
6
Motherboard
Acer Aspire E5-572G / HM86
CPU
Intel Core i5-4210M
Graphics
Intel HD4600 + GeForce 940M
Mac
MacBook Air
Mobile Phone
Android, iOS
Hello. I have just started editing the DSDT (and SSDT) after getting Intel Graphics to work correctly. The first thing I am trying is to disable the discrete graphics (didn't try anything for power management yet). However, after going through all the steps mentioned, I could still see a Nvidia device listed in System Report. (and I added the _OFF to _REG and _INI after that with same result) I don't know if its actually disabled or not. I have attached the required files (includes, ioreg, patchmatic output and grep outputs). How should I proceed next?
 

Attachments

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,134
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Problem description : I have checked it carefully, _OFF and _PS3 exist in ssdt10, _OFF uses the HGOF method, HGOF does not contain EC, I try to call _OFF or _PS3 method in ssdt9 and tried dsdt,But, I have failed.
ACPI is patched incorrectly. Based on ACPI/origin, you should have in ACPI/patched:
DSDT.aml
SSDT.aml (ssdtPRgen.sh)
SSDT-0.aml
SSDT-1.aml
SSDT-2.aml
SSDT-3.aml
SSDT-4.aml
SSDT-5.aml
SSDT-6.aml
SSDT-7.aml
SSDT-15.aml
SSDT-16.aml

And don't forget that SortedOrder is required to set SSDT load order.
 
Joined
Dec 17, 2016
Messages
19
Motherboard
Dell
CPU
I5-6200u
Graphics
Hd520
[QUOTE =“RehabMan,post:1456110,member:429483”] ACPI未正确修补。基于ACPI / origin,你应该在ACPI / patched中:
DSDT.aml
SSDT.aml(ssdtPRgen.sh)
SSDT-0.aml
SSDT-1.aml
SSDT-2.aml
SSDT-3.aml
SSDT-4.aml
SSDT-5.aml
SSDT-6.aml
SSDT-7.aml
SSDT-15.aml
SSDT-16.aml

并且不要忘记SortedOrder是设置SSDT加载顺序所必需的。[/ QUOTE]
ACPI is patched incorrectly. Based on ACPI/origin, you should have in ACPI/patched:
DSDT.aml
SSDT.aml (ssdtPRgen.sh)
SSDT-0.aml
SSDT-1.aml
SSDT-2.aml
SSDT-3.aml
SSDT-4.aml
SSDT-5.aml
SSDT-6.aml
SSDT-7.aml
SSDT-15.aml
SSDT-16.aml

And don't forget that SortedOrder is required to set SSDT load order.
I tried, and the same as before, this is a very difficult problem
 

Top