diff --git a/plugins/platforms/drm/drm_backend.cpp b/plugins/platforms/drm/drm_backend.cpp
index 15310c866e..1589c58f59 100644
--- a/plugins/platforms/drm/drm_backend.cpp
+++ b/plugins/platforms/drm/drm_backend.cpp
@@ -23,6 +23,7 @@ along with this program. If not, see .
#include "cursor.h"
#include "logging.h"
#include "logind.h"
+#include "main.h"
#include "scene_qpainter_drm_backend.h"
#include "screens_drm.h"
#include "udev.h"
diff --git a/plugins/platforms/drm/drm_output.cpp b/plugins/platforms/drm/drm_output.cpp
index 57a19b8cf2..d4c504a395 100644
--- a/plugins/platforms/drm/drm_output.cpp
+++ b/plugins/platforms/drm/drm_output.cpp
@@ -22,12 +22,10 @@ along with this program. If not, see .
#include "composite.h"
#include "logging.h"
+#include "main.h"
#include "screens_drm.h"
#include "virtual_terminal.h"
#include "wayland_server.h"
-#if HAVE_GBM
-#include "egl_gbm_backend.h"
-#endif
// KWayland
#include
#include