<div dir="ltr">I updated the patch earlier today incorporating the suggestions. I also had to bring back "#include <linux/types.h>" to drm.h because there's some sanity check that fails, as if it doesn't scan past the first level of #includes..<div><br></div><div>- James</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 7, 2020 at 3:14 AM Pekka Paalanen <<a href="mailto:ppaalanen@gmail.com">ppaalanen@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, 07 Dec 2020 10:53:49 +0000<br>
Simon Ser <<a href="mailto:contact@emersion.fr" target="_blank">contact@emersion.fr</a>> wrote:<br>
<br>
> On Monday, December 7th, 2020 at 11:49 AM, James Park <<a href="mailto:james.park@lagfreegames.com" target="_blank">james.park@lagfreegames.com</a>> wrote:<br>
> <br>
> > That would work, but that's kind of an annoying requirement. I would<br>
> > prefer the header to be self-sufficient.  <br>
> <br>
> I don't want to make it more confusing than before, but here Pekka (I<br>
> think) suggests to replace this:<br>
> <br>
> diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h<br>
> index 82f3278..5eb07a5 100644<br>
> --- a/include/uapi/drm/drm_fourcc.h<br>
> +++ b/include/uapi/drm/drm_fourcc.h<br>
> @@ -24,7 +24,11 @@<br>
>  #ifndef DRM_FOURCC_H<br>
>  #define DRM_FOURCC_H<br>
> <br>
> +#ifdef DRM_FOURCC_STANDALONE<br>
> +#include "drm_basic_types.h"<br>
> +#else<br>
>  #include "drm.h"<br>
> +#endif<br>
> <br>
>  #if defined(__cplusplus)<br>
>  extern "C" {<br>
> <br>
> With this:<br>
> <br>
> diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h<br>
> index 82f3278..5eb07a5 100644<br>
> --- a/include/uapi/drm/drm_fourcc.h<br>
> +++ b/include/uapi/drm/drm_fourcc.h<br>
> @@ -24,7 +24,11 @@<br>
>  #ifndef DRM_FOURCC_H<br>
>  #define DRM_FOURCC_H<br>
> <br>
> +#include "drm_basic_types.h"<br>
> +<br>
> +#ifndef DRM_FOURCC_STANDALONE<br>
>  #include "drm.h"<br>
> +#endif<br>
> <br>
>  #if defined(__cplusplus)<br>
>  extern "C" {<br>
> <br>
> That wouldn't change whether the header is self-sufficient or not,<br>
> would it?<br>
<br>
Exactly this.<br>
<br>
This communicates properly that DRM_FOURCC_STANDALONE only affects<br>
whether drm.h gets pulled in or not, and there are no other effects.<br>
<br>
This also makes testing better: when you unconditionally include<br>
drm_basic_types.h, you are more likely to catch breakage there.<br>
<br>
For functionality, it makes no difference. Whether userspace does<br>
<br>
#include "drm.h"<br>
#define DRM_FOURCC_STANDALONE<br>
#include "drm_fourcc.h"<br>
<br>
or<br>
<br>
#define DRM_FOURCC_STANDALONE<br>
#include "drm_fourcc.h"<br>
#include "drm.h"<br>
<br>
the result must always be good.<br>
<br>
<br>
Thanks,<br>
pq<br>
</blockquote></div>