Convert whitespace from spaces to tabs in last commit
Change-Id: I5c7338cc0542b48a0dbe0d71a4a2a4a5fd44aadf
This commit is contained in:
@@ -7,60 +7,60 @@
|
|||||||
#define GPS_FUNC_PSHAREPARAMS 0x0000002A
|
#define GPS_FUNC_PSHAREPARAMS 0x0000002A
|
||||||
|
|
||||||
Method(GPS, 2, Serialized) {
|
Method(GPS, 2, Serialized) {
|
||||||
Printf(" GPU GPS")
|
Printf(" GPU GPS")
|
||||||
Switch(ToInteger(Arg0)) {
|
Switch(ToInteger(Arg0)) {
|
||||||
Case(GPS_FUNC_SUPPORT) {
|
Case(GPS_FUNC_SUPPORT) {
|
||||||
Printf(" Supported Functions")
|
Printf(" Supported Functions")
|
||||||
Return(ITOB(
|
Return(ITOB(
|
||||||
(1 << GPS_FUNC_SUPPORT) |
|
(1 << GPS_FUNC_SUPPORT) |
|
||||||
(1 << GPS_FUNC_PSHARESTATUS) |
|
(1 << GPS_FUNC_PSHARESTATUS) |
|
||||||
(1 << GPS_FUNC_PSHAREPARAMS)
|
(1 << GPS_FUNC_PSHAREPARAMS)
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
Case(GPS_FUNC_PSHARESTATUS) {
|
Case(GPS_FUNC_PSHARESTATUS) {
|
||||||
Printf(" Power Share Status")
|
Printf(" Power Share Status")
|
||||||
Return(ITOB(0))
|
Return(ITOB(0))
|
||||||
}
|
}
|
||||||
Case(GPS_FUNC_PSHAREPARAMS) {
|
Case(GPS_FUNC_PSHAREPARAMS) {
|
||||||
Printf(" Power Share Parameters")
|
Printf(" Power Share Parameters")
|
||||||
|
|
||||||
CreateField(Arg1, 0, 4, QTYP) // Query type
|
CreateField(Arg1, 0, 4, QTYP) // Query type
|
||||||
|
|
||||||
Name(GPSP, Buffer(36) { 0x00 })
|
Name(GPSP, Buffer(36) { 0x00 })
|
||||||
CreateDWordField(GPSP, 0, RSTS) // Response status
|
CreateDWordField(GPSP, 0, RSTS) // Response status
|
||||||
CreateDWordField(GPSP, 4, VERS) // Version
|
CreateDWordField(GPSP, 4, VERS) // Version
|
||||||
|
|
||||||
// Set query type of response
|
// Set query type of response
|
||||||
RSTS = QTYP
|
RSTS = QTYP
|
||||||
// Set version of response
|
// Set version of response
|
||||||
VERS = 0x00010000
|
VERS = 0x00010000
|
||||||
|
|
||||||
Switch(ToInteger(QTYP)) {
|
Switch(ToInteger(QTYP)) {
|
||||||
Case(0) {
|
Case(0) {
|
||||||
Printf(" Request Current Information")
|
Printf(" Request Current Information")
|
||||||
// No required information
|
// No required information
|
||||||
Return(GPSP)
|
Return(GPSP)
|
||||||
}
|
}
|
||||||
Case(1) {
|
Case(1) {
|
||||||
Printf(" Request Supported Fields")
|
Printf(" Request Supported Fields")
|
||||||
// Support GPU temperature field
|
// Support GPU temperature field
|
||||||
RSTS |= (1 << 8)
|
RSTS |= (1 << 8)
|
||||||
Return(GPSP)
|
Return(GPSP)
|
||||||
}
|
}
|
||||||
Case(2) {
|
Case(2) {
|
||||||
Printf(" Request Current Limits")
|
Printf(" Request Current Limits")
|
||||||
// No required limits
|
// No required limits
|
||||||
Return(GPSP)
|
Return(GPSP)
|
||||||
}
|
}
|
||||||
Default {
|
Default {
|
||||||
Printf(" Unknown Query: %o", SFST(QTYP))
|
Printf(" Unknown Query: %o", SFST(QTYP))
|
||||||
Return(NV_ERROR_UNSUPPORTED)
|
Return(NV_ERROR_UNSUPPORTED)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Default {
|
Default {
|
||||||
Printf(" Unsupported function: %o", SFST(Arg0))
|
Printf(" Unsupported function: %o", SFST(Arg0))
|
||||||
Return(NV_ERROR_UNSUPPORTED)
|
Return(NV_ERROR_UNSUPPORTED)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -10,123 +10,123 @@
|
|||||||
Name(CDIS, 0)
|
Name(CDIS, 0)
|
||||||
|
|
||||||
Method(_HID) {
|
Method(_HID) {
|
||||||
CDIS = 0
|
CDIS = 0
|
||||||
Return("NVDA0820")
|
Return("NVDA0820")
|
||||||
}
|
}
|
||||||
|
|
||||||
Name(_UID, "NPCF")
|
Name(_UID, "NPCF")
|
||||||
|
|
||||||
Method(_DIS) {
|
Method(_DIS) {
|
||||||
CDIS = 1
|
CDIS = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
Method(_STA) {
|
Method(_STA) {
|
||||||
If (CDIS == 1) {
|
If (CDIS == 1) {
|
||||||
Return(0x0D)
|
Return(0x0D)
|
||||||
} Else {
|
} Else {
|
||||||
Return(0x0F)
|
Return(0x0F)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Method(_DSM, 4, Serialized) {
|
Method(_DSM, 4, Serialized) {
|
||||||
Printf("NVPCF _DSM")
|
Printf("NVPCF _DSM")
|
||||||
If (Arg0 == ToUUID(NVPCF_DSM_GUID)) {
|
If (Arg0 == ToUUID(NVPCF_DSM_GUID)) {
|
||||||
If (ToInteger(Arg1) == NVPCF_REVISION_ID) {
|
If (ToInteger(Arg1) == NVPCF_REVISION_ID) {
|
||||||
Return(NPCF(Arg2, Arg3))
|
Return(NPCF(Arg2, Arg3))
|
||||||
} Else {
|
} Else {
|
||||||
Printf(" Unsupported NVPCF revision: %o", SFST(Arg1))
|
Printf(" Unsupported NVPCF revision: %o", SFST(Arg1))
|
||||||
Return(NVPCF_ERROR_GENERIC)
|
Return(NVPCF_ERROR_GENERIC)
|
||||||
}
|
}
|
||||||
} Else {
|
} Else {
|
||||||
Printf(" Unsupported GUID: %o", IDST(Arg0))
|
Printf(" Unsupported GUID: %o", IDST(Arg0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Method(NPCF, 2, Serialized) {
|
Method(NPCF, 2, Serialized) {
|
||||||
Printf(" NVPCF NPCF")
|
Printf(" NVPCF NPCF")
|
||||||
Switch(ToInteger(Arg0)) {
|
Switch(ToInteger(Arg0)) {
|
||||||
Case(NVPCF_FUNC_GET_SUPPORTED) {
|
Case(NVPCF_FUNC_GET_SUPPORTED) {
|
||||||
Printf(" Supported Functions")
|
Printf(" Supported Functions")
|
||||||
Return(ITOB(
|
Return(ITOB(
|
||||||
(1 << NVPCF_FUNC_GET_SUPPORTED) |
|
(1 << NVPCF_FUNC_GET_SUPPORTED) |
|
||||||
(1 << NVPCF_FUNC_GET_STATIC_CONFIG_TABLES) |
|
(1 << NVPCF_FUNC_GET_STATIC_CONFIG_TABLES) |
|
||||||
(1 << NVPCF_FUNC_UPDATE_DYNAMIC_PARAMS)
|
(1 << NVPCF_FUNC_UPDATE_DYNAMIC_PARAMS)
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
Case(NVPCF_FUNC_GET_STATIC_CONFIG_TABLES) {
|
Case(NVPCF_FUNC_GET_STATIC_CONFIG_TABLES) {
|
||||||
Printf(" Get Static Config")
|
Printf(" Get Static Config")
|
||||||
Return(Buffer(14) {
|
Return(Buffer(14) {
|
||||||
// Device table header
|
// Device table header
|
||||||
0x20, 0x03, 0x01,
|
0x20, 0x03, 0x01,
|
||||||
// Intel + NVIDIA
|
// Intel + NVIDIA
|
||||||
0x00,
|
0x00,
|
||||||
// Controller table header
|
// Controller table header
|
||||||
0x23, 0x04, 0x05, 0x01,
|
0x23, 0x04, 0x05, 0x01,
|
||||||
// Dynamic boost controller
|
// Dynamic boost controller
|
||||||
0x01,
|
0x01,
|
||||||
// Supports DC
|
// Supports DC
|
||||||
0x01,
|
0x01,
|
||||||
// Reserved
|
// Reserved
|
||||||
0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00,
|
||||||
// Checksum
|
// Checksum
|
||||||
0xAD
|
0xAD
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
Case(NVPCF_FUNC_UPDATE_DYNAMIC_PARAMS) {
|
Case(NVPCF_FUNC_UPDATE_DYNAMIC_PARAMS) {
|
||||||
Printf(" Update Dynamic Boost")
|
Printf(" Update Dynamic Boost")
|
||||||
|
|
||||||
CreateField(Arg1, 0x28, 2, ICMD) // Input command
|
CreateField(Arg1, 0x28, 2, ICMD) // Input command
|
||||||
|
|
||||||
Name(PCFP, Buffer(49) {
|
Name(PCFP, Buffer(49) {
|
||||||
// Table version
|
// Table version
|
||||||
0x23,
|
0x23,
|
||||||
// Table header size
|
// Table header size
|
||||||
0x05,
|
0x05,
|
||||||
// Size of common status in bytes
|
// Size of common status in bytes
|
||||||
0x10,
|
0x10,
|
||||||
// Size of controller entry in bytes
|
// Size of controller entry in bytes
|
||||||
0x1C,
|
0x1C,
|
||||||
// Other fields filled in later
|
// Other fields filled in later
|
||||||
})
|
})
|
||||||
CreateByteField(PCFP, 0x04, CCNT) // Controller count
|
CreateByteField(PCFP, 0x04, CCNT) // Controller count
|
||||||
CreateWordField(PCFP, 0x05, ATGP) // AC TGP offset
|
CreateWordField(PCFP, 0x05, ATGP) // AC TGP offset
|
||||||
CreateWordField(PCFP, 0x07, DTGP) // DC TGP offset (unused)
|
CreateWordField(PCFP, 0x07, DTGP) // DC TGP offset (unused)
|
||||||
CreateWordField(PCFP, 0x19, ATPP) // AC TPP offset
|
CreateWordField(PCFP, 0x19, ATPP) // AC TPP offset
|
||||||
CreateWordField(PCFP, 0x1B, DTPP) // DC TPP offset (unused)
|
CreateWordField(PCFP, 0x1B, DTPP) // DC TPP offset (unused)
|
||||||
CreateWordField(PCFP, 0x1D, AMXP) // AC maximum TGP offset
|
CreateWordField(PCFP, 0x1D, AMXP) // AC maximum TGP offset
|
||||||
CreateWordField(PCFP, 0x21, AMNP) // AC minimum TGP offset
|
CreateWordField(PCFP, 0x21, AMNP) // AC minimum TGP offset
|
||||||
|
|
||||||
Switch(ToInteger(ICMD)) {
|
Switch(ToInteger(ICMD)) {
|
||||||
Case(0) {
|
Case(0) {
|
||||||
Printf(" Get Controller Params")
|
Printf(" Get Controller Params")
|
||||||
// Number of controllers
|
// Number of controllers
|
||||||
CCNT = 1
|
CCNT = 1
|
||||||
// AC configurable TGP baseline offset in 1/8 watt units
|
// AC configurable TGP baseline offset in 1/8 watt units
|
||||||
ATGP = (CONFIG_DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST_BASELINE << 3)
|
ATGP = (CONFIG_DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST_BASELINE << 3)
|
||||||
// AC total processor power offset from baseline in 1/8 watt units
|
// AC total processor power offset from baseline in 1/8 watt units
|
||||||
ATPP = (CONFIG_DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST_TPP << 3)
|
ATPP = (CONFIG_DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST_TPP << 3)
|
||||||
// AC maximum TGP offset from baseline in 1/8 watt units
|
// AC maximum TGP offset from baseline in 1/8 watt units
|
||||||
AMXP = (CONFIG_DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST_MAX << 3)
|
AMXP = (CONFIG_DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST_MAX << 3)
|
||||||
// AC minimum TGP offset from baseline in 1/8 watt units
|
// AC minimum TGP offset from baseline in 1/8 watt units
|
||||||
AMNP = (CONFIG_DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST_MIN << 3)
|
AMNP = (CONFIG_DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST_MIN << 3)
|
||||||
Printf("PCFP: %o", SFST(PCFP))
|
Printf("PCFP: %o", SFST(PCFP))
|
||||||
Return(PCFP)
|
Return(PCFP)
|
||||||
}
|
}
|
||||||
Case(1) {
|
Case(1) {
|
||||||
Printf(" Set Controller Status")
|
Printf(" Set Controller Status")
|
||||||
//TODO
|
//TODO
|
||||||
Printf("PCFP: %o", SFST(PCFP))
|
Printf("PCFP: %o", SFST(PCFP))
|
||||||
Return(PCFP)
|
Return(PCFP)
|
||||||
}
|
}
|
||||||
Default {
|
Default {
|
||||||
Printf(" Unknown Input Command: %o", SFST(ICMD))
|
Printf(" Unknown Input Command: %o", SFST(ICMD))
|
||||||
Return(NV_ERROR_UNSUPPORTED)
|
Return(NV_ERROR_UNSUPPORTED)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Default {
|
Default {
|
||||||
Printf(" Unsupported function: %o", SFST(Arg0))
|
Printf(" Unsupported function: %o", SFST(Arg0))
|
||||||
Return(NVPCF_ERROR_UNSUPPORTED)
|
Return(NVPCF_ERROR_UNSUPPORTED)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user