Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M2+ desktop dcp/dptx HDMI output support #329

Merged
merged 21 commits into from
Oct 5, 2023

Conversation

jannau
Copy link
Member

@jannau jannau commented Sep 3, 2023

Initialize the HDMI output of M2+ desktop Macs releases in 2023.

  • Mac mini (M2/M2 Pro) and Mac studio (M2 Max) should work (tested on both mini models)
  • Mac Pro / studio (M2 Ultra) are different but I would expect it to work as well
  • only one HDMI port on the Mac Pro works (the one driven by die 1), no idea which
  • high res displays might not work if they require different phy parameters

@sequencer
Copy link

I'm curious, is this work also help DP Alt for laptops?

@jannau jannau force-pushed the m2_dptx_v13_5 branch 4 times, most recently from dc81c87 to 340ea0d Compare September 11, 2023 07:03
@niggowai
Copy link

I can confirm it working for my j473 with a 13.5 IPSW.
Unfortunately, linux turns off the dptx again

@jannau
Copy link
Member Author

jannau commented Sep 17, 2023

I can confirm it working for my j473 with a 13.5 IPSW. Unfortunately, linux turns off the dptx again

yes, linux need further changes not turn the dptx-phy power domain off. You can add pd_ignore_unused to the linux kernel command line to avoid that or add apple,always-on to the dptx_ext_phy power state.

iboot uses this and it's simpler. m1n1 doesn't need to swap surfaces
for tear free display.

Signed-off-by: Janne Grunau <[email protected]>
Required non-blocking handling of multiple AFK endpoints for the same
mailbox.

Signed-off-by: Janne Grunau <[email protected]>
Required for t602x dcp*.

Signed-off-by: Janne Grunau <[email protected]>
Phy "implementation" is simplified a replay of a macos trace with on
t8112 with a 1920x1080 display.

Signed-off-by: Janne Grunau <[email protected]>
This needs to ensure that the data processing does not block on
message retrieval from the mailbox. Command processing must not block
and have to ensure that afk_epic_command() receives the reply to its
command.
DCP's dptx-port endpoint (endpoint 0x2a) can send notifies at any time
which needs to be processed in the right context.

Signed-off-by: Janne Grunau <[email protected]>
To be used on the dptx-port endpoint.

Signed-off-by: Janne Grunau <[email protected]>
Used on dptx-port endpoint.

Signed-off-by: Janne Grunau <[email protected]>
They exceed 256 with repeated chainloading of m1n1.bin on j473. Do not
hold a service for every possible channel but keep a fixed array of 8
services identified by the channel number.

Signed-off-by: Janne Grunau <[email protected]>
This allows forward declarations in other headers.

Signed-off-by: Janne Grunau <[email protected]>
Based on the linux kernel implementation with updates for the macOS 13.5
based DCP firmware.

Signed-off-by: Janne Grunau <[email protected]>
Signed-off-by: Janne Grunau <[email protected]>
This on is boring but allows turning additional logging on.

Signed-off-by: Janne Grunau <[email protected]>
Will be used by SMC.

Signed-off-by: Janne Grunau <[email protected]>
Only supported operation is smc_write_u32() for turning the dp2hdmi
converter on M2 desktop systems on.

Signed-off-by: Janne Grunau <[email protected]>
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 <[email protected]>
@marcan marcan merged commit 31ee149 into AsahiLinux:main Oct 5, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants