这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@robertkirkman
Copy link
Member

@robertkirkman robertkirkman commented Sep 19, 2025

@robertkirkman robertkirkman force-pushed the mesa-25.2.3 branch 2 times, most recently from 8455833 to 49e6058 Compare September 19, 2025 18:51
@robertkirkman
Copy link
Member Author

I have bisected the problem with EGL and zink to this,

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014

Faith Elkstrand has heavily changed the code which allows enabling EGL with zink, which was necessary in order to support EGL in zink in nouveau in wayland on PC which previously did not work, so that is very good, but it appears to break EGL in zink in turnip in Adreno 630 in Termux:X11 on Android, causing EGL to switch to llvmpipe for me, so that is unfortunate.

I will try to figure out if i can fix it in any way.

@robertkirkman robertkirkman marked this pull request as draft September 19, 2025 19:35
@robertkirkman
Copy link
Member Author

robertkirkman commented Sep 19, 2025

As an update, I have found a change that I can make that does successfully result in GPU acceleration returning to my device in the edge case of EGL+Zink+Turnip+Termux:X11+Adreno 630,

however, unfortunately, the current change I have been able to write involves hardcoding in such a way that, while it forces Zink to work, it breaks llvmpipe, and undoing my change results in llvmpipe working, but Zink being broken.

I need to try to write my change in a way that can fix the dynamic detection of whether llvmpipe or zink is active and activate/deactivate itself dynamically in response at runtime.

@robertkirkman robertkirkman marked this pull request as ready for review September 19, 2025 23:18
@robertkirkman
Copy link
Member Author

After several hours, I have created a patch that I believe fixes the problem on my device with all cases handled dynamically at runtime (with Turnip installed and also with Turnip uninstalled and also with environment variables set to various things and also with environment variables unset), in a way that successfully carries the current behavior of Mesa 25.1 in Termux forward into Mesa 25.2+ - at least on my device.

I haven't often posted my debugging print messages before, but in this case I feel that it may be helpful, informative, important and necessary for future maintenance for me to show my temporary debugging code as documentation of how I developed my patch.

tool that I created and used to develop 0018-preserve-egl-support-in-zink.patch
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -69,6 +69,7 @@
 #include "util/bitscan.h"
 #include "util/driconf.h"
 #include "util/libsync.h"
+#include "util/log.h"
 #include "util/os_file.h"
 #include "util/u_atomic.h"
 #include "util/u_call_once.h"
@@ -542,8 +542,15 @@ dri2_detect_swrast_kopper(_EGLDisplay *disp)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
 
-   dri2_dpy->kopper = dri2_dpy->driver_name && !strcmp(dri2_dpy->driver_name, "zink") &&
-                      !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false);
+   const char *expected_driver_name = "zink", *excluded_driver_name = "swrast";
+   dri2_dpy->kopper = !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false);
+   if (dri2_dpy->driver_name && !strcmp(dri2_dpy->driver_name, excluded_driver_name)) {
+      mesa_logw("egl_dri2.c dri2_detect_swrast_kopper(): expected driver name '%s', but found excluded driver name '%s'! Disabling kopper...", expected_driver_name, excluded_driver_name);
+      dri2_dpy->kopper = EGL_FALSE;
+   } else if (!(dri2_dpy->driver_name && !strcmp(dri2_dpy->driver_name, expected_driver_name))) {
+      mesa_logw("egl_dri2.c dri2_detect_swrast_kopper(): expected driver name '%s', but found driver name '%s'! Proceeding with enabling kopper anyway...", expected_driver_name, dri2_dpy->driver_name);
+   }
+
    dri2_dpy->swrast = (disp->Options.ForceSoftware && !dri2_dpy->kopper && strcmp(dri2_dpy->driver_name, "vmwgfx")) ||
                       !dri2_dpy->driver_name || strstr(dri2_dpy->driver_name, "swrast");
    dri2_dpy->swrast_not_kms = dri2_dpy->swrast && (!dri2_dpy->driver_name || strcmp(dri2_dpy->driver_name, "kms_swrast"));
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -91,6 +91,7 @@
 #include "util/macros.h"
 #include "util/perf/cpu_trace.h"
 #include "util/u_debug.h"
+#include "util/log.h"
 
 #include "eglconfig.h"
 #include "eglcontext.h"
@@ -693,23 +694,33 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
        * Initialize the display using the driver's function.
        * If the initialisation fails, try again using only software rendering.
        */
+      mesa_logw("BEES1, zink: %d", disp->Options.Zink);
       if (!_eglDriver.Initialize(disp)) {
+         mesa_logw("BEES2");
          if (disp->Options.ForceSoftware)
+         {  mesa_logw("BEES3");
             RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
+         }
          else {
+            mesa_logw("BEES4");
             bool success = false;
             if (!disp->Options.Zink && !getenv("GALLIUM_DRIVER")) {
+               mesa_logw("BEES5");
                disp->Options.Zink = EGL_TRUE;
                success = _eglDriver.Initialize(disp);
             }
             if (!success) {
+               mesa_logw("BEES6");
                disp->Options.Zink = EGL_FALSE;
                disp->Options.ForceSoftware = EGL_TRUE;
-               if (!_eglDriver.Initialize(disp))
+               if (!_eglDriver.Initialize(disp)) {
+                  mesa_logw("BEES7");
                   RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
+	      }
             }
          }
       }
+      mesa_logw("BEES8");
 
       disp->Initialized = EGL_TRUE;
       disp->Driver = &_eglDriver;

@FZXO11
Copy link

FZXO11 commented Sep 20, 2025

@xMeM

@TomJo2000 TomJo2000 mentioned this pull request Sep 28, 2025
8 tasks
@TomJo2000 TomJo2000 linked an issue Sep 28, 2025 that may be closed by this pull request
8 tasks
@TomJo2000
Copy link
Member

Is this ready for merge or do you want to do additional testing?

@robertkirkman
Copy link
Member Author

Is this ready for merge or do you want to do additional testing?

i need to put additional changes in this. i'm kind of waiting for llvm 21 update to be merged because the additional changes depend on llvm 21.

@shiumano
Copy link

When using GPU WebRender in Firefox, I was experiencing graphics artifacts, but I was able to avoid them by disabling EGL.

After installing this PR, graphics artifacts are occurring.

25.1.5-2 gfx.webrender.all=true

egl.mp4

25.1.5-2 gfx.webrender.all=true, gfx.x11-egl.force-disabled=true

now.mp4

25.2.3 gfx.webrender.all=true, gfx.x11-egl.force-disabled=true

new.mp4

@robertkirkman
Copy link
Member Author

robertkirkman commented Sep 29, 2025

It seems unfortunate, I am sorry about that,

What model of GPU do you have (is it the same Adreno 740 device you tested the other PR with?), and if you restart Firefox completely (so that ps -ef shows no more Firefox instances) after setting gfx.x11-egl.force-disabled=true does it make any difference?

Also, do you still have vulkan-wrapper-android also installed, or have you removed it for the test? (keep in mind that if you compiled vulkan-wrapper-android without installing the .deb file it is now untracked in your $PREFIX folder, so it is not easy to remove unless you first install its .deb file from the output folder and then use apt remove vulkan-wrapper-android)

@robertkirkman
Copy link
Member Author

Thank you for the report

  • I have now been able to reproduce that problem exactly as described on my Samsung Galaxy A70 SM-A705FN,
  • Additionally, I have also determined that the problem is also reproducible even when the 0018-preserve-egl-support-in-zink.patch is not applied, by temporarily removing it, recompiling mesa 25.2.3, and testing again, so that indicates that the problem is not caused by anything I did in that patch, and is instead related to a change made somewhere in the upstream Mesa code in between version 25.1.5 and version 25.2.3.

I will proceed forward with a bisection, in order to identify exactly which change in Mesa causes that problem in Firefox, because if I can identify it and the bisected change is not too huge, it might be possible for me to revert it with a patch and restore the functionality of WebRender in Firefox on our devices.

@robertkirkman robertkirkman marked this pull request as draft September 29, 2025 08:56
@hansm629
Copy link

@robertkirkman

  • Host : samsung SM-S926N (Galaxy S26+)
  • SoC : Samsung Exynos 2400 (CPU : ARMv9 10croes / GPU : Samsung Xclipse 940)
  • RAM : 8.5Gbps LPDDR5X 12GB RAM (68.28GB/s)
  • Termux app : 119.0-beta.3

When combined with vulkan-android-wrapper, the Xclipse 940 GPU performs well in most scenarios, except for graphical errors in some OpenGL 3.x recommended programs!

I believe the Xclipse 940 GPU is the only GPU that can complete the glmark2 & glmark2-es2 benchmarks when using vulkan-android-wrapper + mesa!

And virpipe works great too! (Kdenlive and Shotcut, which have broken GUIs in Zink, use virpipe.)
I'll test it on the Galaxy S25 Ultra (Adreno 830 GPU)!

vulkan-android-wrapper + mesa-25.2.3 (zink) xfce4

xfce4

vulkan-android-wrapper + mesa-25.2.3 (zink) glmark2

╭─[hsm @  localhost] [~]
╰─❯ glmark2
ATTENTION: default value of option vblank_mode overridden by environment.
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    zink Vulkan 1.3(Samsung Xclipse 940 (SAMSUNG_PROPRIETARY))
    GL_VERSION:     4.6 (Compatibility Profile) Mesa 25.2.3
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=24 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 480 FrameTime: 2.088 ms
[build] use-vbo=true: FPS: 608 FrameTime: 1.645 ms
[texture] texture-filter=nearest: FPS: 676 FrameTime: 1.480 ms
[texture] texture-filter=linear: FPS: 668 FrameTime: 1.498 ms
[texture] texture-filter=mipmap: FPS: 691 FrameTime: 1.448 ms
[shading] shading=gouraud: FPS: 635 FrameTime: 1.577 ms
[shading] shading=blinn-phong-inf: FPS: 665 FrameTime: 1.505 ms
[shading] shading=phong: FPS: 666 FrameTime: 1.503 ms
[shading] shading=cel: FPS: 623 FrameTime: 1.607 ms
[bump] bump-render=high-poly: FPS: 551 FrameTime: 1.816 ms
[bump] bump-render=normals: FPS: 683 FrameTime: 1.465 ms
[bump] bump-render=height: FPS: 658 FrameTime: 1.522 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 586 FrameTime: 1.708 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 528 FrameTime: 1.895 ms
[pulsar] light=false:quads=5:texture=false: FPS: 550 FrameTime: 1.821 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 445 FrameTime: 2.247 ms
[desktop] effect=shadow:windows=4: FPS: 530 FrameTime: 1.888 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 184 FrameTime: 5.451 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 294 FrameTime: 3.405 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 196 FrameTime: 5.121 ms
[ideas] speed=duration: FPS: 519 FrameTime: 1.930 ms
[jellyfish] <default>: FPS: 441 FrameTime: 2.272 ms
[terrain] <default>: FPS: 278 FrameTime: 3.598 ms
[shadow] <default>: FPS: 471 FrameTime: 2.127 ms
[refract] <default>: FPS: 268 FrameTime: 3.736 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 633 FrameTime: 1.580 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 634 FrameTime: 1.578 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 633 FrameTime: 1.580 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 644 FrameTime: 1.553 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 642 FrameTime: 1.559 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 627 FrameTime: 1.595 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 645 FrameTime: 1.551 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 631 FrameTime: 1.585 ms
=======================================================
                                  glmark2 Score: 543 
=======================================================

vulkan-android-wrapper + mesa-25.2.3 (zink) glmark2-es2

╭─[hsm   localhost] [~]
╰─❯ glmark2-es2
ATTENTION: default value of option vblank_mode overridden by environment.
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    zink Vulkan 1.3(Samsung Xclipse 940 (SAMSUNG_PROPRIETARY))
    GL_VERSION:     OpenGL ES 3.2 Mesa 25.2.3
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=24 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 755 FrameTime: 1.325 ms
[build] use-vbo=true: FPS: 881 FrameTime: 1.136 ms
[texture] texture-filter=nearest: FPS: 802 FrameTime: 1.247 ms
[texture] texture-filter=linear: FPS: 819 FrameTime: 1.222 ms
[texture] texture-filter=mipmap: FPS: 827 FrameTime: 1.209 ms
[shading] shading=gouraud: FPS: 793 FrameTime: 1.262 ms
[shading] shading=blinn-phong-inf: FPS: 796 FrameTime: 1.258 ms
[shading] shading=phong: FPS: 795 FrameTime: 1.258 ms
[shading] shading=cel: FPS: 793 FrameTime: 1.263 ms
[bump] bump-render=high-poly: FPS: 645 FrameTime: 1.551 ms
[bump] bump-render=normals: FPS: 841 FrameTime: 1.190 ms
[bump] bump-render=height: FPS: 826 FrameTime: 1.212 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 677 FrameTime: 1.479 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 681 FrameTime: 1.471 ms
[pulsar] light=false:quads=5:texture=false: FPS: 671 FrameTime: 1.492 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 562 FrameTime: 1.780 ms
[desktop] effect=shadow:windows=4: FPS: 619 FrameTime: 1.617 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 203 FrameTime: 4.929 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 714 FrameTime: 1.401 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 248 FrameTime: 4.047 ms
[ideas] speed=duration: FPS: 588 FrameTime: 1.701 ms
[jellyfish] <default>: FPS: 548 FrameTime: 1.827 ms
[terrain] <default>: FPS: 377 FrameTime: 2.654 ms
[shadow] <default>: FPS: 576 FrameTime: 1.736 ms
[refract] <default>: FPS: 412 FrameTime: 2.430 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 760 FrameTime: 1.316 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 749 FrameTime: 1.336 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 768 FrameTime: 1.303 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 761 FrameTime: 1.316 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 753 FrameTime: 1.329 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 739 FrameTime: 1.355 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 763 FrameTime: 1.312 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 764 FrameTime: 1.310 ms
=======================================================
                                  glmark2 Score: 681 
=======================================================

vulkan-android-wrapper + mesa-25.2.3 (zink) friefox

friefox

virglrenderer-android + mesa-25.2.3 (virpipe) glmark2

╭─[hsm   localhost] [~]
╰─❯ MESA_LOADER_DRIVER_OVERRIDE=virpipe GALLIUM_DRIVER=virpipe VK_ICD_FILENAMES=/dev/null LIBGL_KOPPER_DISABLE=1 EGL_PLATFORM=x11 glmark2
ATTENTION: default value of option vblank_mode overridden by environment.
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    virgl (ANGLE ((Samsung Xclipse 940) on Vulkan 1.3.279))
    GL_VERSION:     4.6 (Compatibility Profile) Mesa 25.2.3
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=32 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[build] use-vbo=false: FPS: 131 FrameTime: 7.692 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[build] use-vbo=true: FPS: 144 FrameTime: 6.951 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[texture] texture-filter=nearest: FPS: 124 FrameTime: 8.094 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[texture] texture-filter=linear: FPS: 136 FrameTime: 7.385 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[texture] texture-filter=mipmap: FPS: 141 FrameTime: 7.108 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[shading] shading=gouraud: FPS: 126 FrameTime: 7.982 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[shading] shading=blinn-phong-inf: FPS: 125 FrameTime: 8.039 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[shading] shading=phong: FPS: 124 FrameTime: 8.070 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[shading] shading=cel: FPS: 122 FrameTime: 8.201 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[bump] bump-render=high-poly: FPS: 105 FrameTime: 9.615 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[bump] bump-render=normals: FPS: 134 FrameTime: 7.490 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[bump] bump-render=height: FPS: 150 FrameTime: 6.681 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 127 FrameTime: 7.888 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 124 FrameTime: 8.110 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[pulsar] light=false:quads=5:texture=false: FPS: 130 FrameTime: 7.724 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 109 FrameTime: 9.235 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[desktop] effect=shadow:windows=4: FPS: 124 FrameTime: 8.093 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 74 FrameTime: 13.599 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 90 FrameTime: 11.159 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 80 FrameTime: 12.616 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[ideas] speed=duration: FPS: 90 FrameTime: 11.125 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[jellyfish] <default>: FPS: 125 FrameTime: 8.015 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[terrain] <default>: FPS: 48 FrameTime: 20.937 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[shadow] <default>: FPS: 111 FrameTime: 9.088 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[refract] <default>: FPS: 54 FrameTime: 18.731 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 136 FrameTime: 7.364 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 126 FrameTime: 7.938 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 138 FrameTime: 7.290 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[function] fragment-complexity=low:fragment-steps=5: FPS: 134 FrameTime: 7.514 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[function] fragment-complexity=medium:fragment-steps=5: FPS: 127 FrameTime: 7.908 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 137 FrameTime: 7.341 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 133 FrameTime: 7.545 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 138 FrameTime: 7.271 ms
=======================================================
                                  glmark2 Score: 117 
=======================================================

virglrenderer-android + mesa-25.2.3 (virpipe) glmark2-es2

╭─[hsm   localhost] [~]
╰─❯ MESA_LOADER_DRIVER_OVERRIDE=virpipe GALLIUM_DRIVER=virpipe VK_ICD_FILENAMES=/dev/null LIBGL_KOPPER_DISABLE=1 EGL_PLATFORM=x11 glmark2-es2
ATTENTION: default value of option vblank_mode overridden by environment.
libEGL warning: egl: failed to create dri2 screen
ATTENTION: default value of option vblank_mode overridden by environment.
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    virgl (ANGLE ((Samsung Xclipse 940) on Vulkan 1.3.279))
    GL_VERSION:     OpenGL ES 3.2 Mesa 25.2.3
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=32 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 99 FrameTime: 10.173 ms
[build] use-vbo=true: FPS: 103 FrameTime: 9.799 ms
[texture] texture-filter=nearest: FPS: 102 FrameTime: 9.807 ms
[texture] texture-filter=linear: FPS: 98 FrameTime: 10.233 ms
[texture] texture-filter=mipmap: FPS: 100 FrameTime: 10.047 ms
[shading] shading=gouraud: FPS: 92 FrameTime: 10.962 ms
[shading] shading=blinn-phong-inf: FPS: 107 FrameTime: 9.429 ms
[shading] shading=phong: FPS: 93 FrameTime: 10.796 ms
[shading] shading=cel: FPS: 98 FrameTime: 10.307 ms
[bump] bump-render=high-poly: FPS: 88 FrameTime: 11.426 ms
[bump] bump-render=normals: FPS: 94 FrameTime: 10.664 ms
[bump] bump-render=height: FPS: 104 FrameTime: 9.681 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 96 FrameTime: 10.499 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 95 FrameTime: 10.536 ms
[pulsar] light=false:quads=5:texture=false: FPS: 97 FrameTime: 10.357 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 86 FrameTime: 11.760 ms
[desktop] effect=shadow:windows=4: FPS: 96 FrameTime: 10.520 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 63 FrameTime: 15.947 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 79 FrameTime: 12.807 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 66 FrameTime: 15.311 ms
[ideas] speed=duration: FPS: 75 FrameTime: 13.458 ms
[jellyfish] <default>: FPS: 92 FrameTime: 10.871 ms
[terrain] <default>: FPS: 44 FrameTime: 22.740 ms
[shadow] <default>: FPS: 91 FrameTime: 11.054 ms
[refract] <default>: FPS: 49 FrameTime: 20.622 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 106 FrameTime: 9.480 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 101 FrameTime: 9.973 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 98 FrameTime: 10.278 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 105 FrameTime: 9.597 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 93 FrameTime: 10.860 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 100 FrameTime: 10.024 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 95 FrameTime: 10.558 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 91 FrameTime: 11.071 ms
=======================================================
                                  glmark2 Score: 89 
=======================================================

virglrenderer-android + mesa-25.2.3 (virpipe) kdenlive

kdenlive

@robertkirkman
Copy link
Member Author

Very good, thank you hansm629, you seem to be using this Mesa 25.2.3's Zink combined with the vulkan-wrapper-android for Vulkan, that is a configuration that doesn't work for any of my own devices, but it's very good that it works for you!

@robertkirkman robertkirkman force-pushed the mesa-25.2.3 branch 2 times, most recently from 6e0e410 to 797acc0 Compare September 30, 2025 04:23
@robertkirkman robertkirkman marked this pull request as ready for review September 30, 2025 04:24
@robertkirkman
Copy link
Member Author

robertkirkman commented Sep 30, 2025

@shiumano I have bisected the change which causes the severe artifacts in Firefox when Webrender is force-enabled and EGL is force-disabled in about:config in Zink + Turnip to https://gitlab.freedesktop.org/mesa/mesa/-/commit/622612f67ea72298c3d85dfe53c5d54ee9f9852 ,

and very luckily, it seems like I have somehow been able to calculate a very small change that appears to fix the problem on my device, without having to revert the entire commit and all conflicting commits after it, but just a small portion of the commit. I have named my attempt to fix this 0019-disable-general-layout-in-zink-for-turnip.patch.

Could you please download the new artifacts and test them on your device, to check whether the patch I have made fixes the problem for you also, or is still happening?

@shiumano
Copy link

As far as I have checked, everything is fine.
Firefox's UI, about:config, and Discord's web pages are all rendering correctly.

Thank you so much!

@robertkirkman robertkirkman force-pushed the mesa-25.2.3 branch 2 times, most recently from e931b10 to d374fcc Compare September 30, 2025 07:18
@robertkirkman
Copy link
Member Author

@hansm629 it doesn't happen for me with those apps with this PR with Zink + Turnip on my Turnip devices,

Screenshot_20250930-122703_TermuxX11

and unfortunately, I don't think I have any devices where Zink (of mesa 25.1.5 or otherwise) works with vulkan-wrapper-android instead of Turnip like it does for you, only some devices where vulkan-wrapper-android works with Vulkan-only programs a little bit,

but if this problem you see doesn't happen for you with the same configuration with Mesa 25.1.5, then I can try to bisect it with you like I bisected the other problems.

@robertkirkman
Copy link
Member Author

@truboxl my PR was approved by upstream Mesa and has been merged, so I have updated it here to match the version that was merged in upstream including my upstream commit message in the patch header. Hopefully this makes what it does clearer. Do you still have any concerns about it?

@robertkirkman robertkirkman changed the title bump(main/mesa): 25.2.3 bump(main/mesa): 25.2.4 Oct 1, 2025
Copy link
Contributor

@truboxl truboxl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like to apologize for my earlier statements. I have horribly misjudged the changes. The packages work correctly on my devices.

@hansm629
Copy link

@robertkirkman
Oh my goodness!

Zink compatibility with vulkan-android-wrapper + Adreno 830 GPU has been significantly improved in mesa-25.2.4!

In mesa-25.2.3, when using vulkan-android-wrapper with Adreno 830 GPU, glmark2 & glmark2-es2 would always crash with a Zink error in the Ideas section. Supertuxkart would crash with a graphical error, and Firefox would crash when running WebGL demos.

But with mesa-25.2.4, things are different!
glmark2 & glmark2-es2 now run to completion.
Supertuxkart runs smoothly without any graphical glitches. (Some artifacts occur)
Most Unity-based WebGL games, including WebGL demos, work perfectly in Firefox!

╭─[hsm @  localhost] [~]
╰─❯ glmark2
ATTENTION: default value of option vblank_mode overridden by environment.
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    zink Vulkan 1.3(Adreno (TM) 830 (QUALCOMM_PROPRIETARY))
    GL_VERSION:     4.6 (Compatibility Profile) Mesa 25.2.4
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=24 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 1376 FrameTime: 0.727 ms
[build] use-vbo=true: FPS: 1536 FrameTime: 0.651 ms
[texture] texture-filter=nearest: FPS: 1594 FrameTime: 0.628 ms
[texture] texture-filter=linear: FPS: 1506 FrameTime: 0.664 ms
[texture] texture-filter=mipmap: FPS: 1556 FrameTime: 0.643 ms
[shading] shading=gouraud: FPS: 1555 FrameTime: 0.643 ms
[shading] shading=blinn-phong-inf: FPS: 1487 FrameTime: 0.673 ms
[shading] shading=phong: FPS: 1365 FrameTime: 0.733 ms
[shading] shading=cel: FPS: 1305 FrameTime: 0.766 ms
[bump] bump-render=high-poly: FPS: 1073 FrameTime: 0.933 ms
[bump] bump-render=normals: FPS: 993 FrameTime: 1.008 ms
[bump] bump-render=height: FPS: 1003 FrameTime: 0.997 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 727 FrameTime: 1.377 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 591 FrameTime: 1.694 ms
[pulsar] light=false:quads=5:texture=false: FPS: 890 FrameTime: 1.124 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 370 FrameTime: 2.704 ms
[desktop] effect=shadow:windows=4: FPS: 601 FrameTime: 1.666 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 288 FrameTime: 3.477 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 438 FrameTime: 2.288 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 323 FrameTime: 3.102 ms
[ideas] speed=duration: FPS: 390 FrameTime: 2.564 ms
[jellyfish] <default>: FPS: 617 FrameTime: 1.622 ms
[terrain] <default>: FPS: 242 FrameTime: 4.139 ms
[shadow] <default>: FPS: 613 FrameTime: 1.633 ms
[refract] <default>: FPS: 312 FrameTime: 3.207 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 843 FrameTime: 1.187 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 846 FrameTime: 1.183 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 1003 FrameTime: 0.998 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 835 FrameTime: 1.198 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 831 FrameTime: 1.204 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 911 FrameTime: 1.098 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 871 FrameTime: 1.149 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 752 FrameTime: 1.330 ms
=======================================================
                                  glmark2 Score: 897 
=======================================================
╭─[hsm @  localhost] [~]
╰─❯ glmark2-es2
ATTENTION: default value of option vblank_mode overridden by environment.
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    zink Vulkan 1.3(Adreno (TM) 830 (QUALCOMM_PROPRIETARY))
    GL_VERSION:     OpenGL ES 3.2 Mesa 25.2.4
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=24 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 1149 FrameTime: 0.871 ms
[build] use-vbo=true: FPS: 1012 FrameTime: 0.989 ms
[texture] texture-filter=nearest: FPS: 1016 FrameTime: 0.985 ms
[texture] texture-filter=linear: FPS: 939 FrameTime: 1.066 ms
[texture] texture-filter=mipmap: FPS: 955 FrameTime: 1.048 ms
[shading] shading=gouraud: FPS: 879 FrameTime: 1.139 ms
[shading] shading=blinn-phong-inf: FPS: 868 FrameTime: 1.152 ms
[shading] shading=phong: FPS: 846 FrameTime: 1.183 ms
[shading] shading=cel: FPS: 855 FrameTime: 1.170 ms
[bump] bump-render=high-poly: FPS: 719 FrameTime: 1.392 ms
[bump] bump-render=normals: FPS: 973 FrameTime: 1.028 ms
[bump] bump-render=height: FPS: 971 FrameTime: 1.030 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 786 FrameTime: 1.274 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 616 FrameTime: 1.626 ms
[pulsar] light=false:quads=5:texture=false: FPS: 918 FrameTime: 1.090 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 417 FrameTime: 2.402 ms
[desktop] effect=shadow:windows=4: FPS: 667 FrameTime: 1.499 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 323 FrameTime: 3.102 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 574 FrameTime: 1.743 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 417 FrameTime: 2.402 ms
[ideas] speed=duration: FPS: 419 FrameTime: 2.389 ms
[jellyfish] <default>: FPS: 678 FrameTime: 1.476 ms
[terrain] <default>: FPS: 305 FrameTime: 3.288 ms
[shadow] <default>: FPS: 647 FrameTime: 1.546 ms
[refract] <default>: FPS: 391 FrameTime: 2.559 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 843 FrameTime: 1.187 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 918 FrameTime: 1.090 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 954 FrameTime: 1.048 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 1213 FrameTime: 0.825 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 848 FrameTime: 1.181 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 832 FrameTime: 1.202 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 804 FrameTime: 1.245 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 798 FrameTime: 1.253 ms
=======================================================
                                  glmark2 Score: 773 
=======================================================
Screenshot_2025-10-14_00-44-58 Screenshot_2025-10-14_asd-44-58

The issues encountered during testing were:

  • Blender couldn't run with Zink (probably due to Zink's OpenGL 3.2 limitations due to the Vulkan driver feature level).
  • Some WebGL demos in Firefox exhibited graphical glitches (I see the demo at https://webglsamples.org/electroShock/application.html)
  • ANGLE or egl couldn't run with Zink in the Chromium browser (seeing Firefox's behavior, this likely stems from a Chromium issue)

Aside from the above issues,
Zink compatibility with the Adreno 830 GPU in the Bionic libc environment seems to be at a practical level!

With a few more mesa updates, full compatibility is expected!

@robertkirkman
Copy link
Member Author

Thank you! that is good news.

I will merge this in 24 hours if no major problems are found.

@truboxl
Copy link
Contributor

truboxl commented Oct 14, 2025

I think bump libclc also

@robertkirkman
Copy link
Member Author

Yes you are correct, thank you I actually didn't notice that one has LLVM_MAJOR_VERSION=20 because for some reason I didn't find it in my initial search for packages with that variable. I will try to bump it now also

- Fixes termux#26526

- Fixes termux#25371

- All patches seemed to only need minor rebasing and no other errors

- Tested working on Samsung Galaxy S9 SM-G960U with Adreno 630

- Add unofficial Adreno 710+720 support found here https://gitlab.freedesktop.org/mesa/mesa/-/issues/13036 and here K11MCH1/freedreno_turnip-CI@db9f6d0

- After https://gitlab.freedesktop.org/mesa/mesa/-/commit/3294cad34159bd5317e3dfb0cb4e0ba5caca9f77, a new change is required in order to preserve GPU acceleration in the edge case of **EGL+Zink+Turnip+Termux:X11+Adreno 630**. I have named this change `0018-preserve-egl-support-in-zink.patch` and it is an original creation based on my ~2 years of experience developing EGL software for running inside Termux:X11 on Samsung Galaxy S9 SM-G96U with Adreno 630. **Unfortunately, I do not know what the effects of this patch will be on other devices that I do not have, so please tell me ASAP if it appears to break Zink on your device**.

- After https://gitlab.freedesktop.org/mesa/mesa/-/commit/622612f67ea72298c3d85dfe53c5d54ee9f98527, the default behavior of Zink is to enable the "general layout" mode whenever Turnip is detected. In testing in Termux:X11 on Samsung Galaxy A70 SM-A705FN, that change is incorrect and results in severe artifacts in Firefox when Firefox has `gfx.webrender.all=true` and `gfx.x11-egl.force-disabled=true` set in `about:config`, so `0019-disable-general-layout-in-zink-for-turnip.patch` must be created to forcibly stop Zink from enabling "general layout" mode when Turnip is detected.
@robertkirkman
Copy link
Member Author

robertkirkman commented Oct 14, 2025

I built libclc bump successfully locally, but unfortunately it can't currently be uploaded successfully because this series of PRs by @TomJo2000 is not yet finished:

@truboxl not sure if it is best for me to not bump libclc and remove it from this until after the linter changes are finished, or if I should temporarily disable the linter or something for this PR and merge it, then re-enable the linter again separately afterward, if you have an idea of what is best to do then I would be thankful to hear it.

…ion `check_version_change()`

- IMPORTANT: revert this commit when `check_version_change()` is fixed!
@robertkirkman
Copy link
Member Author

The current version of the new linter function check_version_change() unfortunately prevents bumping libclc,

but since libclc and mesa are high-priority to bump after the update of libllvm which is already merged, and the build.sh of libclc is correct and shouldn't be changed to force the linter's unintended behavior to pass, I don't see any other option than to temporarily disable that part of lint-packages.sh in order to merge this PR.

I hope that is ok with TomJo2000 and that they will understand to remove the stubout return of the check_version_change() function in their PR when they finish the function.

@TomJo2000
Copy link
Member

I built libclc bump successfully locally, but unfortunately it can't currently be uploaded successfully because this series of PRs by @TomJo2000 is not yet finished:

I'm still having trouble reliably replicating the issue, I'm looking into it again now.

@TomJo2000
Copy link
Member

You can go ahead and disable the check_version function in the linter until I figured out a permanent solution if it's blocking this PR.

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

Labels

None yet

Projects

None yet

7 participants