Contribute
Register

[Guide] Disabling discrete graphics in dual-GPU laptops

ok thanks, i'll report back whenever i'll find a solution
 
i tried acpi debug, simply placing some lines emitting debug in the syslog when the functions are called. all seem to run but the SGOF, this is the code
Code:
        Method (SGOF, 0, Serialized)
        {
            If (LEqual (CCHK (Zero), Zero))
            {
                Return (Zero)
            }
            \RMDT.P1("Executing SGOF")
            Store (Zero, ONOF)
            //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, 0x95)
            //\_SB.PCI0.LPCB.EC0.WRAM (0x03A4, Zero)
            //\_SB.PCI0.LPCB.EC0.WRAM (0x03A5, Zero)
            Store (LCTL, ELCT)
            Store (SVID, HVID)
            Store (SDID, HDID)
            Store (EMLW, DMLW)
            \RMDT.P1("Executing SPP0")
            SPP0 ()
            Store (One, LNKD)
            Store (Zero, TCNT)
            While (LLess (TCNT, LDLY))
            {
                If (LEqual (LNKS, Zero))
                {
                    \RMDT.P1("SGOF Break")
                    Break
                }

                Sleep (0x10)
                Add (TCNT, 0x10, TCNT)
            }

            While (LNotEqual (LNKS, Zero))
            {
                Sleep (One)
            }

            Store (0x02, AFES)
            If (LGreaterEqual (And (PNHM, 0x0F), 0x03))
            {
                If (LNotEqual (P0UB, Zero))
                {
                    Store (GMXB (), MBDL)
                    PDUB (MBDL)
                }
            }

            If (LGreaterEqual (PCSL, 0x04))
            {
                If (LEqual (SC7A, One))
                {
                    C7OK (One)
                }
            }
            \RMDT.P1("Executing SGPO 1")
            SGPO (HLRS, One)
            \RMDT.P1("Executing SGPO 2")
            SGPO (PWEN, Zero)
            Sleep (0x64)
            Return (Zero)
        }

i can see in syslog some of the debug lines i've set but i never see the two i've put at the end of the method, log look like this
Nov 5 23:27:12 localhost kernel[0]: ACPIDebug: "Executing _INI"
Nov 5 23:27:12 localhost kernel[0]: ACPIDebug: "Executing _OFF"
Nov 5 23:27:12 localhost kernel[0]: ACPIDebug: "Executing SGOF"
Nov 5 23:27:12 localhost kernel[0]: ACPIDebug: "Executing SPP0"

so it seem it execute the SPP0 and never come back from it.
this is the SPP0 code, i can't see anything offending on it

Code:
        Method (SPP0, 0, NotSerialized)
        {
            Store (Zero, INDX)
            While (One)
            {
                Store (DerefOf (Index (DAT0, INDX)), WLSB)
                Increment (INDX)
                Store (DerefOf (Index (DAT0, INDX)), WMSB)
                Increment (INDX)
                Store (Or (ShiftLeft (WMSB, 0x08), WLSB), POFF)
                Store (DerefOf (Index (DAT0, INDX)), PLEN)
                Increment (INDX)
                If (LEqual (POFF, 0xFFFF))
                {
                    Break
                }

                While (LGreater (PLEN, Zero))
                {
                    Store (RBP0 (POFF), Index (DAT0, INDX))
                    Increment (INDX)
                    Increment (POFF)
                    Decrement (PLEN)
                }
            }
        }

should i try to remove the SSP0 () call?
 
...
so it seem it execute the SPP0 and never come back from it.

Not possible to confidently make that assertion. You have no debug output directly after the SPP0 call.

this is the SPP0 code, i can't see anything offending on it

You can instrument it just like the other methods...
 
modified the SPP0 like this
Code:
        Method (SPP0, 0, NotSerialized)
        {
            Store (Zero, INDX)
            While (One)
            {
                Store (DerefOf (Index (DAT0, INDX)), WLSB)
                Increment (INDX)
                Store (DerefOf (Index (DAT0, INDX)), WMSB)
                Increment (INDX)
                Store (Or (ShiftLeft (WMSB, 0x08), WLSB), POFF)
                Store (DerefOf (Index (DAT0, INDX)), PLEN)
                Increment (INDX)
                If (LEqual (POFF, 0xFFFF))
                {
                    \RMDT.P2("SPP0 POFF", POFF)
                    \RMDT.P1("SPP0 break")
                    Break
                }

                While (LGreater (PLEN, Zero))
                {
                    Store (RBP0 (POFF), Index (DAT0, INDX))
                    Increment (INDX)
                    Increment (POFF)
                    Decrement (PLEN)
                }
            }
        }

so i get this in the log
Nov 5 23:53:37 localhost kernel[0]: ACPIDebug: "Executing SPP0"
Nov 5 23:53:37 localhost kernel[0]: ACPIDebug: { "SPP0 POFF", 0xffff, }
Nov 5 23:53:37 localhost kernel[0]: ACPIDebug: "SPP0 break"

so it reach the break, i'm not a programmer, but such break interrupt the execution right?
 
modified the SPP0 like this
Code:
        Method (SPP0, 0, NotSerialized)
        {
            Store (Zero, INDX)
            While (One)
            {
                Store (DerefOf (Index (DAT0, INDX)), WLSB)
                Increment (INDX)
                Store (DerefOf (Index (DAT0, INDX)), WMSB)
                Increment (INDX)
                Store (Or (ShiftLeft (WMSB, 0x08), WLSB), POFF)
                Store (DerefOf (Index (DAT0, INDX)), PLEN)
                Increment (INDX)
                If (LEqual (POFF, 0xFFFF))
                {
                    \RMDT.P2("SPP0 POFF", POFF)
                    \RMDT.P1("SPP0 break")
                    Break
                }

                While (LGreater (PLEN, Zero))
                {
                    Store (RBP0 (POFF), Index (DAT0, INDX))
                    Increment (INDX)
                    Increment (POFF)
                    Decrement (PLEN)
                }
            }
        }

so i get this in the log
Nov 5 23:53:37 localhost kernel[0]: ACPIDebug: "Executing SPP0"
Nov 5 23:53:37 localhost kernel[0]: ACPIDebug: { "SPP0 POFF", 0xffff, }
Nov 5 23:53:37 localhost kernel[0]: ACPIDebug: "SPP0 break"

so it reach the break, i'm not a programmer, but such break interrupt the execution right?

The Break causes execution to resume outside the While block, which in this case, exits the Method.

You could instrument further to confirm:
Code:
        Method (SPP0, 0, NotSerialized)
        {
\rmdt.p1("SPP0 enter")
            Store (Zero, INDX)
            While (One)
            {
                Store (DerefOf (Index (DAT0, INDX)), WLSB)
                Increment (INDX)
                Store (DerefOf (Index (DAT0, INDX)), WMSB)
                Increment (INDX)
                Store (Or (ShiftLeft (WMSB, 0x08), WLSB), POFF)
                Store (DerefOf (Index (DAT0, INDX)), PLEN)
                Increment (INDX)
                If (LEqual (POFF, 0xFFFF))
                {
                    \RMDT.P2("SPP0 POFF", POFF)
                    \RMDT.P1("SPP0 break")
                    Break
                }
\rmdt.p1("SPP0 before 2nd While")
                While (LGreater (PLEN, Zero))
                {
                    Store (RBP0 (POFF), Index (DAT0, INDX))
                    Increment (INDX)
                    Increment (POFF)
                    Decrement (PLEN)
                }
            }
\rmdt.p1("SPP0 exit")
        }

You may have to further instrument the second loop, and RBP0 Method, although it seems you're not getting to that loop.
 
thanks for the hints, i'll continue tomorrow, i need to place many more debug on all the SGOF method to see if it really stop to that SPP0 or the problem is later.
 
Hello

i traded to disabling but i had on error whane i applied remove _dsm methods
Compiler aborting due to parser-detected syntax error(s)
DSDT.dsl 19202:
Error 6126 - syntax error, unexpected $end and premature End-Of-File


ASL Input: DSDT.dsl - 19202 lines, 524434 bytes, 7639 keywords


Compilation complete. 1 Errors, 0 Warnings, 0 Remarks, 0 Optimizations
Salims-iMacDSDT salim$

Tankes
 
Hello

i traded to disabling but i had on error whane i applied remove _dsm methods
Compiler aborting due to parser-detected syntax error(s)
DSDT.dsl 19202:
Error 6126 - syntax error, unexpected $end and premature End-Of-File


ASL Input: DSDT.dsl - 19202 lines, 524434 bytes, 7639 keywords


Compilation complete. 1 Errors, 0 Warnings, 0 Remarks, 0 Optimizations
Salims-iMacDSDT salim$

Tankes

Not possible to diagnose given the information you provide.

But you could be running into a known MaciASL bug. Remove _DSM methods manually.
 
I used your maciasl and aisle extract from clover F4

I will tray remove _dsm manual Thanks
 
I extracted using Patchmatic, I get two files, SSDT.aml and DSDT.aml
Is this okay? Last time I extracted it with patchmatic I got 11 other SSDT.aml files

Where do I input this code?
And how do I get the .aml files to become .dsl files

Code:
iasl -da -dl *.aml

 
Back
Top