Contribute
Register

[Guide] Disabling discrete graphics in dual-GPU laptops

For my computer there is no \_SB.PCI0.LPCB.EC0.SPIN (0x96, Zero) code or similar at _OFF method in SSDT-9.
Does it mean no chance to disable it?
From OP
Now... how to find the SSDT that has _OFF. We can use grep:
In your SSDT-7 you will find \_SB.PCI0.PEG0.PEGP._OFF method
 
Is it 7? No, I don't think so.
If you say 8. Yes, I already found that code.
Code:
Method (_OFF, 0, Serialized)  // _OFF: Power Off
            {
                \_SB.PCI0.PEG0.PEGP.SGOF ()
                Store (Zero, _STA)
            }

But for this code @RehabMan says
If you open SSDT-10.dsl and look for _OFF, you find it is a method inside a PowerResource macro. This is not the _OFF method we want. Open SSDT-11.dsl and look there and you'll find a regular _OFF method, which is what we are looking for.

For my sample SSDT-10 = SSDT-8
SSDT-11 = SSDT-9

You can find the regular one in the origin SSDT_9 like below:
Code:
Method (_OFF, 0, Serialized)  // _OFF: Power Off
        {
            If (LEqual (CTXT, Zero))
            {
                If (LNotEqual (GPRF, One))
                {
                    Store (VGAR, VGAB)
                }

                Store (One, CTXT)
            }

            SGOF ()
        }
As I said before there is no _OFF line.
 

Attachments

  • Screen Shot 2017-07-03 at 15.20.35.jpg
    Screen Shot 2017-07-03 at 15.20.35.jpg
    36.6 KB · Views: 91
Is it 7? No, I don't think so.
If you say 8. Yes, I already found that code.
Here it is, in SSDT-7 in the second Scope block
Code:
    Scope (\_SB.PCI0.PEG0.PEGP)
    {

    ....

        Method (_OFF, 0, Serialized)  // _OFF: Power Off
        {
            If (CTXT == Zero)
            {
                If (GPRF != One)
                {
                    VGAB = VGAR /* \_SB_.PCI0.PEG0.PEGP.VGAR */
                }

                CTXT = One
            }

            SGOF ()
        }

    ....

    }
 
Here it is, in SSDT-7 in the second Scope block
Code:
    Scope (\_SB.PCI0.PEG0.PEGP)
    {

    ....

        Method (_OFF, 0, Serialized)  // _OFF: Power Off
        {
            If (CTXT == Zero)
            {
                If (GPRF != One)
                {
                    VGAB = VGAR /* \_SB_.PCI0.PEG0.PEGP.VGAR */
                }

                CTXT = One
            }

            SGOF ()
        }

    ....

    }

Edit: I misread your post. The code above is the method you want, whichever file it is in is the correct one as you seem to have uploaded 2 folders with differently named SSDTs.

Just follow the rest of the guide if there are no EC calls.
 
For my computer there is no \_SB.PCI0.LPCB.EC0.SPIN (0x96, Zero) code or similar at _OFF method in SSDT-9.
Does it mean no chance to disable it?

No.
It just means you won't have to relocate any EC related code.
 
I've dumped and dissembled the aml files. OFF and IN are in DSDT.dsl and SSDT-17.dsl I'm lost on how to proceed to patch. Rehab man could you help me?
 

Attachments

  • origin.zip
    177.6 KB · Views: 57
Last edited:
I've dumped and dissembled the aml files. OFF and IN are in DSDT.dsl and SSDT-17.dsl I'm lost on how to proceed to patch. Rehab man could you help me?

_OFF is in SSDT-17. It calls HGOF, also in SSDT-17. HGOF has EC references that need to be moved to _REG. _INI is also in SSDT-17. Patch _INI as per guide (to call _OFF). Move EC related code from HGOF to _REG (as per guide).
 
ok this is making my head explode. is this correct? I didn't use External because it's all in the same file right?

patch _INI from:

Code:
Method (_INI, 0, NotSerialized)  // _INI: Initialize
        {
            Store (Zero, \_SB.PCI0.RP01.PXSX._ADR)
        }
To:
Code:
Method (_INI, 0, NotSerialized)  // _INI: Initialize
        {
            Store (Zero, \_SB.PCI0.RP01.PXSX._ADR)
            //added to turn Nvidia discrete graphics off
            (\_SB.PCI0.RP01.PXSX._OFF, MethodOBJ)
            _OFF()
        }

I'm lost on moving moving EC code from HGOF to _REG. there isn't even a _REG when I do a search. everything is in ssdt-17.dsl. The guide doesn't deal with moving code from HGOF to _REG
 
ok this is making my head explode. is this correct? I didn't use External because it's all in the same file right?

patch _INI from:

Code:
Method (_INI, 0, NotSerialized)  // _INI: Initialize
        {
            Store (Zero, \_SB.PCI0.RP01.PXSX._ADR)
        }
To:
Code:
Method (_INI, 0, NotSerialized)  // _INI: Initialize
        {
            Store (Zero, \_SB.PCI0.RP01.PXSX._ADR)
            //added to turn Nvidia discrete graphics off
            (\_SB.PCI0.RP01.PXSX._OFF, MethodOBJ)
            _OFF()
        }

Should be:
Code:
        {
            Store (Zero, \_SB.PCI0.RP01.PXSX._ADR)
            //added to turn Nvidia discrete graphics off
            _OFF()
        }

I'm lost on moving moving EC code from HGOF to _REG. there isn't even a _REG when I do a search. everything is in ssdt-17.dsl. The guide doesn't deal with moving code from HGOF to _REG

_REG is found in DSDT.
 
ahhh thx ok _INI is patched properly

which code from here is ec related:
Code:
Method (HGOF, 0, Serialized)
        {
            If (LEqual (CCHK (Zero), Zero))
            {
                Return (Zero)
            }

            Store (Zero, ONOF)
            Store (LCTL, ELCT)
            Store (One, LNKD)
            While (LNotEqual (LNKS, Zero))
            {
                DDLY (One)
            }

            SGPO (HLRS, One)
            SGPO (PWEN, Zero)
            Store (Zero, \_SB.PCI0.LPCB.EC0.VGAF)
            \_SB.PCI0.LPCB.EC0.SCTB ()
            Return (Zero)
        }

how do I move it to here in dsdt.dsl
Code:
 Method (_REG, 2, NotSerialized)  // _REG: Region Availability
            {
                If (LEqual (Arg0, 0x03))
                {
                    Store (Arg1, Local0)
                    If (Local0)
                    {
                        Store (One, ECOK)
                    }
                    Else
                    {
                        Store (Zero, ECOK)
                    }
                }
 
Back
Top