Repository navigation
kernel: iPad 5: Switch the panel off in system sleep, as iOS does - #170
Merged
Merged
Conversation
…ransmitter and panel supply On the A9, iOS switches the panel off whenever the display sleeps: the DisplayPort driver drops the panel's supply (the Apple device tree's function-lcd_ldo on the displayport node) and trains the eDP link again when it comes back. Allow the DisplayPort transmitter's register window as a ninth "dp" region, the panel supply as apple,lcd-ldo-gpios and the panel's backlight, so the display pipe's driver can do the same in system sleep. The A10's pipe has neither. Assisted-by: LLM
In s2idle the iPad 5 panel stayed powered: the pipe kept scanning out the black boot framebuffer to a panel whose TCON and source drivers ran on, with only the backlight off. iOS turns the panel off on every display sleep. AppleDPDisplayPowerController drops lcd_ldo, keeps it off at least 125 ms, and on enable waits for hot-plug detect (expected within 67 ms) and lets the backlight on no earlier than 193 ms after the supply. The DisplayPort driver, an Analogix DP core (AppleANXDPTX), then trains the link again. Its event log on J71t shows a no-handshake (fast) training at the link the boot loader set up: 4 lanes, 1.62 Gb/s, enhanced framing, swing 0, pre-emphasis 0, ASSR on. Do the same around system sleep, leaving the pipe and the transmitter as the boot loader set them up; only the sink loses power: - Before the first sleep, look up the supply and the backlight, and order sleep so that the pipe suspends before the PMU GPIO (behind I2C) and the backlight resumes after the pipe. Neither holds up probe. - At suspend, after the CRTC is off and the pipe shows the black boot framebuffer, the supply goes off only if the live link passes every check the wake needs: AUX reads of the receiver capabilities and of the sink's link configuration, a lane status that reads trained, a sink that allows no-handshake training, a sink whose scrambler seed mode (ASSR) matches the transmitter's (0x614 bit 0), and a supply that reads on and then off. Otherwise the panel stays on for that sleep, with the reason logged. 50 ms after the supply goes off, the hot-plug detect level and one AUX read are logged as a witness that the sink went away. - On resume, before the CRTC is restored: supply on after the 125 ms minimum (counted in boot time: s2idle stops the monotonic clock), wait for hot-plug detect, read the capabilities back over AUX, write the saved link configuration (D0, ASSR as the transmitter has it, downspread, rate, lane count), send TPS1 then TPS2 with the transmitter and the DPCD, then check the lane status. A failed wake retries the whole sequence twice. If the panel still does not come back, the backlight is held off, the supply is left on and panel-off sleeps stop. AUX follows iOS's readDPCDGated/writeDPCDGated. Unlike the Analogix layout, the request nibble sits next to address bits 19:16 at 0x7a0, the length at 0x794, the data at 0xc00, and the buffer clears with 0x790 bit 9. Completion is DP_INT_STA bit 1, an error bit 0 with the cause in AUX_CH_STA. sleep_panel_off=0 keeps the panel on in sleep, as before. The debugfs file adbe_panel runs the pre-sleep checks on demand, with AUX reads only, so their result can be seen before any sleep. Assisted-by: LLM
…mitter window The display pipe's driver trains the eDP link again after a sleep with the panel off. Add the DisplayPort transmitter's registers (ADT displayport, 0x206700000, "displayport,s8003") to the pipe as its "dp" window. The transmitter is in the dp power domain the pipe already holds. Assisted-by: LLM
…ply and backlight The ADT displayport node's function-lcd_ldo is PMU GPIO 22 on every iPad 5 board: the panel supply, which iOS switches off when the display sleeps. Hand it and the DWI backlight to the display pipe, which now turns the panel off in system sleep. Both are post-init providers: the pipe's probe does not wait for the PMU or the backlight, and the driver looks them up before the first sleep. Line 22 is no longer reserved. Assisted-by: LLM
This was referenced Nov 18, 2026
… switches Rework of OrchardLinux#170 on current main: - Renumber after main: drivers/drm 0010 (binding) and 0011 (driver), whose 0009 collided with OrchardLinux#166's; devices/s800x 0003. - drm/adbe: the transmitter's AUX channel is a struct drm_dp_aux with a transfer hook; DPCD access, retries, the capability and link status reads, the lane checks and DP_SET_POWER come from the shared DP helpers. The no-handshake TPS1/TPS2 sequence stays in the driver: it drives the transmitter's own training pattern register and the helpers have none. - Panel-off sleep is unconditional wherever the device tree gives the panel supply: the sleep_panel_off parameter, the adbe_panel debugfs file, the post-power-off witness read and the info-level logging are gone (gate reasons are dev_dbg). - The binding no longer forbids the panel supply on the A10 and allows the "dp" window there too; the T8010 device trees are unchanged until their supply line is known. - The driver selects DRM_DISPLAY_DP_HELPER (configs updated). Assisted-by: LLM
Contributor
|
Thanks, Berkay. I rebased this onto main (after #166, #167, #168) and reworked it before merging, so it needs one run on your iPad 5 first:
Could you build this branch and check on the iPad 5: a few Power-button and Smart Cover sleeps, the panel really off during sleep, and a clean picture after every wake (no garbling, no black screen)? If the AUX transfer misbehaves, a |
Contributor
Author
|
Tested your rework on the iPad 5 (J71t). The kernel was this branch at
Good to merge from my side. |
This was referenced Nov 18, 2026
henrikklee
added a commit
that referenced
this pull request
Nov 19, 2026
brkosebay's J71t results across #28 (bring-up checks), #118 (Smart Cover), #124 (install), #167 (charging grant), #168 and #170 (sleep) and omarchy-a#65 (Bluetooth controller): screen off, backlight, touch, the Power button, NVMe read and write, Wi-Fi, Bluetooth input, battery, charging and its grant, suspend and resume. Each line names its source. Bluetooth audio and the microphones stay untested: no J71t result on Orchard yet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #168. Only the last 4 commits are new in this PR.
In s2idle the iPad 5's panel stayed powered. The pipe kept scanning out a black framebuffer to a panel whose TCON and source drivers ran on, with only the backlight off. iOS turns the panel off on every display sleep:
lcd_ldoand keeps it off for at least 125 ms.This series does the same around system sleep. The pipe and the transmitter stay as the boot loader set them up; only the sink loses power.
apple,lcd-ldo-gpios(the ADT displayportfunction-lcd_ldo) andbacklight. The A10's pipe does not takeapple,lcd-ldo-gpios.apple_adbe_drm.sleep_panel_off=0keeps the panel on in sleep. The debugfs fileadbe_panelruns the pre-sleep checks on demand.Other devices
displayport,t8010, 0x4000 window) has not been read in an A10 kernelcache. Enabling it would mean AUX traffic at unverified offsets on a live link, so the A10 stays as it is. The driver changes nothing withoutapple,lcd-ldo-gpios.How to test
On an iPad 5 (J71t/J72t), as root:
The screen must come back with a correct picture after every wake. To compare with the panel left on:
echo 0 > /sys/module/apple_adbe_drm/parameters/sleep_panel_off.Hardware
iPad 5 (J71t), cold boot, on a development kernel with Orchard main plus the same panel-off patch:
That kernel had our own earlier version of the display-DART patches. On main,
adbe_drv.ccomes from the merged #158, so this patch was rebased onto it. Only the file's header comment and include list differed.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/buildand apple-16k config, booted with a standard install's options (prepared tree 24ac68ed5ce7ae1c35f4430ea047c291e1403292, 643 patches):wake: PMU event(s) 16).wake: PMU event(s) 58, lit in 0.6 ms).wake: PMU event(s) 72on plug and on unplug. powerd lights the screen on plug and stays dark on unplug, as iOS does.suspend_stats: 6 successes and 1 failure. The failure was a Power press during suspend entry, which aborts the attempt as it should.