华硕 VM510LI 屏蔽独显

找到了 _OFF 方法是在 SSDT11定义的。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Scope (\_SB.PCI0.RP05.PEGP)
{
Method (_ON, 0, Serialized) // _ON_: Power On
{
SGON ()
Notify (\_SB.PCI0.RP05, Zero)
}
Method (_OFF, 0, Serialized) // _OFF: Power Off
{
SGOF ()
Notify (\_SB.PCI0.RP05, Zero)
}
}

发现其中 _OFF 方法调用了 SGOF 方法。

查找到 SGOF 方法是在 SSDT10 定义的。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Method (SGOF, 0, Serialized)
{
If (LEqual (CCHK (Zero), Zero))
{
Return (Zero)
}
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, 0x91)
\_SB.PCI0.LPCB.EC0.WRAM (0x03A4, Zero)
\_SB.PCI0.LPCB.EC0.WRAM (0x03A5, Zero)
Store (LCTL, ELCT)
Store (SVID, HVID)
Store (SDID, HDID)
Store (One, LNKD)
While (LNotEqual (LNKS, Zero))
{
Sleep (One)
}
SGPO (HLRS, One)
SGPO (PWEN, Zero)
Return (Zero)
}

其中调用了有四行 EC0 的代码。记下来,然后将这些代码注释掉。修改后如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Method (SGOF, 0, Serialized)
{
If (LEqual (CCHK (Zero), Zero))
{
Return (Zero)
}
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, 0x91)
// \_SB.PCI0.LPCB.EC0.WRAM (0x03A4, Zero)
// \_SB.PCI0.LPCB.EC0.WRAM (0x03A5, Zero)
Store (LCTL, ELCT)
Store (SVID, HVID)
Store (SDID, HDID)
Store (One, LNKD)
While (LNotEqual (LNKS, Zero))
{
Sleep (One)
}
SGPO (HLRS, One)
SGPO (PWEN, Zero)
Return (Zero)
}

找到 _INI 方法是在 SSDT10 里面

1
2
3
4
Method (_INI, 0, NotSerialized) // _INI: Initialize
{
Store (Zero, \_SB.PCI0.RP05.PEGP._ADR)
}

从中调用 _OFF 方法,修改如下:

1
2
3
4
5
6
7
Method (_INI, 0, NotSerialized) // _INI: Initialize
{
Store (Zero, \_SB.PCI0.RP05.PEGP._ADR)
//added to turn nvidia/radeon off
External(\_SB.PCI0.RP05.PEGP._OFF, MethodObj)
_OFF()
}

其中 External(\_SB.PCI0.RP05.PEGP._OFF, MethodObj) _OFF 方法的路径必须要对,否者会出错。

找到 _REG 方法,在 DSDT 里。

1
2
3
4
5
6
7
Method (_REG, 2, NotSerialized) // _REG: Region Availability
{
If (LEqual (Arg0, 0x03))
{
Store (Arg1, ECFL)
}
}

添加之前在 SGOF 方法内注释的有关 EC0 的代码,修改后如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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)))
{
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, 0x91)
\_SB.PCI0.LPCB.EC0.WRAM (0x03A4, Zero)
\_SB.PCI0.LPCB.EC0.WRAM (0x03A5, Zero)
}
}

其中 If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1))) 是和上面的 If (LEqual (Arg0, 0x03))Store (Arg1, ECFL) 对应的,意思我猜测是:

上面的 LEqual (Arg0, 0x03) 成立且 Store (Arg1, ECFL) = LEqual(Arg1,1) 则执行我们的添加的 EC0 系列的代码,故此需要按情况修改 If (LAnd(LEqual(Arg0,3),LEqual(Arg1,1)))