Skip to content

[Ubuntu] Fix fenced Present freezes without disabling asynchronous rendering - #3

Merged
lfdevs merged 2 commits into
ubuntu/resolutefrom
dev/ubuntu/present-fence-lifetime
Oct 9, 2026
Merged

lfdevs merged 2 commits into
ubuntu/resolutefrom
dev/ubuntu/present-fence-lifetime

Conversation

@lfdevs

@lfdevs lfdevs commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Variant of PR #2 for Ubuntu 26.04.


  • present: disarm the wait-fence callback before re-execution

    A fence notification is one-shot, but re_execute() can leave the Present request alive while it waits for its target MSC. Clear the callback before re-entering the execution path. If that path must wait again, it installs a new callback itself.

    This is required when the Sync trigger walker restarts after a callback: otherwise a still-live request can be called repeatedly in the same scan. It also prevents a later trigger of a reused fence from executing the old request again.

    The same callback-lifetime correction is used by Termux:X11: KiralyCraft/termux-x11@fc534e5

    (cherry picked from commit 3578597)

  • xwayland: do not reacquire a copied Present pixmap

    After a COPY Present, Idle permits the client to reuse the source pixmap and reset its wait fence for a later frame. The old request may still be queued for its delayed Complete notification. Re-executing that request must not wait for the source again, because that now belongs to a different presentation.

    Waiting a second time can overwrite blocking_event with the old copied request. That request subsequently completes without draining blocked_queue, leaving newer requests blocked indefinitely.

    Only perform acquisition before the copy. The first wait, asynchronous render fences, and delayed completion scheduling are unchanged.

    (cherry picked from commit 99f0115)

A fence notification is one-shot, but re_execute() can leave the Present
request alive while it waits for its target MSC. Clear the callback before
re-entering the execution path. If that path must wait again, it installs
a new callback itself.

This is required when the Sync trigger walker restarts after a callback:
otherwise a still-live request can be called repeatedly in the same scan.
It also prevents a later trigger of a reused fence from executing the old
request again.

The same callback-lifetime correction is used by Termux:X11:
KiralyCraft/termux-x11@fc534e5

(cherry picked from commit cdc4869f26c739e4202169b332f2e3e3117f4571)
After a COPY Present, Idle permits the client to reuse the source pixmap
and reset its wait fence for a later frame. The old request may still be
queued for its delayed Complete notification. Re-executing that request
must not wait for the source again, because that now belongs to a different
presentation.

Waiting a second time can overwrite blocking_event with the old copied
request. That request subsequently completes without draining blocked_queue,
leaving newer requests blocked indefinitely.

Only perform acquisition before the copy. The first wait, asynchronous
render fences, and delayed completion scheduling are unchanged.

(cherry picked from commit a0d3e8912ece5e8435c456a56c4d48d75de3346f)
@lfdevs
lfdevs force-pushed the dev/ubuntu/present-fence-lifetime branch from 16692d7 to 588b1be Compare October 8, 2026 15:34
@lfdevs
lfdevs merged commit aa39f83 into ubuntu/resolute Oct 9, 2026
1 check passed
@lfdevs
lfdevs deleted the dev/ubuntu/present-fence-lifetime branch October 9, 2026 10:51
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