diff --color -rupN old/include/drm/drm.h new/include/drm/drm.h
--- old/include/drm/drm.h	2022-07-07 13:12:41.481382768 +0800
+++ new/include/drm/drm.h	2022-07-07 13:14:27.336035820 +0800
@@ -41,6 +41,11 @@
 #include <asm/ioctl.h>
 typedef unsigned int drm_handle_t;
 
+#elif defined(__lyos__)
+#include <lyos/types.h>
+#include <asm/ioctl.h>
+typedef unsigned int drm_handle_t;
+
 #else /* One of the BSDs */
 
 #include <stdint.h>
diff --color -rupN old/xf86drm.c new/xf86drm.c
--- old/xf86drm.c	2022-07-07 13:12:41.484716035 +0800
+++ new/xf86drm.c	2022-07-07 13:14:48.845647625 +0800
@@ -50,6 +50,7 @@
 #define stat_t struct stat
 #include <sys/ioctl.h>
 #include <sys/time.h>
+#include <sys/syslimits.h>
 #include <stdarg.h>
 #ifdef MAJOR_IN_MKDEV
 #include <sys/mkdev.h>
diff --color -rupN old/xf86drm.h new/xf86drm.h
--- old/xf86drm.h	2022-07-07 13:12:41.484716035 +0800
+++ new/xf86drm.h	2022-07-07 13:15:01.505422309 +0800
@@ -47,7 +47,7 @@ extern "C" {
 #define DRM_MAX_MINOR   16
 #endif
 
-#if defined(__linux__)
+#if defined(__linux__) || defined(__lyos__)
 
 #define DRM_IOCTL_NR(n)		_IOC_NR(n)
 #define DRM_IOC_VOID		_IOC_NONE
