<div dir="ltr"><div>Yes please!  Assuming it builds (i.e., those are actually in drm_fourcc.h),</div><div><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 16, 2018 at 4:00 PM Eric Anholt <<a href="mailto:eric@anholt.net">eric@anholt.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We should only use a #define locally once it's been upstreamed, and at<br>
that point you should just update our drm_fourcc.h.<br>
---<br>
 src/egl/Android.mk                      |  1 +<br>
 src/egl/Makefile.am                     |  1 +<br>
 src/egl/SConscript                      |  1 +<br>
 src/egl/drivers/dri2/egl_dri2.c         | 28 -------------------------<br>
 src/egl/drivers/dri2/platform_wayland.c |  8 -------<br>
 src/egl/meson.build                     |  2 +-<br>
 6 files changed, 4 insertions(+), 37 deletions(-)<br>
<br>
diff --git a/src/egl/Android.mk b/src/egl/Android.mk<br>
index 8412aeb7984a..11128ded93c8 100644<br>
--- a/src/egl/Android.mk<br>
+++ b/src/egl/Android.mk<br>
@@ -44,6 +44,7 @@ LOCAL_CFLAGS := \<br>
        -DHAVE_ANDROID_PLATFORM<br>
<br>
 LOCAL_C_INCLUDES := \<br>
+       $(MESA_TOP)/include/drm-uapi \<br>
        $(MESA_TOP)/src/egl/main \<br>
        $(MESA_TOP)/src/egl/drivers/dri2<br>
<br>
diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am<br>
index 1a2273b8c316..b43805d991a4 100644<br>
--- a/src/egl/Makefile.am<br>
+++ b/src/egl/Makefile.am<br>
@@ -27,6 +27,7 @@ BUILT_SOURCES =<br>
<br>
 AM_CFLAGS = \<br>
        -I$(top_srcdir)/include \<br>
+       -I$(top_srcdir)/include/drm-uapi \<br>
        -I$(top_srcdir)/src/mapi \<br>
        -I$(top_srcdir)/src/egl/main \<br>
        -I$(top_srcdir)/src/gbm/main \<br>
diff --git a/src/egl/SConscript b/src/egl/SConscript<br>
index 927092d22847..153fdc089234 100644<br>
--- a/src/egl/SConscript<br>
+++ b/src/egl/SConscript<br>
@@ -8,6 +8,7 @@ env = env.Clone()<br>
<br>
 env.Append(CPPPATH = [<br>
     '#/include',<br>
+    '#/include/drm-uapi',<br>
     '#/include/HaikuGL',<br>
     '#/src/egl/main',<br>
     '#/src',<br>
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c<br>
index 27251ed3639d..a2d2d1c86070 100644<br>
--- a/src/egl/drivers/dri2/egl_dri2.c<br>
+++ b/src/egl/drivers/dri2/egl_dri2.c<br>
@@ -65,34 +65,6 @@<br>
 #include "util/u_vector.h"<br>
 #include "mapi/glapi/glapi.h"<br>
<br>
-/* The kernel header drm_fourcc.h defines the DRM formats below.  We duplicate<br>
- * some of the definitions here so that building Mesa won't bleeding-edge<br>
- * kernel headers.<br>
- */<br>
-#ifndef DRM_FORMAT_R8<br>
-#define DRM_FORMAT_R8            fourcc_code('R', '8', ' ', ' ') /* [7:0] R */<br>
-#endif<br>
-<br>
-#ifndef DRM_FORMAT_RG88<br>
-#define DRM_FORMAT_RG88          fourcc_code('R', 'G', '8', '8') /* [15:0] R:G 8:8 little endian */<br>
-#endif<br>
-<br>
-#ifndef DRM_FORMAT_GR88<br>
-#define DRM_FORMAT_GR88          fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */<br>
-#endif<br>
-<br>
-#ifndef DRM_FORMAT_R16<br>
-#define DRM_FORMAT_R16           fourcc_code('R', '1', '6', ' ') /* [15:0] R 16 little endian */<br>
-#endif<br>
-<br>
-#ifndef DRM_FORMAT_GR1616<br>
-#define DRM_FORMAT_GR1616        fourcc_code('G', 'R', '3', '2') /* [31:0] R:G 16:16 little endian */<br>
-#endif<br>
-<br>
-#ifndef DRM_FORMAT_MOD_INVALID<br>
-#define DRM_FORMAT_MOD_INVALID ((1ULL<<56) - 1)<br>
-#endif<br>
-<br>
 #define NUM_ATTRIBS 12<br>
<br>
 static void<br>
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c<br>
index 11026f9fbf4b..294a6eddd606 100644<br>
--- a/src/egl/drivers/dri2/platform_wayland.c<br>
+++ b/src/egl/drivers/dri2/platform_wayland.c<br>
@@ -50,14 +50,6 @@<br>
 #include "wayland-drm-client-protocol.h"<br>
 #include "linux-dmabuf-unstable-v1-client-protocol.h"<br>
<br>
-#ifndef DRM_FORMAT_MOD_INVALID<br>
-#define DRM_FORMAT_MOD_INVALID ((1ULL << 56) - 1)<br>
-#endif<br>
-<br>
-#ifndef DRM_FORMAT_MOD_LINEAR<br>
-#define DRM_FORMAT_MOD_LINEAR 0<br>
-#endif<br>
-<br>
 /*<br>
  * The index of entries in this table is used as a bitmask in<br>
  * dri2_dpy->formats, which tracks the formats supported by our server.<br>
diff --git a/src/egl/meson.build b/src/egl/meson.build<br>
index 5f30bbba89a2..89a84fd89080 100644<br>
--- a/src/egl/meson.build<br>
+++ b/src/egl/meson.build<br>
@@ -24,7 +24,7 @@ inc_egl_dri2 = include_directories('drivers/dri2')<br>
 c_args_for_egl = []<br>
 link_for_egl = []<br>
 deps_for_egl = []<br>
-incs_for_egl = [inc_include, inc_src, inc_egl]<br>
+incs_for_egl = [inc_include, inc_drm_uapi, inc_src, inc_egl]<br>
<br>
 files_egl = files(<br>
   'main/eglapi.c',<br>
-- <br>
2.18.0<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>