Skip to content

dri: make KGSL presentation waits opt-in on native Wayland - #112

Merged
lfdevs merged 1 commit into
lfdevs:dev/adreno-mainfrom
KiralyCraft:fix/kgsl-wayland-wait-optout
Oct 29, 2026
Merged

lfdevs merged 1 commit into
lfdevs:dev/adreno-mainfrom
KiralyCraft:fix/kgsl-wayland-wait-optout

Conversation

@KiralyCraft

@KiralyCraft KiralyCraft commented Oct 28, 2026 •

Copy link
Copy Markdown

Disable the present wait fences on Wayland by default, carrying the effect of MESA_DRI3_DISABLE_PRESENT_WAIT_FENCE deeper into the stack. By default, use present wait fences on xWayland and X only until we figure out a clean way to do it on Wayland.

This is a hotfix for issue #111

The DRI3 opt-out disabled the X11 bridge but left KGSL's shared
CPU-completion fallback active. Native Wayland does not use that
bridge, so it continued waiting on every presented buffer.

Carry the presentation policy on each context. Native Wayland EGL
contexts default to the earlier nonblocking behavior; X11 contexts,
including XWayland, keep their existing fenced default. Honor the
same environment override in the shared wait: 1 disables it and 0
keeps the conservative native Wayland wait enabled.

Keeping the policy on the context also covers later attachment
flushes. Resource submission and explicit OpenGL/EGL synchronization
remain intact. This is a compatibility rollback for native Wayland,
not a new implicit synchronization implementation.

Generated-by: LLM
@Dr4kzor

Dr4kzor commented Oct 28, 2026

Copy link
Copy Markdown

Tested on Adreno 830 (Snapdragon 8 Elite) + KDE Plasma Wayland on KWin 6.6.6 in the Anland Ubuntu Resolute 26.04 chroot. glmark2-wayland went from 797 FPS → 4365 FPS with this PR
applied, matching the mesa-26.3.0-devel-20260824 baseline (4454). No visual regressions in the glmark2 subtests. Thanks for the quick hotfix.

@lfdevs

lfdevs commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Since my Adreno 830 device is not rooted, I tested it using Anland Termux in Termux native:

27.0.0-devel-20261025 PR #112
glmark2 1433 1423
MESA_DRI3_DISABLE_PRESENT_WAIT_FENCE=1 glmark2 1377 3797
glmark2-wayland 511 2997

Good job, MESA_DRI3_DISABLE_PRESENT_WAIT_FENCE=1 now works correctly for both X11 and XWayland. Therefore, there's no need to release a separate present wait fence variant. I'll release a revised version after fixing the issue that causes OpenGL to be downgraded to 4.3, and add documentation for the MESA_DRI3_DISABLE_PRESENT_WAIT_FENCE environment variable to the README.

@lfdevs
lfdevs merged commit fde6d7e into lfdevs:dev/adreno-main Oct 29, 2026
8 of 9 checks passed
@lfdevs lfdevs linked an issue Oct 29, 2026 that may be closed by this pull request
lfdevs added a commit that referenced this pull request Oct 29, 2026
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.

6X FPS droped with regression from latest version 27

3 participants