Contribute
Register

[Guide] Disabling discrete graphics in dual-GPU laptops

The code you have there is clearly not correct (why the attempt to recursively call _REG?).
Must move the code as originally in the SSDT exactly, with appropriate External declarations.
Read the guide carefully.

Okay I readed the guide again, I removed the two original ECO lines in SSDT-6 and added it in DSDT.aml with external and now it compiles without problem

what I did:
Code:
          Method (_REG, 2, NotSerialized)  // _REG: Region Availability
            {
                If (LEqual (Arg0, 0x03))
                {
                    Store (Arg1, Local0)
                    If (Local0)
                    {
                        Store (One, ECOK)
                    }
                    Else
                    {
                        Store (Zero, ECOK)
                    }
                }
                If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))
                {
                    Store (Zero, \_SB.PCI0.LPCB.EC0.VGAF)
                    External(\_SB.PCI0.LPCB.EC0._REG, MethodObj)
                }
(more _REG code)

I did it well?
Thanks rehabMan for your patience ...
 
Last edited:
Okay I readed the guide again, I removed the two original ECO lines in SSDT-6 and added it in DSDT.aml with external and now it compiles without problem

what I did:
Code:
          Method (_REG, 2, NotSerialized)  // _REG: Region Availability
            {
                If (LEqual (Arg0, 0x03))
                {
                    Store (Arg1, Local0)
                    If (Local0)
                    {
                        Store (One, ECOK)
                    }
                    Else
                    {
                        Store (Zero, ECOK)
                    }
                }
                If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))
                {
                    Store (Zero, \_SB.PCI0.LPCB.EC0.VGAF)
                    External(\_SB.PCI0.LPCB.EC0._REG, MethodObj)
                }
(more _REG code)

I did it well?
Thanks rehabMan for your patience ...

The original EC related code in HGOF is this:
Code:
            Store (Zero, \_SB.PCI0.LPCB.EC0.VGAF)
            \_SB.PCI0.LPCB.EC0.SCTB ()

Right?

So, why are you trying to insert different code into _REG?
 
The original EC related code in HGOF is this:
Code:
            Store (Zero, \_SB.PCI0.LPCB.EC0.VGAF)
            \_SB.PCI0.LPCB.EC0.SCTB ()

Right?

So, why are you trying to insert different code into _REG?
Sorry, I copied the wrong lines :/

Now its okay:
Code:
            Method (_REG, 2, NotSerialized)  // _REG: Region Availability
            {
                If (LEqual (Arg0, 0x03))
                {
                    Store (Arg1, Local0)
                    If (Local0)
                    {
                        Store (One, ECOK)
                    }
                    Else
                    {
                        Store (Zero, ECOK)
                    }
                }
                If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))
                {
                    Store (Zero, \_SB.PCI0.LPCB.EC0.VGAF)
                    External(\_SB.PCI0.LPCB.EC0.SCTB, MethodObj)
                }

one thing.. here, in this line: External(\_SB.PCI0.LPCB.EC0.SCTB, MethodObj)
\_SB.PCI0.LPCB.EC0.SCTB is without parentheses at the end, right?
because with parentheses it gives me this error:
Captura_de_pantalla_2018-06-09_a_las_08.02.44.png


but if I removed parentheses it compiles well
 
Sorry, I copied the wrong lines :/

Now its okay:
Code:
            Method (_REG, 2, NotSerialized)  // _REG: Region Availability
            {
                If (LEqual (Arg0, 0x03))
                {
                    Store (Arg1, Local0)
                    If (Local0)
                    {
                        Store (One, ECOK)
                    }
                    Else
                    {
                        Store (Zero, ECOK)
                    }
                }
                If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))
                {
                    Store (Zero, \_SB.PCI0.LPCB.EC0.VGAF)
                    External(\_SB.PCI0.LPCB.EC0.SCTB, MethodObj)
                }

one thing.. here, in this line: External(\_SB.PCI0.LPCB.EC0.SCTB, MethodObj)
\_SB.PCI0.LPCB.EC0.SCTB is without parentheses at the end, right?
because with parentheses it gives me this error:
Captura_de_pantalla_2018-06-09_a_las_08.02.44.png


but if I removed parentheses it compiles well

It is still wrong.
Why do you continue to change the two lines?

Hint: Likely no need for External, as SCTB is probably in DSDT. And even if SCTB was in a file other than DSDT, calling SCTB is separate from External declaration:

eg:
Code:
                If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))
                {
                    Store (Zero, \_SB.PCI0.LPCB.EC0.VGAF)
                    External(\_SB.PCI0.LPCB.EC0.SCTB, MethodObj)
                    \_SB.PCI0.LPCB.EC0.SCTB()
                }

And, for example, if VGAF was not in DSDT:
Code:
                If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))
                {
                    External(\_SB.PCI0.LPCB.EC0.VGAF, FieldUnitObj) // just guessing it is a Field unit...
                    Store (Zero, \_SB.PCI0.LPCB.EC0.VGAF)
                    External(\_SB.PCI0.LPCB.EC0.SCTB, MethodObj)
                    \_SB.PCI0.LPCB.EC0.SCTB()
                }

But likely both are defined in DSDT, therefore no need for External:
Code:
                If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))
                {
                    Store (Zero, \_SB.PCI0.LPCB.EC0.VGAF)
                    \_SB.PCI0.LPCB.EC0.SCTB()
                }

Hint #2: Reading the ACPI spec should be considered necessary if you wish to understand how to code ACPI.
 
Last edited:
Must move the code as originally in the SSDT exactly, with appropriate External declarations.
Sorry, i got confused because you wrote that.

External is for calling a function in another file, right?

and \_SB.PCI0.LPCB.EC0.SCTB() is in the same file and same scope...

so now im right?
Code:
                If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))
                {
                    Store (Zero, \_SB.PCI0.LPCB.EC0.VGAF)
                    \_SB.PCI0.LPCB.EC0.SCTB()
                }

without external
 
oh now I readed your edit post so I think its okay now.
Thanks rehabMan! I will patch and test it
 
External is for calling a function in another file, right?

I wrote "with appropriate External declarations".
Keyword is "appropriate", which means to use your brain to determine if you need External or not.
And of course you still need leave the original code intact, even in the case of adding External.

External is for declaring a symbol and its type that exists in another compilation unit.
It has no runtime action (no "calling", no "access").

and \_SB.PCI0.LPCB.EC0.SCTB() is in the same file and same scope...

That is code to call SCTB (that's what the () does).
And yes, it is likely that SCTB is defined in DSDT (search: "Method (SCTB").

so now im right?
Code:
                If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))
                {
                    Store (Zero, \_SB.PCI0.LPCB.EC0.VGAF)
                    \_SB.PCI0.LPCB.EC0.SCTB()
                }

without external

Yes...
Assuming both VGAF and SCTB are defined in DSDT (likely), you will find that code should compile without error.
 
Thanks rehab I think that now is totally fixed, +-5 hours without graphics freezes...
finally im getting my laptop working well

thanks for your patience :)
 
Need your help again, RehabMan, Nvidia again doesn't want to be disabled. What am I doing wrong this time?
 

Attachments

  • Stuff.zip
    3.4 MB · Views: 83
Back
Top