Skip to content

Fix/kgsl present wait fence - #96

Draft
KiralyCraft wants to merge 2 commits into
lfdevs:dev/adreno-mainfrom
KiralyCraft:fix/kgsl-present-wait-fence
Draft

Fix/kgsl present wait fence#96
KiralyCraft wants to merge 2 commits into
lfdevs:dev/adreno-mainfrom
KiralyCraft:fix/kgsl-present-wait-fence

Conversation

@KiralyCraft

@KiralyCraft KiralyCraft commented Aug 15, 2026

Copy link
Copy Markdown

A Codex assisted patch which attempts to fix reading buffers too early and causing flash-to-black issues in scenarios like Firefox GPU-enabled rendering, Minecraft, reVC and others.

I am not 100% sure what is going on here, but I can confirm this works on my Adreno 740 with KGSL with no significant performance drawbacks (-20% on glxgears compared to unfixed version: 1757 fps original vs 1337 with this patch).

This is accompanied by a fix to Termux:X11 where it does not correctly handle some callback disarming: KiralyCraft/termux-x11@fc534e5

EDIT: I do not completely trust what is going on here, but I can confirm it is reliable on my device. It might be better to rework this for better integration and style adaptation.

Keep deferred submit objects alive until KGSL has consumed their command lists and populated the shared kernel timestamp. This prevents BO teardown from freeing GPU addresses that the merged submission still references.
@lfdevs

lfdevs commented Aug 15, 2026

Copy link
Copy Markdown
Owner

In my testing with an Adreno 730 device, when the graphics API of Minecraft Java Edition is OpenGL, the version built by this PR fixes the game screen flickering issue compared to the version before modification. However, the scores of glmark2 and vkmark dropped significantly, so I will not merge this PR for the time being.

It is recommended to keep the PR status as "draft" so that people with similar needs can obtain the build artifacts more easily.

@KiralyCraft

KiralyCraft commented Aug 15, 2026

Copy link
Copy Markdown
Author

Should I investigate a solution which doesn't plummet the performance of glmark2 and vkmark ? Currently, correctness was a greater importance at the cost of performance

EDIT: This does not fix the artifacts in #44

@lfdevs

lfdevs commented Aug 15, 2026

Copy link
Copy Markdown
Owner

EDIT: This does not fix the artifacts in #44

Currently, it seems that the flickering issue is particularly severe on the Adreno 740, and I am unable to reproduce this issue on either Adreno 730 or 830.

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