From 8a1ea724b49f0f18a8d4609e9f7ee191a084d718 Mon Sep 17 00:00:00 2001 From: Valentine Burley Date: Mon, 24 Nov 2025 13:04:55 +0100 Subject: [PATCH] egl: Disable kopper on Android Kopper is not supported on Android, and attempting to use it breaks zink on the platform. Disable kopper automatically when running on Android, fixing zink without `LIBGL_KOPPER_DISABLE`. Fixes: 3294cad3415 ("egl: Rename dri2_detect_swrast() and also detect kopper") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14331 Signed-off-by: Valentine Burley Reviewed-by: Yiwei Zhang Reviewed-by: Antonio Ospite Part-of: --- src/egl/drivers/dri2/egl_dri2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 322dc3f790b..bec8af9dbfa 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -542,8 +542,9 @@ dri2_detect_swrast_kopper(_EGLDisplay *disp) { struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); + /* Kopper won't work on Android without extra platform level support. */ dri2_dpy->kopper = dri2_dpy->driver_name && !strcmp(dri2_dpy->driver_name, "zink") && - !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false); + !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false) && disp->Platform != _EGL_PLATFORM_ANDROID; 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"));