the-braveknight
Moderator
- Joined
- Nov 24, 2015
- Messages
- 1,220
- Motherboard
- Lenovo Legion Y520 (Clover)
- CPU
- i7-7700HQ
- Graphics
- HD 630 (1920x1080) + Nvidia GTX 1060
- Mac
- Mobile Phone
A method with only a single line is a bit of a waste.
You’re right. But I accounted for the possibility of wanting to call DGPU.EXST() to check if PEGP exists before doing other future tasks. Maybe you’re right it’s a waste. I can add it easily later when I want.
I added ECOF() because I had separate REG and DGPU SSDTs so I wanted to have the DGPU code only in its SSDTs and only call the relevant method from REG.
And method calls should use (), eg., not:
Code:Method(EXST) { Return(CondRefOf(\_SB.PCI0.RP05.PEGP._OFF)) } // Check if DGPU existsMethod(DGOF) { If(EXST) { \_SB.PCI0.RP05.PEGP._OFF() } } // Call DGPU _OFF (without EC code)
Instead:
Code:Method(EXST) { Return(CondRefOf(\_SB.PCI0.RP05.PEGP._OFF)) } // Check if DGPU exists Method(DGOF) { If(EXST()) { \_SB.PCI0.RP05.PEGP._OFF() } } // Call DGPU _OFF (without EC code)
But really, I'd write it as:
Code:Method(DGOF) { If(CondRefOf(\_SB.PCI0.RP05.PEGP._OFF)) { \_SB.PCI0.RP05.PEGP._OFF() } } // Call DGPU _OFF (without EC code)
Same goes for ECOF (no need for a separate method for a single line of code...)
OK. I was wondering if ACPI has Swift-style computed properties that wouldn’t need () at the end...
Last edited: