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: 3294cad341 ("egl: Rename dri2_detect_swrast() and also detect kopper")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14331
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Antonio Ospite <antonio.ospite@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38626>
(cherry picked from commit 8a1ea724b4)
This commit is contained in:
Valentine Burley 2025-11-24 13:04:55 +01:00 committed by Eric Engestrom
parent 0b4e4c4231
commit b3a0fa30f7
2 changed files with 3 additions and 2 deletions

View file

@ -3314,7 +3314,7 @@
"description": "egl: Disable kopper on Android",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "3294cad34159bd5317e3dfb0cb4e0ba5caca9f77",
"notes": null

View file

@ -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"));