apple: guard gfx restore reset#253
Conversation
|
Dubious about this one I'm afraid, but will take a closer look later. There is already functionality to clear some Mac nvRAM vars (currently Bluetooth) via |
|
The hang happens with AMD GPUs and 3K+ display. The IMACs 4/5Ks all get black screen once booted via the EFI. The documented workaround in forums is to clear the nvram once the system boot. But this patch delete only the variable that causing the GFX to stay dark. |
dfb76fd to
ee86172
Compare
|
I did use that workaround. I currently have every apple computer from 2007 to 2020 in the bench. This proposed solution allows the user to use the same config across any apple computer without any extra config. My goal is to understand that variable later and leverage that config. But first I want to have it boot the same configuration across different resolution and GPUs.|| PS: once this accepted, or a better solution is provided. | |
|
Thanks for getting back. It wasn't clear from your response, but did you mean to say that the suggested config setting change "works"? |
|
The suggested official config 'works' if you have the config prior the poisoning or if you reset the nvram. It also acted weirdly (glitch artifact) when I swapped the disk to a non apple hardware. My goal is to have 1 config works across every computer (apple, laptop, desktop, tablets, Chromebooks, etc). PS: Apple firmware used to work without this quirk, but the pushed an updated that limit 3k resolution at boot time for their AMD GPU. (probably 5K is performance hog while the system is booting). Downgrading the firmware is possible, but that not user friendly (and will get updated anyway once you start macOS). |
|
Thanks for the clarification. Note that having "the one config that rules them all" (so to speak) is not a priority. Instead, the priority is for a default config that works for "standard" setups and for those that have edge needs to modify the config to suit their setups. Having said that, will look further into your proposal and get back presently. A few things to note is that the variable should be considered as So, you probably want to handle those as well ... Possibly by iterating until you hit a However, I need to first decide whether it is a good idea to mess with this variable in the first place. Will get back. Thanks again! |
|
The saved-config property is written ONLY to AAPL,PathProperties0000 because the discrete AMD GPU is always the first device enumerated. Higher-numbered slots correspond to other output that don't have this issue and are normally initialized at OS boot time. That extra defensive code will look like generated code, that never gets executed. As I said I tested this code in every hardware apple architecture released since 2007 till they stopped in 2020. Apple is not going to release anything that break this code as they are on ARM since 2020. If you have a better alternative that requires no user quirk mangling, I can test the branch with the hardware. |
|
Noted. Thanks. Will consider and get back as stated. |
|
The I don't know what the problem is but I do know how to properly get and parse the property and save the property. I believe There may be more than one https://gist.github.com/joevt/477fe842d16095c2bfd839e2ab4794ff
An example of how to parse the result: The result will look like this: Some useful gfxutil commands.
|
|
@seuros ... Thank you for the well written and potentially beneficial proposed changes to RefindPlus. It is understood that the proposal would help with handling known issues affecting 5K iMacs and similar and that this would be done out of the box as part of a stated aim to allow deploying RefindPlus in a manner that allows using a single configuration across different Macs with otherwise varying configuration requirements. However, the stated configuration aim is not aligned with the current design goal of prioritising a certain standard setup and requiring users with edge requirements, on both Mac and PC, to configure RefindPlus to meet their requirements. This may change in future, but current remains the design goal. As you found, there is an existing configuration change users of the units with the target issue can make to fully address the issue and this configuration change only needs to be done once. Please note that the fact of the existence of such a change is not what precludes adopting the current proposal. Rather, that the proposal is adjudged to come with some undesirable side effects.
There are other considerations that cannot all be listed here but I hope those outlined help shed light on the decision. Thank you once again and look forward to future contributions from you. As an aside, issues with Nvidia GPUs on EFI 1.x units can typically be overcome by activating the The issue template would be updated to spell this out presently. |

Work around Mac OS poisoning the EFI boot display on some Macs .
When Mac OS runs, it injects a 'saved-config' GPU-state property into the 'AAPL,PathProperties0000' device-properties variable.
On the next boot, Apple firmware RESTORES that saved config instead of doing a fresh display init, which leaves the EFI GOP framebuffer unbound from the panel scanout.
RefindPlus then draws into a framebuffer that is not scanned out, producing a black screen.
As the firmware restores this state BEFORE RefindPlus loads, the only portable solution is to delete the poisoned variable and warm reset so the firmware re-initialises the display fresh on the immediate re-boot.
The firmware regenerates a clean 'StartupDisplay'-only variable, so this does not loop (a one-shot guard provides additional protection).
This only happens if user multi boots to MacOS.
A small note: When we delete the saved-config property, a chime is emitted. That harmless, and i didnt not want to play gymnastic by muting/unmutting it.
ping @dakanji .