Skip to content

display/dptx: don't reject a DPTX connect reply over the unk field - #292

Open
scottjones wants to merge 1 commit into
aurora-silicon:mainfrom
scottjones:upstream/dptx-connect-unk
Open

scottjones wants to merge 1 commit into
aurora-silicon:mainfrom
scottjones:upstream/dptx-connect-unk

Conversation

@scottjones

@scottjones scottjones commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Sign-off: ytgconsulting, this is your commit from omacom/m1n1#48 and it has only my forwarding Signed-off-by. aura's docs/licensing.md asks for the author's. Could you add yours, or reply here that I may add it for you? Happy to close this if you'd rather open it yourself.

On EPIC v1 firmware (seen on a T6021 Mac Studio, J475c, OS firmware 13.5), dptxport_connect() sends unk 0 and the DCP answers with unk 0:

DPTXPort: connect v2=0 sent target 0x8040 unk 0; ret 0
          reply unk 0 target 0x8040 reserved 0 status 0

The connect worked, but aura required 0x100 and returned -1, so display_configure() gave up before the modeset and HDMI stayed black until a hotplug. The field echoes the request, and Linux (dptxep.c) only logs a mismatch.

 dptxport_connect()
-  reply.unk != 0x100 -> fail
+  reply.unk == request.unk or 0x100 -> ok
+  anything else -> log, continue
 dptxport_validate_connection()
   unchanged (always sends 0x100, keeps its check)

Fix by ytgconsulting, from omacom/m1n1#48.

Evidence

  • tests/python/test_dptx_connect_reply.py compiles the real connect and validate functions against a stand-in service call. It fails on main (test_connect_accepts_the_echoed_unk) and passes with this change.
  • Hardware: J475c HDMI comes up at boot instead of after a hotplug. J475d (T6022) already got a matching reply, so nothing changes there.

Merge Danger

Door: two-way.

Blast Radius: DPTX connect on desktop Macs.

@RyanTheTide

Copy link
Copy Markdown
Contributor

The production boot stub pins at macOS 27.2 (26B123), so please retarget this to 27.2. The fix is shown on EPIC v1 firmware (OS firmware 13.5) on a J475c; please validate the DPTX connect on the J475c with the 27.2 stub.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Two things before it can go in, in addition to the 27.2 validation already asked for: the commit needs ytgconsulting's own Signed-off-by (docs/licensing.md). The change itself reads well: matching Linux by logging an unexpected unk while still checking the target and the v2 status is the right shape, and the host test is a nice touch. When the J475c is retested on the 27.2 stub, a short log showing the connect reply and HDMI coming up at boot would complete the evidence. Thanks for porting it.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. The change is right. dptxport_connect() still checks the target (and the v2 status), and an unexpected unk is logged instead of being fatal, as Linux's dptxep.c already does. test_dptx_connect_reply.py compiles the real connect and validate functions, and it fails on main.

Ryan's 27.2 point is a hardware row, not a code change: the check no longer depends on the firmware. So the J475c connect on the 27.2 stub can come after the merge, with a revert ready.

What holds it is the sign-off you raised yourself. 3e914e4 is ytgconsulting's commit, and it carries only your forwarding Signed-off-by. It needs either their own sign-off or their OK here for you to add it. Once that's settled, I'll update the branch and merge when CI is green. The red format-check is base drift in src/sptm_virt_s2r.c, and main has been clean there since 11-20.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 1.

The author sign-off for ytgconsulting is already the open item, and the 27.2 J475c row is already requested. Not repeated. New:

  1. Commit 3e914e4 also carries Assisted-by: Claude:claude-opus-5-5 and Co-Authored-By: Claude Opus 5.5 .... When the commit is re-signed for the author, drop both: commits carry only human Signed-off-by lines. The agent note goes on the last line of the PR body as Assisted-by: LLM (Claude:Opus 5.5), in place of the "Generated with" footer.

Nit, src/dcp/dptx_port_ep.c:189-206: on EPIC v1 the reply's status is never looked at (the check at :190 is v2 only). After this change the target echo is the only thing that can fail a v1 connect. Add resp.status to the new log line, or log it whenever it's non-zero on v1, so that a v1 connect the DCP did reject leaves a trace before the modeset goes ahead.

Checked: v2 behaviour is unchanged (it still sends 0x100 and an echo of 0x100 passes silently), the target mismatch still returns -1, dptxport_validate_connection() keeps its strict check, and the comment matches what Linux's dptxep.c does. The host test exercises the real functions.

HW row: J475c on the 27.2 stub, this head: the connect reply line, HDMI up at boot with no hotplug, 0 failed units, 0 AVCs. Plus one J475d boot showing no new connect reply unk line.

Assisted-by: LLM (Claude:Opus 5.5)

On EPIC v1 firmware (seen on T6021 / J475c, OS firmware 13.5),
dptxport_connect() sends unk 0 and the DCP answers with unk 0:

  DPTXPort: connect v2=0 sent target 0x8040 unk 0; ret 0
            reply unk 0 target 0x8040 reserved 0 status 0

The connect succeeded, but aura required 0x100 and returned -1, so
display_configure() gave up before the modeset and the HDMI output
stayed black until a hotplug. The field echoes the request; Linux
(dptxep.c) only logs a mismatch. Accept an echo or 0x100 and only log
anything else.

Only dptxport_connect() changes; dptxport_validate_connection() always
sends 0x100 and keeps its check. Not needed on J475d (T6022), whose
reply already matched, but harmless there.

tests/python/test_dptx_connect_reply.py compiles the real connect and
validate functions against a stand-in service call.

Ported from omacom/m1n1 59530339 (omacom/m1n1#48)

Signed-off-by: Scott Jones <scottajones@gmail.com>
@scottjones
scottjones force-pushed the upstream/dptx-connect-unk branch from 3e914e4 to b1d3ac4 Compare November 24, 2026 14:43
@github-actions github-actions Bot added changes-requested A reviewer requested changes (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks required sections (bot) labels Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Merge readiness at b1d3ac4a: not ready yet

Check Detail
CI at head ok 17 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes no requested by DjDeveloperr
Hardware row at head ok comment at b1d3ac4a
Conflicts no merge conflicts with main: merge it in (no force push)
PR text adopt when you next edit add a 'Tested:' line; a 'Risk:' line (door and Macs) (guide)

Areas: none matched in CODEOWNERS

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: HOLD at b1d3ac4a7a23
Blockers:

  1. Commit b1d3ac4a7a23 (§4 / docs/licensing.md, prior blocker unfixed): authored by ytgconsulting but still carries only Scott Jones's forwarding Signed-off-by. Add ytgconsulting's own Signed-off-by (or record their explicit permission in this PR).
  2. PR body (§4): delete the trailing attribution footer on the last line of the PR body (zero tool/AI attribution anywhere; do not replace it with an Assisted-by: line). Commit b1d3ac4a7a23 itself is clean of tool trailers.
  3. PR body / evidence (§5): add Tested: and Risk: lines and post hardware + regression rows at the exact head SHA b1d3ac4a7a23 (J475c on the 27.2 / 26B123 stub showing the DPTX connect reply and HDMI up at boot without hotplug, with 0 SELinux denials, 0 failed units, 0 new kernel errors; plus a J475d regression row showing no new connect reply unk log line).
    Checked: interdiff 3e914e48..b1d3ac4a7a23 (identical code diff; commit tool trailers removed), DPTX connect/validate protocol (src/dcp/dptx_port_ep.c:153-208), §1–§6 of pre-PR checklist (§1/§2/§3/§6 pass; §4/§5 blocked), CI at b1d3ac4a7a23.
Evidence
  • Interdiff (3e914e48 -> b1d3ac4a7a23): zero code or test changes; removed tool trailers from the commit message.
  • Code check (src/dcp/dptx_port_ep.c:178-208, tests/python/test_dptx_connect_reply.py): dptxport_connect() preserves resp.target != target rejection and EPIC v2 resp.status error handling, accepts echoed cmd.unk or 0x100, and logs unexpected resp.unk without aborting display setup (matching Linux dptxep.c). dptxport_validate_connection() keeps its strict 0x100 check. Host test compiles and exercises both functions directly.
  • CI at b1d3ac4a7a23: 14/17 passing (build, format-check, policy, selftest, readiness, pr-text with 3 warnings for Tested:/Risk:/body footer, ESP stage 2 vital size, stage1-size gcc/fedora/alarm/nix, Pytest ubuntu-latest+gcc/ubuntu-latest+llvm/ubuntu-24.04-arm); 3 queued (Pytest (macos-26 + llvm-brew), Pytest (macos-15 + llvm-brew), clang-macos).
  • Nit (non-blocking): src/dcp/dptx_port_ep.c:193-205 only checks resp.status on EPIC v2; logging resp.status when non-zero on v1 (or in the mismatch log line) would preserve visibility if v1 firmware rejects a connect.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Two things are left from the reviews: ytgconsulting's own Signed-off-by on b1d3ac4a (or their written OK in this PR), and the J475c run on the 27.2 stub showing the connect reply accepted and HDMI up at boot. I removed the attribution footer from the body.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for working through the earlier review. GitHub now reports a conflict with main at b1d3ac4. If you are already preparing a push for the outstanding review items, could you merge main into your branch within 24 hours using a normal push? Otherwise a maintainer can handle the forward merge. The existing sign-off and J475c firmware 27.2 validation requests still apply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changes-requested A reviewer requested changes (bot) door:two-way Revertible or not, from Merge risk (bot) merge-conflict Conflicts with the base branch (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks required sections (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants