[Mesa-dev] [PATCH v2 18/27] st/omx: fix building against X11-less setups

Emil Velikov emil.l.velikov at gmail.com
Thu May 4 16:33:09 UTC 2017


From: Emil Velikov <emil.velikov at collabora.com>

The vl_*_screen_create API properly falls back to a NOP when we're
building without specific platforms. So the only thing we need is to
handle the lack of X11/Xlib.h and provide a dummy Display define.

Cc: <mesa-stable at lists.freedesktop.org>
Cc: Christian König <christian.koenig at amd.com>
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
Christian,

Do you prefer if we should print an error message, error out, or
continue with the other platform if the requested one is missing?
---
 src/gallium/state_trackers/omx/entrypoint.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/state_trackers/omx/entrypoint.c b/src/gallium/state_trackers/omx/entrypoint.c
index 5afb58be3a3..fa2074ad1b7 100644
--- a/src/gallium/state_trackers/omx/entrypoint.c
+++ b/src/gallium/state_trackers/omx/entrypoint.c
@@ -35,7 +35,13 @@
 #include <string.h>
 #include <stdbool.h>
 
+#if defined(HAVE_X11_PLATFORM)
 #include <X11/Xlib.h>
+#else
+#define XOpenDisplay(x) NULL
+#define XCloseDisplay(x)
+#define Display void
+#endif
 
 #include "os/os_thread.h"
 #include "util/u_memory.h"
-- 
2.12.2



More information about the mesa-dev mailing list