From: Slackware ARM Subject: [PATCH] loader: set original_fd on loader_get_user_preferred_fd early returns loader_get_user_preferred_fd() returns early without setting *original_fd when the preferred device's render node can't be opened, or when drmGetDevice2() fails. Callers initialise the display fd to -1, so it stays -1. On vc4 (Raspberry Pi 4), the display device has no render node, so with DRI_PRIME unset the open of the (empty) render node path always fails. dri3_create_screen() then sees fd_render_gpu != fd_display_gpu, tries to load a driver for fd -1 ("failed to get driver name for fd -1"), and sets can_EXT_texture_from_pixmap = false. Compositors such as xfwm4 then abort in libepoxy: "No provider of glXBindTexImageEXT found". Restore the Mesa 23.x behaviour: default *original_fd to *fd_render_gpu. --- --- a/src/loader/loader.c 2026-11-24 13:35:18.662094691 +0000 +++ b/src/loader/loader.c 2026-11-24 13:35:18.732061699 +0000 @@ -653,6 +653,18 @@ drmDevicePtr render_dev, preferred_dev; bool debug = debug_get_bool_option("DRI_PRIME_DEBUG", false); + /* Default to "no PRIME offload": the display GPU is the render GPU. + * Every early return below leaves the fds untouched, so callers must + * not be left with an unset (-1) original_fd. Without this, a display + * device with no render node (e.g. vc4 on the Raspberry Pi 4, or any + * kmsro split display/render SoC) fails to open the empty render node + * path, returns early, and GLX/EGL then treat -1 as a separate display + * GPU, disabling GLX_EXT_texture_from_pixmap. Mesa 23.x did this on + * its error paths. + */ + if (original_fd) + *original_fd = *fd_render_gpu; + if (drmGetDevice2(*fd_render_gpu, 0, &render_dev) != 0) return false; if (drmGetDevice2(*fd_render_gpu, 0, &preferred_dev) != 0) {