Disable the DRM master hooks when EGLFS isn't used

This commit is contained in:
Cameron Gutman
2026-02-05 22:36:31 -06:00
parent f6a9e7694a
commit 0a2b134d49
4 changed files with 31 additions and 1 deletions
+5
View File
@@ -31,6 +31,7 @@
extern int g_QtDrmMasterFd;
extern struct stat g_DrmMasterStat;
extern bool g_DisableDrmHooks;
#define MAX_SDL_FD_COUNT 8
int g_SdlDrmMasterFds[MAX_SDL_FD_COUNT];
@@ -114,6 +115,10 @@ int openHook(typeof(open) *real_open, typeof(close) *real_close, const char *pat
fd = real_open(pathname, flags);
}
if (g_DisableDrmHooks) {
return fd;
}
// If the file was successfully opened and we have a DRM master FD,
// check if the FD we just opened is a DRM device.
if (fd >= 0 && g_QtDrmMasterFd != -1) {