[PATCH 2/3] drm: align #include directives with libdrm in uapi headers

Emil Velikov emil.l.velikov at gmail.com
Wed Mar 30 15:05:20 UTC 2016


On 30 March 2016 at 15:19, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> We can't use <drm/*.h> because that upsets the serach paths in libdrm.
> Also, drop the circular inclusion in drm_mode.h.
>
> v2: Actually change the right headers.
>
> Cc: Emil Velikov <emil.l.velikov at gmail.com>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
>  include/uapi/drm/drm.h      | 2 +-
>  include/uapi/drm/drm_mode.h | 2 --
>  2 files changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> index d299c7749091..c7ecc3abff03 100644
> --- a/include/uapi/drm/drm.h
> +++ b/include/uapi/drm/drm.h
> @@ -685,7 +685,7 @@ struct drm_prime_handle {
>         __s32 fd;
>  };
>
> -#include <drm/drm_mode.h>
> +#include "drm_mode.h"
>
>  #define DRM_IOCTL_BASE                 'd'
>  #define DRM_IO(nr)                     _IO(DRM_IOCTL_BASE,nr)
> diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
> index c0217434d28d..db106ab01039 100644
> --- a/include/uapi/drm/drm_mode.h
> +++ b/include/uapi/drm/drm_mode.h
> @@ -27,8 +27,6 @@
>  #ifndef _DRM_MODE_H
>  #define _DRM_MODE_H
>
> -#include "drm.h"
> -
I'm thinking about the complete inverse actually.

Any program that depends on drm_mode.h but does not include it
explicitly is severely broken. On the other hand, we rely on the drm.h
to resolve the linux specific types (for non-linux platforms).

Unfortunately I've not looked how much busted userspace there is in
either case (this patch vs my suggestion).

-Emil


More information about the dri-devel mailing list