hybrid-graphics-linux team mailing list archive
-
hybrid-graphics-linux team
-
Mailing list archive
-
Message #00214
Help with ACPI arguments please
Hey All,
I've been fooling around with various ACPI methods on my Alienware M11X-R2.
There's a particular method called NVOP that shows up in the SSDT for the
nvidia GPU. I hacked acpi_call to call this method with various arguments,
which appear to be successful, but I've not been able to change my power
consumption rate.
Arguments I've tried so far:
0, 0, 0, 0
0x0100, 0, 0, 0
0x0100, 0x05, 0, 0
0x0100, 0x06, 0, 0
0x0100, 0x1A, 0, 0 <-- this one looked promising in the table but I have no
idea with to make arg3 & 4
0x0100, 0x10, 0, 0 ditto
example acpi_call.c mod:
// for now, parameterless functions only
atpx_arg.count = 4;
atpx_arg.pointer = &atpx_arg_elements[0];
// just to be sure
atpx_arg_elements[0].type = ACPI_TYPE_INTEGER;
atpx_arg_elements[0].integer.value = 0x0100;
atpx_arg_elements[1].type = ACPI_TYPE_INTEGER;
atpx_arg_elements[1].integer.value = 0x05;
atpx_arg_elements[2].type = ACPI_TYPE_INTEGER;
atpx_arg_elements[2].integer.value = 0;
atpx_arg_elements[3].type = ACPI_TYPE_INTEGER;
atpx_arg_elements[3].integer.value = 0;
I need some help from someone who knows ACPI better than I. Does
documentation on how these methods work exist? This is the NVOP method,
which looks like the most promising for being able to power off the nvidia
gpu:
Method (NVOP, 4, NotSerialized)
{
Store (0x55, P80H)
Store ("------- NV OPTIMUS DSM --------", Debug)
If (LNotEqual (Arg1, 0x0100))
{
Return (0x80000001)
}
Name (_T_0, Zero)
Store (ToInteger (Arg2), _T_0)
If (LEqual (_T_0, Zero))
{
Store (Zero, P80H)
Store ("Sub-Function 0", Debug)
Store (Buffer (0x04)
{
0x01, 0x00, 0x01, 0x04
}, Local0)
Return (Local0)
}
Else
{
If (LEqual (_T_0, 0x05))
{
Store (0x05, P80H)
Store ("Sub-Function 5", Debug)
Name (TMP5, Buffer (0x04)
{
0x00, 0x00, 0x00, 0x00
})
CreateField (TMP5, Zero, 0x04, DAVF)
CreateField (TMP5, 0x04, One, LIDF)
CreateField (TMP5, 0x08, 0x06, TLSN)
CreateField (Arg3, 0x1F, One, NCSM)
CreateField (Arg3, 0x19, 0x05, NCSN)
CreateField (Arg3, 0x18, One, DIMK)
CreateField (Arg3, 0x0C, 0x0C, ACTD)
CreateField (Arg3, Zero, 0x0C, ATTD)
If (ToInteger (DIMK))
{
\_SB.PCI0.P0P2.PEGP.GATD (SDSP)
Store (\_SB.PCI0.P0P2.PEGP.CTOI, TLSN)
Store (One, DAVF)
}
Else
{
Store (One, TLSN)
Store (One, DAVF)
}
Return (TMP5)
}
Else
{
If (LEqual (_T_0, 0x06))
{
Store (0x06, P80H)
Store ("Sub-Function 6", Debug)
Return (Package (0x0F)
{
0x0110,
0x2C,
0x80007330,
0x2C,
0x80006340,
0x2C,
0x0110,
0x80007330,
0x2C,
0x0110,
0x80006340,
0x2C,
0x80006340,
0x2C
})
}
Else
{
If (LEqual (_T_0, 0x1A))
{
If (LEqual (IGDS, One))
{
Store (0x1A, P80H)
Store ("Sub-Function 26", Debug)
Store (Buffer (0x04)
{
0x59, 0x00, 0x00, 0x11
}, Local0)
If (LEqual (\_SB.PCI0.P0P2.PEGP.PO36, One))
{
Or (DerefOf (Index (Local0, Zero)),
0x18, Index (Local0, Zero
))
}
Else
{
And (DerefOf (Index (Local0, Zero)),
0xE7, Index (Local0, Zero
))
}
CreateField (Arg3, 0x18, 0x02, OPCE)
CreateField (Arg3, Zero, One, FLCH)
If (ToInteger (FLCH))
{
Store (OPCE, \_SB.PCI0.P0P2.PEGP.OMPR)
}
Return (Local0)
}
Else
{
Return (Unicode ("X"))
}
}
Else
{
If (LEqual (_T_0, 0x10))
{
Store (0x10, P80H)
Store ("Sub-Function 16", Debug)
Return (\_SB.PCI0.P0P2.PEGP.GOBT (Arg3))
}
Else
{
Return (0x80000002)
}
}
}
}
}
Return (0x80000001)
}
}