Avoid Pixel HWC deadlock on display disconnect #2

Merged
deusch merged 3 commits from display-hotplug into main 2026-05-10 13:16:19 +02:00
Owner

This changes the AIDL HWC2 compat callback handling so display disconnect hotplug events are delivered from a worker thread instead of directly from the vendor HWC callback stack.

On tegu, the Pixel HWC can emit a hotplug disconnect while holding internal DRM/hotplug state. The libhybris/Mir disconnect path may then re-enter HWC immediately, for example while tearing down display state or disabling vsync, which can deadlock the vendor composer service. Deferring disconnect delivery breaks that synchronous re-entry path.

Connected hotplug events are still delivered synchronously. This is intentional: libhybris/Mir expects the initial primary display to be available before registerCallback() returns. Making connected events async caused startup races like primary display disconnected.

  • Adds a hotplug worker queue to AidlIComposerCallbackWrapper.
  • Queues only DISCONNECTED hotplug events for async delivery.
  • Keeps CONNECTED hotplug events synchronous for startup and reconnect correctness.
  • Adds debug logging around hotplug queueing/delivery and callback wrapper lifecycle.
This changes the AIDL HWC2 compat callback handling so display disconnect hotplug events are delivered from a worker thread instead of directly from the vendor HWC callback stack. On tegu, the Pixel HWC can emit a hotplug disconnect while holding internal DRM/hotplug state. The libhybris/Mir disconnect path may then re-enter HWC immediately, for example while tearing down display state or disabling vsync, which can deadlock the vendor composer service. Deferring disconnect delivery breaks that synchronous re-entry path. Connected hotplug events are still delivered synchronously. This is intentional: libhybris/Mir expects the initial primary display to be available before registerCallback() returns. Making connected events async caused startup races like primary display disconnected. - Adds a hotplug worker queue to AidlIComposerCallbackWrapper. - Queues only DISCONNECTED hotplug events for async delivery. - Keeps CONNECTED hotplug events synchronous for startup and reconnect correctness. - Adds debug logging around hotplug queueing/delivery and callback wrapper lifecycle.
deusch merged commit b849796388 into main 2026-05-10 13:16:19 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ubports/libhybris!2
No description provided.