Skip to content

kernel: apple-dart: Leave a display DART that kept its state alone on resume - #169

Merged
henrikklee merged 1 commit into
OrchardLinux:mainfrom
brkosebay:a9-display-dart-sleep
Nov 18, 2026
Merged

henrikklee merged 1 commit into
OrchardLinux:mainfrom
brkosebay:a9-display-dart-sleep

Conversation

@brkosebay

@brkosebay brkosebay commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

On resume, apple-dart resets every DART and writes the saved TCR and TTBR values back. That is right for a DART inside a PCIe port or another power domain that goes off in sleep, because it loses them. The A9 display DART is not one of those:

  • Its domain (ps_disp0) stays on.
  • The display pipe keeps scanning out through it for the whole sleep.

With translated scanout (#158), the reset turned translation off and cleared the TTBRs under that live scanout before the saved values went back.

The driver now compares the live registers with the saved ones first:

  • A DART that reads back exactly what was saved, with translation set up on at least one stream, kept its state and is left as it is.
  • One that lost power reads its reset values, and is reset and restored as before. The PCIe DARTs are unchanged.

Other devices

This is the shared apple-dart driver. A10: enabled, untested on our side. The A10 display DART also scans out translated since #158, so the same case applies there. Any other DART that loses power in sleep behaves exactly as before.

How to test

On an iPad 5 or an A10 iPad with translated scanout on (the default since #158), as root:

rtcwake -m freeze -s 20
dmesg | grep -iE 'dart.*(fault|reset)|adbe'   # no display DART fault after the wake

The desktop must come back with a correct picture, with no DART fault and no stuck frame. Also check that NVMe and Wi-Fi still work after the wake, since those PCIe DARTs lose power and must still be restored.

Hardware

iPad 5 (J71t), cold boot, Orchard main plus this patch and our other pending iPad 5 patches: Smart Cover, Power-button, idle and RTC sleeps. After every wake, translated scanout went on with no DART fault, and NVMe and Wi-Fi came back.

Release candidate: Orchard main + #167, #168, #169, #170

Cold boot on the iPad 5 (J71t) of current main (89c9640) with exactly these four PRs merged on top, built with main's own kernel/build and apple-16k config, booted with a standard install's options (prepared tree 24ac68ed5ce7ae1c35f4430ea047c291e1403292, 643 patches):

  • The desktop came up on its own, with rotation and Bluetooth.
  • The display DART self-check passed, with scanout through the DART.
  • RTC: woke on time (wake: PMU event(s) 16).
  • Power button: sleep and wake.
  • Smart Cover: a close slept for 114.7 s; the open woke it (wake: PMU event(s) 58, lit in 0.6 ms).
  • Plug: wake: PMU event(s) 72 on plug and on unplug. powerd lights the screen on plug and stays dark on unplug, as iOS does.
  • Panel: the supply was off in every sleep, and the link trained again in 200 ms on every wake.
  • Charging: the grant stayed at 2400 mA across sleep.
  • Wi-Fi worked after every wake.
  • suspend_stats: 6 successes and 1 failure. The failure was a Power press during suspend entry, which aborts the attempt as it should.

…resume

Resume resets every DART and writes the saved TCR and TTBR values back,
because a DART inside a PCIe port or another power domain that goes off
in sleep loses them. The S8003 display DART is not one of those: its
domain (ps_disp0) stays on, and the display pipe keeps scanning out
through it for the whole sleep. The reset turns translation off and
clears the TTBRs under that live scanout before the saved values are
written back.

Compare the live registers with the saved ones first. A DART that reads
back exactly what was saved, with translation set up on at least one
stream, kept its state and is left as it is. One that lost power reads
its reset values and is reset and restored as before, so the PCIe DARTs
are unchanged.

Assisted-by: LLM
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.

2 participants