Contribute
Register

[Guide] Using Clover to "hotpatch" ACPI

OK. Have fun...
Note: Will move these posts to the hotpatch guide...
Is it safe to manually call _REG to initialize the EC? So the modified _OFF would call _REG, then call XOFF.
 
Is it safe to manually call _REG to initialize the EC?

No.
_REG is a "notification" that initialization has been done by the host EC driver.
Calling it would make your ACPI code believe that the host EC driver is ready, when in fact it is not.
 
No.
_REG is a "notification" that initialization has been done by the host EC driver.
Calling it would make your ACPI code believe that the host EC driver is ready, when in fact it is not.
I ended up renaming _OFF If(\ECON) to If(\EXON) and adding a dummy 'EXON' IntObj and it worked. I'm attaching my patchmatic extraction, please take a look.

I'm wondering about that store GATY code... Since they made it inside an if conditional, they must have considered the possibility of calling _OFF before EC is ready. Does this mean I can ignore that code rather than have it in _REG?
 

Attachments

  • patchamtic.zip
    40.3 KB · Views: 88
I ended up renaming _OFF If(\ECON) to If(\EXON) and adding a dummy 'EXON' IntObj and it worked. I'm attaching my patchmatic extraction, please take a look.

Patchmatic output not adequate. Nothing to compare against.

"Problem Reporting" files are incomplete.
Read FAQ, "Problem Reporting" again. Carefully. Attach all requested files/output.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
Use the tool mentioned in the FAQ, that way it is less likely you'll omit something.
 

Attachments

  • debug_17614.zip
    1.8 MB · Views: 99
This looks ok, but very specific to the code you have.
Not something I can recommend in this guide, as it is not generic enough.
Yeah, but it applies to both Z50 and G50 models which have different _OFF methods. I'll push a repo update soon.

Also, any ideas what 'GATY' stands for and why it's guarded by an if-conditional? I mean is it safe to not call that code in _REG?
 
Also, any ideas what 'GATY' stands for and why it's guarded by an if-conditional?

No idea.
A guess would be that it notifies the EC that the discrete device is off.

I mean is it safe to not call that code in _REG?

You should call it from _REG.
That way _OFF tasks are complete.
 
Re-merged SSDT-REG with SSDT-DGPU and did some code refactoring. Could you please take a look and give me your opinion? :)

https://github.com/the-braveknight/Lenovo-X50-macOS

A method with only a single line is a bit of a waste.
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...)
 
Back
Top