Skip to content

Adreno 740 / kgsl: FD_MESA_DEBUG=sysmem causes rendering corruption under Termux:X11 (glmark2 reproducer) #99

Description

@shakeheartbreak

Environment

Retroid Pocket 6, Snapdragon 8 Gen 2 (QCS8550, kalama), Adreno 740, Android 13 (unrooted)
Device kernel 5.15.123-android13-8-g17bf0404b059
Debian trixie under proot-distro (Termux); Termux:X11 with -legacy-drawing
Mesa 26.2.0-devel-20260709 (git-9452d1daec), installed by direct extraction
Also reproduced on 26.2.0-devel-20260610 (git-9c8bdb4f2e)
glmark2 2023.01 (Debian trixie)

Reproducer

Clean:

MESA_LOADER_DRIVER_OVERRIDE=kgsl TU_DEBUG=noconform glmark2 -b build --run-forever

Corrupt — black block-aligned horizontal bands over the scene:

FD_MESA_DEBUG=sysmem MESA_LOADER_DRIVER_OVERRIDE=kgsl TU_DEBUG=noconform glmark2 -b build --run-forever

Frame rate is unchanged between the two (~2,200-2,300 FPS), so only rendering is affected. Not scene-specific.. also reproduces on bump:bump-render=high-poly.

What I've narrowed down here..

Bisected from a sixteen-option set in five runs. These fifteen produce nothing: dclear, ddraw, noscis, nolrz, nolrzfc, nofp16, serialc, noblit, noindirect, nogrow, direct, nobin, notile, noubwc, inorder. Only sysmem does.
gmem is clean at a comparable frame rate (~2,100), so high frame rate alone is not sufficient - the sysmem path is required.
sysmem,gmem behaves as sysmem alone.
sysmem,flush does not help at unchanged frame rate, which argues the race is not at draw submission.
vblank_mode=3, capping presentation at 61fps, renders clean.
zink on Turnip, same device, same Mesa build, same scene: clean.
Note that msm can't be tested here - it falls back to zink silently as there's no accessible DRM render node on unrooted Android.

Filed upstream

I reported this to Mesa as #16189. Rob Clark's assessment was that it's likely an issue with the downstream patches (although he did say he's not familiar with what those are). He also filed #16195 proposing upstream support for Android/proot environments via kopper and said that kopper appears to solve some of these problems.

26.2.0-devel-20260610 already included #69, "Fix Termux:X11 presentation on KGSL", and the fault is present on that build and on 20260709 after two further upstream syncs. So it doesn't appear to be what #69 addressed.

A separate (and possibly related) fault

I also see black band corruption in an OpenGL application on this device under kgsl with no debug flags set. That one has been filed as Mesa #16184. That fault is not sysmem-dependent: it appears with and without the flag. gmem changes its character rather than clearing it - whole-screen flicker at a higher rate, with the band artefacts still present but covering less of the display. Whether the two share a cause, I haven't deduced at the moment. The resemblance is anecdotal only, judged by sight.

Am very happy to run any debug build, environment variable or trace that would help and thanks for your time and effort with this community.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions