diff mbox

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

Message ID 1459347584-30566-2-git-send-email-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter March 30, 2016, 2:19 p.m. UTC
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@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 include/uapi/drm/drm.h      | 2 +-
 include/uapi/drm/drm_mode.h | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

Comments

Emil Velikov March 30, 2016, 3:05 p.m. UTC | #1
On 30 March 2016 at 15:19, Daniel Vetter <daniel.vetter@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@gmail.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@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
Daniel Vetter March 30, 2016, 3:11 p.m. UTC | #2
On Wed, Mar 30, 2016 at 04:05:20PM +0100, Emil Velikov wrote:
> On 30 March 2016 at 15:19, Daniel Vetter <daniel.vetter@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@gmail.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@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).

Well I was just blindly aligning the #includes to match what we have right
now in libdrm. That's the safest option really. It would be nice to
untangle this, but I think it's too late for that now :(
-Daniel
Emil Velikov March 30, 2016, 3:22 p.m. UTC | #3
On 30 March 2016 at 16:11, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Wed, Mar 30, 2016 at 04:05:20PM +0100, Emil Velikov wrote:
>> On 30 March 2016 at 15:19, Daniel Vetter <daniel.vetter@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@gmail.com>
>> > Signed-off-by: Daniel Vetter <daniel.vetter@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).
>
> Well I was just blindly aligning the #includes to match what we have right
> now in libdrm. That's the safest option really. It would be nice to
> untangle this, but I think it's too late for that now :(
Sadly that's the case. As I doubt anyone is interested in seeing
existing userspace burn (fail to build), so let's keep the drm_mode.h.
Although let's also keep the drm.h include - it's a way to of being
nice to devs so that they don't need nasty workarounds.

Thanks
Emil
diff mbox

Patch

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"
-
 #define DRM_DISPLAY_INFO_LEN	32
 #define DRM_CONNECTOR_NAME_LEN	32
 #define DRM_DISPLAY_MODE_LEN	32