Repository navigation
Conversation
The driver parks the T1 display at suspend (HID feature report 3 = 1). On the T1 that only sets the brightness factor to 0: the panel stays powered and keeps refreshing, and on a MacBookPro14,3 the right-hand part of the strip strobes for the whole sleep with the lid open. macOS instead evaluates the ACPI method SOCW on the T1's device before sleep (argument 0, host sleep) and after wake (argument 1, host awake), and the T1 powers its display off and back on. Do the same from a system PM notifier: SOCW(0) at PM_SUSPEND_PREPARE and SOCW(1) at PM_POST_SUSPEND, never for hibernation, runtime autosuspend or at probe. The method is discovered once below the T1's USB host controller ACPI node. When SOCW(0) is acknowledged, the suspend callback skips the park; otherwise park stays the sleep path. The state lives in the module, so the awake write is still sent when the USB device re-enumerates over the sleep.
|
Reproduced the dark strip after S3 on a MacBookPro14,2 with stock 0.1.12, Omarchy 4.5.0-3, kernel This branch is not installed here, so this is not a test of the SOCW notifier. |
|
On this MacBookPro14,2, stock t1bridge 0.1.12-1 left the strip dark after S3. Report 3 byte 1 was already The method is in SSDT6 on this machine. The DSDT does not contain it. |
|
@hanscnelson, thanks for the manual One difference from your manual call: the PR sends If you'd like to try the S3 side without building the branch, the sleep hook in omacom/omarchy#11570 (omacom/omarchy#11570 (comment)) sends the same pair from userspace alongside stock 0.1.12; I ran it that way before s2idle. It logs each result, so What I'd most like to know is whether the strip comes back after a |
|
One
The kernel logged The strip was dark at the first look after the lid opened. The keyboard and trackpad were frozen for a bit, then a password login worked. Touch ID was not tried. By the time the session was unlocked the strip was lit. An earlier |
On my MacBookPro14,3, with the lid open, the right-hand part of the Touch Bar strobes for the whole of an s2idle sleep. The suspend callback parks the display (HID feature report 3 = 1), and on the T1 that only sets the display brightness factor to 0: the panel stays powered and keeps refreshing. Writing report 3 = 1 on an awake host gives the same strobe without any sleep (seen on 7.2.8 and 7.2.15).
macOS does not park the display at sleep. It evaluates the ACPI method
SOCWon the T1's device with argument 0 before sleep ("host sleep") and with argument 1 after wake ("host awake"), and the T1 powers its display off and back on. The legacy apple-ibridge driver did the same in its suspend and resume callbacks.This change sends that pair from a system PM notifier:
PM_SUSPEND_PREPAREsendsSOCW(0), andPM_POST_SUSPENDsendsSOCW(1)if this module evaluatedSOCW(0)for that sleep, including when the evaluation failed. Hibernation, runtime autosuspend and probe never evaluateSOCW. The module takes a reference to itself for a sleep it answers, so it is still loaded at the post.SOCWbelow the USB host controller's ACPI node, the same wayt1_cfgselfindsFRST. It is not evaluated at probe.SOCW(0)was acknowledged (result 0), the USB suspend callback skips the park, because the panel is already off. Otherwise the notifier logs the result and the callback parks as before.SOCW(1)is still sent if the T1 re-enumerates over the sleep.Sending
SOCW(0)and thenSOCW(1)on an awake host, with no real sleep between them, left the display dark here until a full power-off, so nothing but the sleep notifier sends it.PM_POST_SUSPENDalso follows an aborted suspend; the awake write is still sent then, because skipping it would leave the display off.How this composes with #47 and #49 is not tested. When
SOCW(0)is acknowledged nothing is parked, so there is nothing to unpark; they still apply to the fallback path.Testing
make -C kernel/appletbdrm-t1 test sanitizepasses, with new cases for the notifier, the park decision, a re-enumerated device, the module reference and init/exit unwinding.W=1without warnings, andmake kernelpasses. I could not runmake quality(no Rust toolchain here), so the Rust and policy stages are left to CI.SOCWsent from userspace. NoSOCWwarning was logged (the driver warns on any non-zero result), report 3 read back awake after resume, which is consistent with the park having been skipped, and the strip was dark without a strobe during the sleep and fully lit after it. Earlier, the same sequence sent from a userspace sleep hook behaved the same way.Not tested: S3, other models, and a re-enumeration across a real sleep.
Refs #18