Power up display early (fixes HPD sometimes) and delay at least one
frame after swapping before quiescing DCP, otherwise the swap somehow
doesn't complete.
Signed-off-by: Hector Martin <marcan@marcan.st>
stage1 ends up with an ugly Asahi 100% logo on top of a 200% Apple logo.
Let's just clear it so it looks nicer.
Signed-off-by: Hector Martin <marcan@marcan.st>
This works around issues switching to 120Hz mode on systems affected by
the Sonoma situation, and in general it's probably a good idea anyway.
Signed-off-by: Hector Martin <marcan@marcan.st>
It appears that when macOS is set to non-ProMotion mode, DCP firmware
<14.0 booted from DCP firmware 14.0+ needs a delay before modesetting to
complete the modeset properly.
The cases here are:
- Older m1n1 stage1 will, as far as it's concerned, initialize the
display properly, but it won't work. It also misses the retina flag,
since this codepath was intended for external displays. Use the
missing retina flag as a signal to trigger reconfig.
- If installed as stage1, we reconfigure the display as usual, now with
the extra delay. We also set the Retina flag now.
The persistence mechanism for the ProMotion flag is unknown. It doesn't
seem to be nvram. It also doesn't matter if we successfully modeset to
120Hz mode and then reboot, it breaks again, so it's not about the
"current" mode sticking.
Signed-off-by: Hector Martin <marcan@marcan.st>
Extend start_interface() with the number of expected services so it can
stop when all services are initialized.
Fixes failed display init on some devices in stage 1 due to a too slow
IOP which does not manage to send service announce messages in 20
mailbox / ringbuffer query operations.
Proper fix for this is to let the endpoint implementations drive the
initialization via afk_epic_work() until the expected services are
found.
Signed-off-by: Janne Grunau <j@jannau.net>
clang 17 now enforces strict prototyping. add void to the parameters
to fix building with clang going forward.
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Fixes display initialization from stage 1 m1n1. 20ms looked reliable on
j473 but let's add 25% safety margin. Someone with more motivation (and
HW serial) to do repeated `kmutil configure-boot ...` can try to
minimize this and test on t602x.
Signed-off-by: Janne Grunau <j@jannau.net>
Without this property u-boot will add reserved memory regions to the
EFI memory map with the wrong type. This results in Linux mapping it
and thus breaking the intended use in the asahi driver.
Signed-off-by: Janne Grunau <j@jannau.net>
On M2* desktop systems the HDMI output is not managed by dcp/dcp0. This
allows more flexibility, for example dcp on the M2 Mac mini can be
routed to the USB-C/ThunderBolt ports.
For m1n1 this adds quite ab bit of complexity. In addition to the DCP
iboot endpoint/protocol two additional endpoints have to be started.
Only the dptx-port endpoint has a meaningful AP <=> DCP communication.
In addition we start the system endpoint to optionally enable more
verbose syslog messages (if RTKIT_SYSLOG is defined).
In addition the dptx-phy or lpdptx-phy has to be programmed. Those two
phy look mostly identical. MacOS seems to use a static DP configuration
(4 lanes, HBR3*) regardless of the connected display.
The added SMC gpio support is used to power the MCDP29xx DP to HDMI
converter on.
Config is unfortunately a mess since Apple can't name the device tree
nodes consistently. On M2 Ultra devices only the four dcpext*/dispext*
on each die are used. M2 Ultra support is untested.
* link rate might differ on t602x based devices for 8k60 support
Signed-off-by: Janne Grunau <j@jannau.net>