Fix build and require SDL 2.0.15 to hook
This commit is contained in:
parent
a88a3c9ea3
commit
2c2a73e320
2 changed files with 11 additions and 0 deletions
|
|
@ -254,6 +254,7 @@ libdrm {
|
||||||
linux {
|
linux {
|
||||||
message(Master hooks enabled)
|
message(Master hooks enabled)
|
||||||
SOURCES += masterhook.c
|
SOURCES += masterhook.c
|
||||||
|
LIBS += -ldl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
config_EGL {
|
config_EGL {
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,14 @@
|
||||||
#include <xf86drm.h>
|
#include <xf86drm.h>
|
||||||
#include <xf86drmMode.h>
|
#include <xf86drmMode.h>
|
||||||
|
|
||||||
|
// We require SDL 2.0.15+ to hook because it supports sharing
|
||||||
|
// the DRM FD with our code. This avoids having multiple DRM FDs
|
||||||
|
// in flight at the same time which would significantly complicate
|
||||||
|
// the logic here because we'd need to figure out exactly which FD
|
||||||
|
// should be the master at any given time. With the position of our
|
||||||
|
// hooks, that is definitely not trivial.
|
||||||
|
#if SDL_VERSION_ATLEAST(2, 0, 15)
|
||||||
|
|
||||||
// Qt's DRM master FD grabbed by our hook
|
// Qt's DRM master FD grabbed by our hook
|
||||||
int g_QtDrmMasterFd = -1;
|
int g_QtDrmMasterFd = -1;
|
||||||
struct stat64 g_DrmMasterStat;
|
struct stat64 g_DrmMasterStat;
|
||||||
|
|
@ -134,3 +142,5 @@ int close(int fd)
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue