From 308b200350575712371b2d9687dfeb5e2f83fcae Mon Sep 17 00:00:00 2001 From: Ahmad Sayed Alsayed Ebrahim Date: Sat, 10 Oct 2026 05:39:32 +0300 Subject: [PATCH] fix(linuxfs): treat the bridge session's stand-in render node as KGSL in the DRM preload SessionService already exports BL_DRM_STANDIN for Mali bridge sessions; the preload now honours it. Co-Authored-By: Claude Opus 5.5 --- tools/linuxfs/preload/drm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/linuxfs/preload/drm.c b/tools/linuxfs/preload/drm.c index bb4374be0..eff939e4e 100644 --- a/tools/linuxfs/preload/drm.c +++ b/tools/linuxfs/preload/drm.c @@ -42,7 +42,9 @@ static int is_kgsl(int fd) { struct stat st; pthread_mutex_lock(&lock); if (kgsl_state == 0) { - kgsl_state = stat("/dev/kgsl-3d0", &st) == 0 ? 1 : -1; + /* KGSL, or the device the Mali bridge's session names as its render node (BL_DRM_STANDIN). */ + const char *standin = getenv("BL_DRM_STANDIN"); + kgsl_state = stat("/dev/kgsl-3d0", &st) == 0 || (standin && *standin && stat(standin, &st) == 0) ? 1 : -1; kgsl_dev = st.st_rdev; } pthread_mutex_unlock(&lock);