From 76c50363ddcd13906f699a216e93a05bdedc17f7 Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Wed, 18 Dec 2019 00:27:42 +0100 Subject: [PATCH] kmsdrm: Fix busy-loop within libc's dlopen() For some obscure reason, the order in which the libdrm/libgbm libraries are loaded matters. Without this fix, the first call to check_modesetting() will work and load then unload all symbols properly, but the second call to this function will lock up as soon as dlopen() is called on libdrm. Swapping the order in which the libdrm and libgbm libraries are loaded is enough to fix (or work around?) this issue. Fixes #4891: https://bugzilla.libsdl.org/show_bug.cgi?id=4891 Signed-off-by: Paul Cercueil --- src/video/kmsdrm/SDL_kmsdrmdyn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/kmsdrm/SDL_kmsdrmdyn.c b/src/video/kmsdrm/SDL_kmsdrmdyn.c index f41d624a8..881c77858 100644 --- a/src/video/kmsdrm/SDL_kmsdrmdyn.c +++ b/src/video/kmsdrm/SDL_kmsdrmdyn.c @@ -50,8 +50,8 @@ typedef struct #endif static kmsdrmdynlib kmsdrmlibs[] = { - {NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC}, - {NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM} + {NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM}, + {NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC} }; static void * -- 2.24.0