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

Fabio Estevam festevam at gmail.com
Mon Mar 13 12:47:52 UTC 2017


Hi Gary,

On Mon, Mar 13, 2017 at 6:42 AM, Gary Bisson
<gary.bisson at boundarydevices.com> wrote:
> 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>

I just took a look on this build issue and I think we could fix it like this:

--- a/drm.h
+++ b/drm.h
@@ -24,6 +24,8 @@
 #ifndef _DRM_H
 #define _DRM_H

+#include <libdrm/drm.h>
+#include <libdrm/drm_mode.h>
 #include <xf86drm.h>
 #include <xf86drmMode.h>

This should fix your issue as well as the one I see on my x86 host PC
and also this one on sparc64:
http://autobuild.buildroot.net/results/d7e/d7e82c67e0b04b0aea990bfb19dd6e4fd914bebe/build-end.log

Could you please give it a try?

Regards,

Fabio Estevam


More information about the mesa-dev mailing list