11-10-2012, 03:46 AM
Hmm... There's also SgTabl which obviously refers to Switchable Graphics. It also contains ON and OFF methods for PEG, so maybe it's worth investigating. Going to take a closer look at it soon.
Code:
DefinitionBlock ("acpi_ssdt2.aml", "SSDT", 1, "SgRef", "SgTabl", 0x00001000)
{
External (PWOK)
External (P8XH, MethodObj) // 2 Arguments
External (PWEN)
External (HLRS)
External (DDL8)
External (DDL7)
External (DDL6)
External (DDL5)
External (DDL4)
External (DDL3)
External (DDL2)
External (SDDL, IntObj)
External (DIDL)
External (SGFL)
External (MXD8)
External (MXD7)
External (MXD6)
External (MXD5)
External (MXD4)
External (MXD3)
External (MXD2)
External (MXD1)
External (DID8, IntObj)
External (DID7, IntObj)
External (DID6, IntObj)
External (DID5, IntObj)
External (DID4, IntObj)
External (DID3, IntObj)
External (DID2, IntObj)
External (DID1, IntObj)
External (NDID, IntObj)
External (SGMD)
External (\EECP, MethodObj) // 1 Arguments
External (\GBAS, MethodObj) // 1 Arguments
External (\EBAS, MethodObj) // 1 Arguments
External (\XBAS, MethodObj) // 1 Arguments
External (\_SB_.PCI0.PEG0, DeviceObj)
External (\_SB_.PCI0.GFX0, DeviceObj)
External (\_SB_.PCI0.GFX0._DOD, IntObj)
External (\_SB_.PCI0.GFX0.HDSM, IntObj)
External (\_SB_.PCI0.PEG0.PEGP, DeviceObj)
External (\_SB_.PCI0.GFX0.DD08._DGS, IntObj)
External (\_SB_.PCI0.GFX0.DD08._DCS, IntObj)
External (\_SB_.PCI0.GFX0.DD08._ADR, IntObj)
External (\_SB_.PCI0.GFX0.DD07._DGS, IntObj)
External (\_SB_.PCI0.GFX0.DD07._DCS, IntObj)
External (\_SB_.PCI0.GFX0.DD07._ADR, IntObj)
External (\_SB_.PCI0.GFX0.DD06._DGS, IntObj)
External (\_SB_.PCI0.GFX0.DD06._DCS, IntObj)
External (\_SB_.PCI0.GFX0.DD06._ADR, IntObj)
External (\_SB_.PCI0.GFX0.DD05._DGS, IntObj)
External (\_SB_.PCI0.GFX0.DD05._DCS, IntObj)
External (\_SB_.PCI0.GFX0.DD05._ADR, IntObj)
External (\_SB_.PCI0.GFX0.DD04._DGS, IntObj)
External (\_SB_.PCI0.GFX0.DD04._DCS, IntObj)
External (\_SB_.PCI0.GFX0.DD04._ADR, IntObj)
External (\_SB_.PCI0.GFX0.DD03._DGS, IntObj)
External (\_SB_.PCI0.GFX0.DD03._DCS, IntObj)
External (\_SB_.PCI0.GFX0.DD03._ADR, IntObj)
External (\_SB_.PCI0.GFX0.DD02._BCM, IntObj)
External (\_SB_.PCI0.GFX0.DD02._BQC, IntObj)
External (\_SB_.PCI0.GFX0.DD02._BCL, IntObj)
External (\_SB_.PCI0.GFX0.DD02._DGS, IntObj)
External (\_SB_.PCI0.GFX0.DD02._DCS, IntObj)
External (\_SB_.PCI0.GFX0.DD02._ADR, IntObj)
External (\_SB_.PCI0.GFX0.DD01._DGS, IntObj)
External (\_SB_.PCI0.GFX0.DD01._DCS, IntObj)
External (\_SB_.PCI0.GFX0.DD01._ADR, IntObj)
External (\_SB_.PCI0.PEG0.PEGP._ADR)
Scope (\_SB.PCI0.GFX0)
{
Method (MXVL, 1, Serialized)
{
Name (TMP0, Buffer (0x04)
{
0x00
})
CreateByteField (TMP0, Zero, DTYP)
CreateByteField (TMP0, One, DDSP)
CreateByteField (TMP0, 0x02, DAUX)
CreateByteField (TMP0, 0x03, DHPD)
Store (Arg0, DTYP)
ShiftRight (Arg0, 0x08, DDSP)
ShiftRight (Arg0, 0x10, DAUX)
ShiftRight (Arg0, 0x18, DHPD)
Return (TMP0)
}
Method (_DSM, 4, Serialized)
{
If (LEqual (Arg0, Buffer (0x10)
{
/* 0000 */ 0xD3, 0x73, 0xD8, 0x7E, 0xD0, 0xC2, 0x4F, 0x4E,
/* 0008 */ 0xA8, 0x54, 0x0F, 0x13, 0x17, 0xB0, 0x1C, 0x2C
}))
{
If (LEqual (Arg2, Zero))
{
Name (DRET, Buffer (0x04)
{
0x00
})
CreateWordField (DRET, Zero, F0SS)
CreateByteField (DRET, 0x03, TPVE)
Store (One, F0SS)
If (LEqual (And (SGMD, 0x0F), One))
{
Store (0x03, F0SS)
}
Else
{
Store (One, F0SS)
}
If (And (SGMD, 0x80))
{
Store (0x80, TPVE)
}
Return (DRET)
}
If (LEqual (Arg2, One))
{
Name (MXIF, Package (0x0A)
{
Zero,
Package (0x02)
{
Zero,
Buffer (0x04)
{
0x00
}
},
Package (0x02)
{
Zero,
Buffer (0x04)
{
0x00
}
},
Package (0x02)
{
Zero,
Buffer (0x04)
{
0x00
}
},
Package (0x02)
{
Zero,
Buffer (0x04)
{
0x00
}
},
Package (0x02)
{
Zero,
Buffer (0x04)
{
0x00
}
},
Package (0x02)
{
Zero,
Buffer (0x04)
{
0x00
}
},
Package (0x02)
{
Zero,
Buffer (0x04)
{
0x00
}
},
Package (0x02)
{
Zero,
Buffer (0x04)
{
0x00
}
},
Package (0x02)
{
Zero,
Buffer (0x04)
{
0x00
}
}
})
Store (NDID, Index (MXIF, Zero))
Store (DID1, Index (DerefOf (Index (MXIF, One)), Zero))
Store (DID2, Index (DerefOf (Index (MXIF, 0x02)), Zero))
Store (DID3, Index (DerefOf (Index (MXIF, 0x03)), Zero))
Store (DID4, Index (DerefOf (Index (MXIF, 0x04)), Zero))
Store (DID5, Index (DerefOf (Index (MXIF, 0x05)), Zero))
Store (DID6, Index (DerefOf (Index (MXIF, 0x06)), Zero))
Store (DID7, Index (DerefOf (Index (MXIF, 0x07)), Zero))
Store (DID8, Index (DerefOf (Index (MXIF, 0x08)), Zero))
Store (MXVL (MXD1), Index (DerefOf (Index (MXIF, One)), One
))
Store (MXVL (MXD2), Index (DerefOf (Index (MXIF, 0x02)), One
))
Store (MXVL (MXD3), Index (DerefOf (Index (MXIF, 0x03)), One
))
Store (MXVL (MXD4), Index (DerefOf (Index (MXIF, 0x04)), One
))
Store (MXVL (MXD5), Index (DerefOf (Index (MXIF, 0x05)), One
))
Store (MXVL (MXD6), Index (DerefOf (Index (MXIF, 0x06)), One
))
Store (MXVL (MXD7), Index (DerefOf (Index (MXIF, 0x07)), One
))
Store (MXVL (MXD8), Index (DerefOf (Index (MXIF, 0x08)), One
))
If (And (SGFL, One))
{
Store (0x80010306, Index (DerefOf (Index (MXIF, NDID)), Zero))
Store (MXVL (0x0101010E), Index (DerefOf (Index (MXIF, NDID)), One
))
}
Return (MXIF)
}
}
If (CondRefOf (\_SB.PCI0.GFX0.HDSM))
{
Return (\_SB.PCI0.GFX0.HDSM)
Arg0
Arg1
Arg2
Arg3
}
Return (One)
}
Method (IDAB, 0, Serialized)
{
If (LEqual (And (SGMD, 0x0F), One))
{
If (LEqual (SGFL, One))
{
WIID ()
}
}
Else
{
Store (Zero, NDID)
If (LNotEqual (DIDL, Zero))
{
Store (SDDL, DIDL)
DID1
}
If (LNotEqual (DDL2, Zero))
{
Store (SDDL, DDL2)
DID2
}
If (LNotEqual (DDL3, Zero))
{
Store (SDDL, DDL3)
DID3
}
If (LNotEqual (DDL4, Zero))
{
Store (SDDL, DDL4)
DID4
}
If (LNotEqual (DDL5, Zero))
{
Store (SDDL, DDL5)
DID5
}
If (LNotEqual (DDL6, Zero))
{
Store (SDDL, DDL6)
DID6
}
If (LNotEqual (DDL7, Zero))
{
Store (SDDL, DDL7)
DID7
}
If (LNotEqual (DDL8, Zero))
{
Store (SDDL, DDL8)
DID8
}
}
Return (Zero)
}
Method (HWID, 0, Serialized)
{
Name (TMP9, Package (0x09)
{
Ones,
Ones,
Ones,
Ones,
Ones,
Ones,
Ones,
Ones,
Ones
})
Store (Or (0x00010000, DID1), Index (TMP9, Zero))
Store (Or (0x00010000, DID2), Index (TMP9, One))
Store (Or (0x00010000, DID3), Index (TMP9, 0x02))
Store (Or (0x00010000, DID4), Index (TMP9, 0x03))
Store (Or (0x00010000, DID5), Index (TMP9, 0x04))
Store (Or (0x00010000, DID6), Index (TMP9, 0x05))
Store (Or (0x00010000, DID7), Index (TMP9, 0x06))
Store (Or (0x00010000, DID8), Index (TMP9, 0x07))
Store (Zero, Index (TMP9, 0x08))
If (And (SGFL, One))
{
Store (0x80010306, Index (TMP9, 0x08))
}
Return (TMP9)
}
Method (WIID, 0, Serialized)
{
Name (_T_0, Zero)
If (LEqual (And (DIDL, 0x0F0F), 0x0306))
{
Return (Zero)
}
If (LEqual (And (DID2, 0x0F0F), 0x0306))
{
Return (Zero)
}
If (LEqual (And (DID3, 0x0F0F), 0x0306))
{
Return (Zero)
}
If (LEqual (And (DID4, 0x0F0F), 0x0306))
{
Return (Zero)
}
If (LEqual (And (DID5, 0x0F0F), 0x0306))
{
Return (Zero)
}
If (LEqual (And (DID6, 0x0F0F), 0x0306))
{
Return (Zero)
}
If (LEqual (And (DID7, 0x0F0F), 0x0306))
{
Return (Zero)
}
If (LEqual (And (DID8, 0x0F0F), 0x0306))
{
Return (Zero)
}
Store (NDID, _T_0)
If (LEqual (_T_0, One))
{
Store (0x80010306, DID2)
Store (0x02, NDID)
}
Else
{
If (LEqual (_T_0, 0x02))
{
Store (0x80010306, DID3)
Store (0x03, NDID)
}
Else
{
If (LEqual (_T_0, 0x03))
{
Store (0x80010306, DID4)
Store (0x04, NDID)
}
Else
{
If (LEqual (_T_0, 0x04))
{
Store (0x80010306, DID5)
Store (0x05, NDID)
}
Else
{
If (LEqual (_T_0, 0x05))
{
Store (0x80010306, DID6)
Store (0x06, NDID)
}
Else
{
If (LEqual (_T_0, 0x06))
{
Store (0x80010306, DID7)
Store (0x07, NDID)
}
Else
{
If (LEqual (_T_0, 0x07))
{
Store (0x80010306, DID8)
Store (0x08, NDID)
}
Else
{
If (LEqual (_T_0, 0x08))
{
Store (0x09, NDID)
}
}
}
}
}
}
}
}
Return (Zero)
}
}
Scope (\_SB.PCI0.PEG0)
{
OperationRegion (RPCI, PCI_Config, Zero, 0xF0)
Field (RPCI, DWordAcc, Lock, Preserve)
{
Offset (0xB0),
ASPM, 2,
, 2,
LNKD, 1
}
OperationRegion (RPCX, SystemMemory, \XBAS (0x8400), Field (RPCX, DWordAcc, NoLock, Preserve)
{
Offset (0x8214),
Offset (0x8216),
LNKS, 4
})
}
Scope (\_SB.PCI0.PEG0.PEGP)
{
Name (ELCT, Zero)
Name (HVID, Zero)
Name (HDID, Zero)
OperationRegion (PCIS, SystemMemory, \EBAS (0xF0), Field (PCIS, DWordAcc, Lock, Preserve)
{
DVID, 16,
Offset (0x2C),
SVID, 16,
SDID, 16,
Offset (0x4C),
WVID, 16,
WDID, 16
})
OperationRegion (GPIO, SystemIO, \GBAS (0x60), Field (GPIO, ByteAcc, Lock, Preserve)
{
Offset (0x0C),
LVL0, 32,
Offset (0x38),
LVL1, 32,
Offset (0x48),
LVL2, 32
})
OperationRegion (PCAP, PCI_Config, \EECP (0x14), Field (PCAP, DWordAcc, NoLock, Preserve)
{
Offset (0x10),
LCTL, 16
})
Method (_INI, 0, NotSerialized)
{
Store (Zero, \_SB.PCI0.PEG0.PEGP._ADR)
}
Method (_ON, 0, Serialized)
{
SGPO (HLRS, One)
SGPO (PWEN, One)
Sleep (0x012C)
SGPO (HLRS, Zero)
Sleep (0x64)
Store (Zero, LNKD)
While (LLess (LNKS, 0x07))
{
Sleep (One)
}
Store (HVID, WVID)
Store (HDID, WDID)
Or (And (ELCT, 0x43), And (LCTL, 0xFFBC), LCTL)
Notify (\_SB.PCI0.PEG0, Zero)
P8XH (Zero, 0x88)
Return (One)
}
Method (_OFF, 0, Serialized)
{
Store (LCTL, ELCT)
Store (SVID, HVID)
Store (SDID, HDID)
Store (One, LNKD)
While (LNotEqual (LNKS, Zero))
{
Sleep (One)
}
P8XH (Zero, 0x75)
And (\_SB.PCI0.PEG0.PEGP.LVL1, 0xFFFEFFDF, \_SB.PCI0.PEG0.PEGP.LVL1)
Sleep (0x012C)
And (\_SB.PCI0.PEG0.PEGP.LVL0, 0xFFFEFFFF, \_SB.PCI0.PEG0.PEGP.LVL0)
P8XH (Zero, 0x77)
Notify (\_SB.PCI0.PEG0, Zero)
Return (Zero)
}
Method (_STA, 0, Serialized)
{
If (And (SGMD, 0x0F))
{
If (LEqual (SGPI (PWOK), One))
{
Return (0x0F)
}
Return (Zero)
}
If (LNotEqual (DVID, 0xFFFF))
{
Return (0x0F)
}
Return (Zero)
}
Method (_DOD, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0._DOD)
}
Device (DD01)
{
Method (_ADR, 0, Serialized)
{
Return (\_SB.PCI0.GFX0.DD01._ADR)
}
Method (_DCS, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD01._DCS)
}
Method (_DGS, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD01._DGS)
}
Method (_DSS, 1, NotSerialized)
{
}
}
Device (DD02)
{
Method (_ADR, 0, Serialized)
{
Return (\_SB.PCI0.GFX0.DD02._ADR)
}
Method (_DCS, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD02._DCS)
}
Method (_DGS, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD02._DGS)
}
Method (_DSS, 1, NotSerialized)
{
}
Method (_BCL, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD02._BCL)
}
Method (_BQC, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD02._BQC)
}
Method (_BCM, 1, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD02._BCM)
Arg0
}
}
Device (DD03)
{
Method (_ADR, 0, Serialized)
{
Return (\_SB.PCI0.GFX0.DD03._ADR)
}
Method (_DCS, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD03._DCS)
}
Method (_DGS, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD03._DGS)
}
Method (_DSS, 1, NotSerialized)
{
}
}
Device (DD04)
{
Method (_ADR, 0, Serialized)
{
Return (\_SB.PCI0.GFX0.DD04._ADR)
}
Method (_DCS, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD04._DCS)
}
Method (_DGS, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD04._DGS)
}
Method (_DSS, 1, NotSerialized)
{
}
}
Device (DD05)
{
Method (_ADR, 0, Serialized)
{
Return (\_SB.PCI0.GFX0.DD05._ADR)
}
Method (_DCS, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD05._DCS)
}
Method (_DGS, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD05._DGS)
}
Method (_DSS, 1, NotSerialized)
{
}
}
Device (DD06)
{
Method (_ADR, 0, Serialized)
{
Return (\_SB.PCI0.GFX0.DD06._ADR)
}
Method (_DCS, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD06._DCS)
}
Method (_DGS, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD06._DGS)
}
Method (_DSS, 1, NotSerialized)
{
}
}
Device (DD07)
{
Method (_ADR, 0, Serialized)
{
Return (\_SB.PCI0.GFX0.DD07._ADR)
}
Method (_DCS, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD07._DCS)
}
Method (_DGS, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD07._DGS)
}
Method (_DSS, 1, NotSerialized)
{
}
}
Device (DD08)
{
Method (_ADR, 0, Serialized)
{
Return (\_SB.PCI0.GFX0.DD08._ADR)
}
Method (_DCS, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD08._DCS)
}
Method (_DGS, 0, NotSerialized)
{
Return (\_SB.PCI0.GFX0.DD08._DGS)
}
Method (_DSS, 1, NotSerialized)
{
}
}
Method (SGPI, 1, Serialized)
{
ShiftRight (Arg0, 0x07, Local1)
And (Arg0, 0x7F, Arg0)
If (LLess (Arg0, 0x20))
{
Store (\_SB.PCI0.PEG0.PEGP.LVL0, Local0)
ShiftRight (Local0, Arg0, Local0)
}
Else
{
If (LLess (Arg0, 0x40))
{
Store (\_SB.PCI0.PEG0.PEGP.LVL1, Local0)
ShiftRight (Local0, Subtract (Arg0, 0x20), Local0)
}
Else
{
Store (\_SB.PCI0.PEG0.PEGP.LVL2, Local0)
ShiftRight (Local0, Subtract (Arg0, 0x40), Local0)
}
}
If (LEqual (Local1, Zero))
{
Not (Local0, Local0)
}
Return (And (Local0, One))
}
Method (SGPO, 2, Serialized)
{
ShiftRight (Arg0, 0x07, Local3)
And (Arg0, 0x7F, Arg0)
If (LEqual (Local3, Zero))
{
Not (Arg1, Local3)
And (Local3, One, Local3)
}
If (LLess (Arg0, 0x20))
{
ShiftLeft (Local3, Arg0, Local0)
ShiftLeft (One, Arg0, Local1)
And (\_SB.PCI0.PEG0.PEGP.LVL0, Not (Local1), Local2)
Or (Local2, Local0, \_SB.PCI0.PEG0.PEGP.LVL0)
}
Else
{
If (LLess (Arg0, 0x40))
{
ShiftLeft (Local3, Subtract (Arg0, 0x20), Local0)
ShiftLeft (One, Subtract (Arg0, 0x20), Local1)
And (\_SB.PCI0.PEG0.PEGP.LVL1, Not (Local1), Local2)
Or (Local2, Local0, \_SB.PCI0.PEG0.PEGP.LVL1)
}
Else
{
ShiftLeft (Local3, Subtract (Arg0, 0x40), Local0)
ShiftLeft (One, Subtract (Arg0, 0x40), Local1)
And (\_SB.PCI0.PEG0.PEGP.LVL2, Not (Local1), Local2)
Or (Local2, Local0, \_SB.PCI0.PEG0.PEGP.LVL2)
}
}
Return (One)
}
}
}