-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[not for merging] enhance(main/mesa): Lucas Fryzek and xMeM's freedreno kgsl for mesa
25.1.1
#24840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
… 25.1.1 - This is xMeM@401982b entirely copied and pasted and rebased into `mesa` 25.1.1 and opened as a draft PR so that it's easier to download for people who want it, not necessarily for merging - The original inventor of this code is Lucas Fryzek, whose SurfaceFlinger(ANativeWindow)-compatible version was posted here, https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21570, but who has closed that PR and does not plan to make any more official updates for it - The Termux:X11 port of this code was created by xMeM and uploaded into their repository, but without making any PRs to termux-packages, so the visibility was low - There was a conflict between `0010-fix-zink.patch` and `0015-termux-x11-kgsl.patch`, and I did not really understand what to do, so I merged them into a single patch and guessed at choosing the change from `0015-termux-x11-kgsl.patch` and it works for me - Unfortunately, this driver does not work 100% perfectly. On some devices it does not work, and on devices where it does work, it produces some minor visual artifacts. - Example of a device it **works** on for me: **Samsung Galaxy A70 SM-A705FN with Adreno 612** - Example of a device it **does not work** on for me: **Samsung Galaxy S9 SM-G960U with Adreno 630** - Error: `MESA: error: kgsl_pipe_get_param:103: invalid param id: 13 MESA: error: kgsl_bo_new_dmabuf:251: Failed to allocate dma-buf (Not a typewriter) Segmentation fault` - To use, run Termux:X11 with a desktop environment **outside of proot** as normal, but use the command `export MESA_LOADER_DRIVER_OVERRIDE=kgsl` to activate it instead of the default Zink + Turnip driver, before running OpenGL programs.
@robertkirkman Performance is great based on
And 2025_06_03.00_01.mp4In addition, the following messages are commonly displayed in OpenGL & OpenGL ES environments.
|
@xMeM |
Well this is amazing! Apart from some flickering here and there, i get excellent performance on my rooted samsung galaxy z flip 6 in a devuan chroot!
here is my cmdline: |
Yes, I also get artifacts, and also I had artifacts with this driver with previous versions of Mesa as well. |
Graphical artifacts + perfomance "improvement" mean lacking Vsync or some other sync primitive being used between X server and mesa client. Check if mesa uses fences properly. |
I had a look at the PR, if i'm understanding correctly fences have been removed.
|
That is interesting, could you show what code you tried? I would like to try it also |
I could be wrong... anyway have a look at the PR: there is some code about xshmfence that has been removed from the file /src/gallium/frontends/dri/loader_dri3_helper.c glxinfo works, but it seems to me that glxgears crashes as soon as it outputs one frame I may also have applied the code back and made a mistake while doing it... |
I believe the removal of xshmfence related code is because of this: |
Fixes (partially) Freedreno? #24222 (this driver requested there is experimental and might never become completely finished to the point of working on all devices)
This is xMeM@401982b entirely copied and pasted and rebased into
mesa
25.1.1 and opened as a draft PR so that it's easier to download for people who want it, not necessarily for mergingThe original inventor of this code is Lucas Fryzek, whose SurfaceFlinger(ANativeWindow)-compatible version was posted here, https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21570, but who has closed that PR and does not plan to make any more official updates for it
The Termux:X11 port of this code was created by xMeM and uploaded into their repository, but without making any PRs to termux-packages, so the visibility was low
There was a conflict between
0010-fix-zink.patch
and0015-termux-x11-kgsl.patch
, and I did not really understand what to do, so I merged them into a single patch and guessed at choosing the change from0015-termux-x11-kgsl.patch
and it works for meUnfortunately, this driver does not work 100% perfectly. On some devices it does not work, and on devices where it does work, it produces some minor visual artifacts.
MESA: error: kgsl_pipe_get_param:103: invalid param id: 13 MESA: error: kgsl_bo_new_dmabuf:251: Failed to allocate dma-buf (Not a typewriter) Segmentation fault
To use, run Termux:X11 with a desktop environment outside of proot as normal, but use the command
export MESA_LOADER_DRIVER_OVERRIDE=kgsl
to activate it instead of the default Zink + Turnip driver, before running OpenGL programs.