[Mesa-dev] [PATCH] drm-atomic: Include <libdrm/drm_mode.h> header file

Gary Bisson gary.bisson at boundarydevices.com
Mon Mar 13 09:42:40 UTC 2017


Include <libdrm/drm_mode.h> header file to fix the following build
error:
drm-atomic.c: In function ‘get_plane_id’:
drm-atomic.c:290:44: error: ‘DRM_MODE_OBJECT_PLANE’ undeclared (first
use in this function)
     drmModeObjectGetProperties(drm.fd, id, DRM_MODE_OBJECT_PLANE);

This error only happens when using a toolchain with kernel headers
< 4.7 since the DRM_MODE_OBJECT_* have been moved to uapi headers
in 4.7 [1].

This error was therefore seen with Linaro 2017.02 ARM gnueabihf
toolchain [2].

It has been tested that this patch doesn't affect users using a
toolchain with headers >= 4.7.

[1] http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=8812f38141
[2] https://releases.linaro.org/components/toolchain/binaries/latest-6/arm-linux-gnueabihf/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf.tar.xz

Signed-off-by: Gary Bisson <gary.bisson at boundarydevices.com>
---
Hi all,

This issue was discovered using Buildroot and discussed here:
http://lists.busybox.net/pipermail/buildroot/2017-March/186282.html

Let me know if you'd rather have another solution for this problem.

Regards,
Gary
---
 drm-atomic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drm-atomic.c b/drm-atomic.c
index 0b38c32..7c353f5 100644
--- a/drm-atomic.c
+++ b/drm-atomic.c
@@ -23,6 +23,7 @@
 
 #include <assert.h>
 #include <errno.h>
+#include <libdrm/drm_mode.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-- 
2.11.0



More information about the mesa-dev mailing list