Skip to contentSkip to conversation

drm: guard Linux-specific headers behind check in drm_mode.h

PATCH In review Simon Ser 1 participant 2 messages Oct 25 – Nov 29

Subsystems (2)
lore
Share & tools
lore

Simon Ser

author
#0 lore raw

PATCH 1/1 drm: guard Linux-specific headers behind check in drm_mode.h

Non-Linux systems (e.g. FreeBSD) ship drm_mode.h but don't have Linux headers. This causes build failures [1].

Guard Linux-specific header #include behind Linux checks (kernel and user-space). The macros depending on these headers are not usable, but this at least unblocks libdrm upgrades. A future patch may re-implement the required macros.

[1]: https://gitlab.freedesktop.org/mesa/libdrm/-/merge_requests/462#note_3473512

Fixes 4c684596cde4 ("drm: Add CRTC background color property")
Cc Cristian Ciocaltea <[email protected]>
Cc Matt Roper <[email protected]>
Cc Nícolas F. R. A. Prado <[email protected]>
Cc Daniel Stone <[email protected]>
---
 include/uapi/drm/drm_mode.h | 2 ++
 1 file changed, 2 insertions(+)
include/uapi/drm/drm_mode.h +2 -0
index ed1a660a3dfd..b0e3d8c4df9f 100644
@@ -10,8 +10,10 @@
 #ifndef _DRM_MODE_H
 #define _DRM_MODE_H
 
+#if defined(__KERNEL__) || defined(__linux__)
 #include <linux/bits.h>
 #include <linux/const.h>
+#endif
 
 #include "drm.h"
 
Signature · 1 line
2.56.0
author
#1 lore raw

Hi, could anyone review this patch? It's blocking libdrm header upgrades.