[PATCH 0/9] uapi: drm: fixes for userspace compilation

Dave Airlie airlied at gmail.com
Tue Nov 17 12:13:48 PST 2015


>
> The kernel UAPI headers:
>  - Used by the kernel modules and userspace(?)
>  - Installed in /usr/include/drm
>  - Many distributions do _not_ ship them
>  - Broken for years (mostly fixed with Mikko's earlier patches)
>  - For the above two reasons - most (all?) userspace uses the libdrm ones.

No userspace uses them at all. Hence why we tend not to care less.

Userspace has never used them, and I'm not sure why userspace would
need to use them at this point.

>
> The libdrm headers:
>  - Mostly preprocessed version of the above, used solely by userspace
>  - Installed in /usr/include/libdrm
>  - All distros ship them
>  - Desperately out of sync wrt the above

I don't think they are that out of sync, it would be impossible for userspace
to use new kernel features if they were that out of sync.

> With the above said:
>  - I was thinking about hiding the UAPI ones, although Dave suggested
> against it.

They are a legitimate kernel API, and show be exposed, probably
should be made more useable outside the kernel, but for now
using them inside the kernel is their primary use case.

>  - Doing s|drm/drm.h|drm.h| will break compilation:
>    + for the kernel - as we don't add the foo/drm/ to the include directive,
>    + for any hacked up userspace - very unlikely that they have the
> include, considering that things work without it.
>  - Differences wrt libdrm userspace - all of which can be handled with
> simple sed
>    + __KERNEL__ never defined so we can just ignore it
>    + __user
>    + drm/drm.h
>    + others ?

The kernel header geneartion script should strip a lot of stuff out,
please look at the headers post kernel install not the ones in the
kernel tree for comparison.

or ones in usr/include/drm inside a built kernel tree.

Dave.


More information about the dri-devel mailing list