Repository navigation
display: hand the T6050 boot framebuffer to the engine that scanned it out - #592
Conversation
9c06a62 to
a31a6a3
Compare
a31a6a3 to
43d0b64
Compare
9468348 to
b401a3c
Compare
b401a3c to
3c89289
Compare
43d0b64 to
1cda231
Compare
… calls The T6050 DCP's firmware 27 hosts its dptx-port RemotePort service on endpoint 0x2c and announces no 0x2a, so dcp_dptx_init() waited on an endpoint that is not there. On that endpoint it also speaks a later message layout, and it makes its own service calls to the AP out of band: the request and the reply are in its buffers, named by address and length in the command, which AFK rejected. Endpoint: use 0x2a where the firmware announces it, as before, and 0x2c where it announces only that (rtkit_has_endpoint(), from the endpoint map the IOP sent). The endpoint is what selects the layout below; no chip or firmware version is checked. On that layout (dcp_dptx_if_t.v27): - the connection is validated before it is taken; - validate-connection and connect replies are eight bytes with no status word; the connect reply echoes the attributes it took, and a port behind a DP-to-HDMI converter does not claim supportsHPD (the AP reports that HPD); - request-display and the hotplug call return no status; hotplug echoes the state it took; - the firmware's group-1 link record calls (3 and 4) carry its own pointers and are returned as given with their result words cleared; drive settings come as a lane count at 16 (set) or 0 (get) and the lanes from 32, checked against DisplayPort's levels before the PHY sees them; tiling hints are a 160-byte record whose status is at 0x90; link fault reports are acknowledged, as on T8152. Out-of-band service calls (command flags bit 0), on any AFKv2 endpoint whose service takes calls: the request is copied from the firmware's tx buffer and the reply to its rx buffer only when every page of each is mapped in the session's DART and lands in RAM (rtkit_access_remote(), nothing is mapped for it), both are at most 16 KiB and the reply fits the command's capacity. The status goes back in the response's value; a failed call returns no bytes. Anything else is still refused as unsupported without touching a firmware address. Before this, every such call was refused. The AFKv2 command's tx buffer is cleaned to memory after it is written and its rx buffer invalidated before it is read, as the firmware's DMA needs on any machine where those buffers are cached. Signed-off-by: Satya Benson <satya@benson.earth>
…t out On a T6050 board without a panel the display handoff gives the boot framebuffer to the external engine whose display DART the device tree gave the display subsystem. When this stage did the modeset itself on another engine, that is the wrong one: on J775c the tree's subsystem names dcpext0's DART (rear USB-C) while HDMI scans out on dcpext1, so dcpext1 is handed over without its framebuffer and Linux finds none. Record the DCP a completed modeset scanned out on, once the swap, the boot-args update and the temporary mapping are done (display_scanout_dcp()), and pass it to the handoff (dt_set_display_scanout()). An external engine named there comes before the device tree's pick. In the same transaction as before it is handed off with the display subsystem and /vram becomes their framebuffer; in addition its display DART (ADT dart-dispextN) is added to the subsystem's iommus when the tree gave the subsystem another one, and the boot framebuffer's simple-framebuffer node gets the engine as its "display". Any failed step leaves every node as it was, as before. Without a modeset of this stage (a NO_DISPLAY stage, or one that only adopted the display) nothing changes. Signed-off-by: Satya Benson <satya@benson.earth>
The HDMI route now takes the crossbar's lowest-numbered engine, dcpext0 on the J775c, which is also the engine whose display DART the device tree gives the display subsystem. The scanout engine still comes first where the two differ; on the J775c the handoff picks the same engine either way. Signed-off-by: Satya Benson <satya@benson.earth>
3c89289 to
f7771e5
Compare
1cda231 to
d86af18
Compare
|
J775c (M5 Max Studio) row for the rebased stack at these heads: #589 Stage 2: Linux: |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: MERGE at d86af18d, after #591 lands under it.
Blockers: none in this PR.
Checked: the scanout engine is recorded only after display_configure() completes, and it only takes effect on the T6050 headless path when the tree has no dcp/disp0 aliases. The engine is matched exactly against /arm-io/dcpextN. The iommus append checks for 2-cell entries and skips a DART already listed. The simple-framebuffer is found by its base and compatible before display is set. Node offsets are looked up again after each write. All of it runs on the scratch copy, so a failure leaves the live tree alone. Other machines only gain the recorded pointer. The J775c row for the rebased stack is at this head, and it shows dcpext0 handed off with the subsystem.
There was a problem hiding this comment.
Verdict: MERGE at d86af18d8736
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: - Audited all production changes (src/display.c, src/display.h, src/kboot.c, src/kboot_display_handoff.c) and verified call ordering in src/kboot.c (dt_set_chosen() at L15304 creates /chosen/framebuffer@<base> before dt_set_display() at L15344 runs dt_set_display_scanout() + dt_set_display_handoff(), followed by dt_publish_live_rtkit() at L15357).
- Verified
display_note_scanout()recordsconf->dcponly afterdisplay_configure()completes swap, boot-args update, and temporary mapping;t6050_scanout_engine()strictly matches/arm-io/dcpext0..Nand runs ahead oft6050_headless_engine(). - Verified transactional atomicity:
t6050_scanout_iommu()andt6050_scanout_simplefb()mutate only thedcp6_scratch(dt)copy insidet6050_headless_publish(), re-resolving node offsets after every property write, so any failure leaves the live FDT untouched. - Verified
t6050_scanout_iommu()validates 2-celliommusentries (len % 8 == 0) and avoids duplicate appends when the scanout engine's DART is already listed;t6050_scanout_simplefb()generates a phandle on the DCP node if absent and verifies"simple-framebuffer"compatibility before writingdisplay. - Hosted CI is green at
d86af18d(policy,ESP stage 2 vital size,selftest,pr-text,readiness), host ASan/UBSan tests (test_t6050_handoff_bounds.py+display_configure()test stand-ins) pass, and exact-head J775c row (#592#issuecomment-7283293944) confirmed `HDMI-A-1 connect
Follow-ups (not blocking): Merge parent #591 first (has CR); code, CI, J775c row clean
Signed-off-by: Satya Benson <satya@benson.earth>
Signed-off-by: Satya Benson <satya@benson.earth>
|
Merged main 2a7854a via the branch below, no conflicts. |
…ache ops Validate reply_size against 32 + count * sizeof(*port->drive) on v27 SET_DRIVE_SETTINGS as well as GET_DRIVE_SETTINGS, preventing a short reply buffer from being overrun when echoing the lane settings. In rtkit_access_remote(), align cache maintenance spans down and up to 64-byte cache lines and use dc_civac_range() on the !to_iop read path so unaligned firmware DVAs never skip trailing cache lines or discard adjacent dirty AP data sharing a boundary line. Extend test_dptx_v27_oob.py to cover both cases. Signed-off-by: Satya Benson <satya@benson.earth>
Signed-off-by: Satya Benson <satya@benson.earth>
|
Merged #591 ( |
|
J775c (M5 Max) row: a Stage 2 built from aura main |
|
J775c (M5 Max Studio) Stage 2 hardware row at the updated heads: #591
|
The base branch was changed.
|
Merging at |
What: On a T6050 board without a panel, the boot framebuffer goes to the external engine this stage's own modeset scanned out on, ahead of the engine whose display DART the device tree gave the display subsystem. It matters wherever the two differ. On J775c they no longer do: the HDMI route (#590) now takes dcpext0, the engine whose DART the tree already gives the subsystem, so there the handoff picks the same engine either way and the new path only adds the simple-framebuffer's
display. Stacked on #591; refs #584.Tested: one J775c row on the previous stack (#590 at 5b5765f) never reached a modeset of its own (#590's route fell back to the internal engine), so this path did not run. No hardware row at this head. Host only: two new cases in
tests/python/test_t6050_handoff_bounds.py(the existing host build ofsrc/kboot_display_handoff.cwith libfdt, ASan/UBSan) fail on its base and pass here; the file's other 155 cases pass unchanged.Risk: two-way · T6050 boards whose device tree has no
dcp/disp0aliases, and only when this stage completed a modeset itself on an external engine. NO_DISPLAY stages and adopted displays are unchanged.Not yet: a J775c HDMI row: the live tree shows
/vramas dcpext0's and the subsystem'sframebuffer, the subsystem'siommusunchanged (dispext0's DART), the simple-framebuffer'sdisplaynaming dcpext0, and Linux's DCP driver finding its boot framebuffer. A row where the scanout engine differs from the tree's pick has no machine yet.Details
display_configure()records the DCP it scanned out on once the swap, the boot-args update and the temporary mapping are done (display_scanout_dcp()); kboot passes it to the handoff (dt_set_display_scanout()) beforedt_set_display_handoff().t6050_scanout_engine(): thedcpextNthat is. It comes beforet6050_headless_engine()'s device-tree pick. The engine is handed off as before (t6050_ext_one()), with the display subsystem,/vramas their framebuffer, in one transaction.iommuslack the engine's display DART (the device-tree node at ADTdart-dispextN's address), it is appended with stream 0; the simple-framebuffer at the boot framebuffer gets the engine's phandle asdisplay(a phandle is generated if the node has none). Any failed step leaves every node as it was.tests/python/test_t8103_iboot_power_status.pyandtest_t8152_display_fb.py: theirdisplay_configure()stand-ins gain the new leaf (display_note_scanout()).Evidence
Cases: with a scanout of its own on dcpext0 and the subsystem given another DART, the engine and subsystem are published with
/vram,iommusbecome<9 0 2 0>, the simple-framebuffer names the engine; without a scanout the same tree hands nothing off; with the subsystem already on the engine's DARTiommusstay<2 0>.clang-format20.1.8 clean. ESP Stage 2 builds.