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
lfdevs added a commit to lfdevs/anland-ci that referenced this pull request Oct 25, 2026
Mesa for Android Container 27.0.0-devel-20261025 版本合并了
PR lfdevs/mesa-for-android-container#96
它主要修复了 X11 下过早读取缓冲区而导致的画面闪黑问题。
合并后,XWayland 需要添加新的补丁,否则运行 OpenGL X11 应用几秒后
便会卡住。补丁来自:
lfdevs/xwayland#2
lfdevs/xwayland#3

Co-authored-by: KiralyCraft <alexucu@gmail.com>
lfdevs added a commit to lfdevs/anland-ci that referenced this pull request Oct 25, 2026
Mesa for Android Container 27.0.0-devel-20261025 版本合并了
PR lfdevs/mesa-for-android-container#96
它主要修复了 X11 下过早读取缓冲区而导致的画面闪黑问题。
合并后,XWayland 需要添加新的补丁,否则运行 OpenGL X11 应用几秒后
便会卡住。新补丁大部分来自:
lfdevs/xwayland#2
lfdevs/xwayland#3

Co-authored-by: KiralyCraft <alexucu@gmail.com>
lfdevs added a commit to lfdevs/anland-ci that referenced this pull request Oct 25, 2026
Mesa for Android Container 27.0.0-devel-20261025 版本合并了
PR lfdevs/mesa-for-android-container#96
它主要修复了 X11 下过早读取缓冲区而导致的画面闪黑问题。
合并后,XWayland 需要添加新的补丁,否则运行 OpenGL X11 应用几秒后
便会卡住。新补丁大部分来自:
lfdevs/xwayland#2
lfdevs/xwayland#3

Co-authored-by: KiralyCraft <alexucu@gmail.com>
lfdevs added a commit to lfdevs/anland-ci that referenced this pull request Oct 25, 2026
Mesa for Android Container 27.0.0-devel-20261025 版本合并了
PR lfdevs/mesa-for-android-container#96
它主要修复了 X11 下过早读取缓冲区而导致的画面闪黑问题。
合并后,XWayland 需要添加新的补丁,否则运行 OpenGL X11 应用几秒后
便会卡住。新补丁大部分来自:
lfdevs/xwayland#2
lfdevs/xwayland#3

Co-authored-by: KiralyCraft <alexucu@gmail.com>
lfdevs added a commit to lfdevs/anland-ci that referenced this pull request Oct 25, 2026
Mesa for Android Container 27.0.0-devel-20261025 版本合并了
PR lfdevs/mesa-for-android-container#96
它主要修复了 X11 下过早读取缓冲区而导致的画面闪黑问题。
合并后,XWayland 需要添加新的补丁,否则声明环境变量 vblank_mode=0
或 vblank_mode=1 时,运行 OpenGL X11 应用几秒便会卡住。新补丁大部分来自:
lfdevs/xwayland#2
lfdevs/xwayland#3

Co-authored-by: KiralyCraft <alexucu@gmail.com>
lfdevs added a commit to lfdevs/anland-ci that referenced this pull request Oct 25, 2026
Mesa for Android Container 27.0.0-devel-20261025 版本合并了
PR lfdevs/mesa-for-android-container#96
它主要修复了 X11 下过早读取缓冲区而导致的画面闪黑问题。
合并后,XWayland 需要添加新的补丁,否则声明环境变量 vblank_mode=0
或 vblank_mode=1 时,运行 OpenGL X11 应用几秒便会卡住。新补丁大部分来自:
lfdevs/xwayland#2
lfdevs/xwayland#3

Co-authored-by: KiralyCraft <alexucu@gmail.com>
lfdevs added a commit to lfdevs/anland-ci that referenced this pull request Oct 26, 2026
Mesa for Android Container 27.0.0-devel-20261025 版本合并了
PR lfdevs/mesa-for-android-container#96
它主要修复了 X11 下过早读取缓冲区而导致的画面闪黑问题。
合并后,XWayland 需要添加新的补丁,否则声明环境变量 vblank_mode=0
或 vblank_mode=1 时,运行 OpenGL X11 应用几秒便会卡住。新补丁大部分来自:
lfdevs/xwayland#2
lfdevs/xwayland#3

Co-authored-by: KiralyCraft <alexucu@gmail.com>
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