[meta-freescale] [PATCH] libepoxy: Disable glx for i.MX6 machines

Neena Busireddy neena.busireddy at freescale.com
Thu May 21 11:28:53 PDT 2015


libepoxy supports both openGL/GLX and egl.
For i.MX6 machines it is recommended to enable EGL rather than
OpenGL/GLX as GLX is supported only on X11 backend.

Signed-off-by: Neena Busireddy <neena.busireddy at freescale.com>
---
 ...e-EGL-pkgconfig-for-finding-eglplatform.h.patch |  57 +++++++++++
 ...conflicts-between-pkgconfig-s-EGL_LIBS-an.patch |  60 ++++++++++++
 ...-platforms-based-on-configuration-results.patch | 109 +++++++++++++++++++++
 ...0004-add-an-option-to-disable-glx-support.patch |  38 +++++++
 recipes-graphics/libepoxy/libepoxy_%.bbappend      |   7 ++
 5 files changed, 271 insertions(+)
 create mode 100644 recipes-graphics/libepoxy/libepoxy/0001-Use-the-EGL-pkgconfig-for-finding-eglplatform.h.patch
 create mode 100644 recipes-graphics/libepoxy/libepoxy/0002-Avoid-name-conflicts-between-pkgconfig-s-EGL_LIBS-an.patch
 create mode 100644 recipes-graphics/libepoxy/libepoxy/0003-select-platforms-based-on-configuration-results.patch
 create mode 100644 recipes-graphics/libepoxy/libepoxy/0004-add-an-option-to-disable-glx-support.patch
 create mode 100644 recipes-graphics/libepoxy/libepoxy_%.bbappend

diff --git a/recipes-graphics/libepoxy/libepoxy/0001-Use-the-EGL-pkgconfig-for-finding-eglplatform.h.patch b/recipes-graphics/libepoxy/libepoxy/0001-Use-the-EGL-pkgconfig-for-finding-eglplatform.h.patch
new file mode 100644
index 0000000..682dadc
--- /dev/null
+++ b/recipes-graphics/libepoxy/libepoxy/0001-Use-the-EGL-pkgconfig-for-finding-eglplatform.h.patch
@@ -0,0 +1,57 @@
+From 0389905fccd84d7ad4fcf0d5af2824bd6cd66288 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Fri, 13 Jun 2014 14:59:37 -0700
+Subject: [PATCH 1/4] Use the EGL pkgconfig for finding eglplatform.h.
+
+We don't ever explicity link against libEGL, so no need to make use of
+EGL_LIBS.
+
+Fixes #30.
+---
+ configure.ac     | 1 +
+ src/Makefile.am  | 1 +
+ test/Makefile.am | 4 +++-
+ 3 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 399e351..f97c9b0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -98,6 +98,7 @@ AC_SUBST(EPOXY_LINK_LIBS)
+ 
+ AM_CONDITIONAL(BUILD_EGL, test x$build_egl = xyes)
+ if test x$build_egl = xyes; then
++    PKG_CHECK_MODULES(EGL, [egl])
+     AC_DEFINE([BUILD_EGL], [1], [build EGL tests])
+ fi
+ 
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 8e20cd6..49c3507 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -28,6 +28,7 @@ AM_CFLAGS = \
+ 	$(CWARNFLAGS) \
+ 	$(VISIBILITY_CFLAGS) \
+ 	$(X11_CFLAGS) \
++	$(EGL_CFLAGS) \
+ 	$()
+ 
+ epoxyincludedir = $(includedir)/epoxy
+diff --git a/test/Makefile.am b/test/Makefile.am
+index b1dcc18..8665fe8 100644
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -46,7 +46,9 @@ libwgl_common_la_LIBADD = $(EPOXY)
+ AM_CPPFLAGS = \
+ 	-I$(top_srcdir)/include \
+ 	-I$(top_builddir)/include \
+-	$(X11_CFLAGS)
++	$(X11_CFLAGS) \
++	$(EGL_CFLAGS) \
++	$()
+ 
+ AM_CFLAGS = $(CWARNFLAGS)
+ 
+-- 
+2.3.6
+
diff --git a/recipes-graphics/libepoxy/libepoxy/0002-Avoid-name-conflicts-between-pkgconfig-s-EGL_LIBS-an.patch b/recipes-graphics/libepoxy/libepoxy/0002-Avoid-name-conflicts-between-pkgconfig-s-EGL_LIBS-an.patch
new file mode 100644
index 0000000..ba73434
--- /dev/null
+++ b/recipes-graphics/libepoxy/libepoxy/0002-Avoid-name-conflicts-between-pkgconfig-s-EGL_LIBS-an.patch
@@ -0,0 +1,60 @@
+From 8e641d5caecdc4d6d671026360ff85760dbe3a23 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <eric at anholt.net>
+Date: Fri, 13 Jun 2014 15:54:29 -0700
+Subject: [PATCH 2/4] Avoid name conflicts between pkgconfig's EGL_LIBS and a
+ temporary var.
+
+I felt a little uncomfortable knowing I had two things defining
+EGL_LIBS, but it worked on my system.  It failed on the travis ci
+build.
+---
+ test/Makefile.am | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/test/Makefile.am b/test/Makefile.am
+index 8665fe8..c8368a2 100644
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -22,9 +22,9 @@
+ EPOXY = $(builddir)/../src/libepoxy.la
+ 
+ check_LTLIBRARIES = \
+-	$(EGL_LIBS) \
+-	$(GLX_LIBS) \
+-	$(WGL_LIBS) \
++	$(EGL_UTIL_LIB) \
++	$(GLX_UTIL_LIB) \
++	$(WGL_UTIL_LIB) \
+ 	$()
+ 
+ libegl_common_la_SOURCES = \
+@@ -78,7 +78,7 @@ EGL_TESTS = \
+ 	egl_gles2_without_glx \
+ 	$()
+ 
+-EGL_LIBS = libegl_common.la
++EGL_UTIL_LIB = libegl_common.la
+ endif
+ 
+ if BUILD_GLX
+@@ -116,7 +116,7 @@ GLX_TESTS = \
+         $(GLX_NON_APPLE_TESTS) \
+ 	$()
+ 
+-GLX_LIBS = libglx_common.la
++GLX_UTIL_LIB = libglx_common.la
+ endif
+ 
+ if BUILD_WGL
+@@ -127,7 +127,7 @@ WGL_TESTS = \
+ 	wgl_usefontbitmaps_unicode$(EXEEXT) \
+ 	$()
+ 
+-WGL_LIBS = libwgl_common.la
++WGL_UTIL_LIB = libwgl_common.la
+ endif
+ 
+ egl_has_extension_nocontext_LDADD = $(EPOXY) libegl_common.la $(X11_LIBS)
+-- 
+2.3.6
+
diff --git a/recipes-graphics/libepoxy/libepoxy/0003-select-platforms-based-on-configuration-results.patch b/recipes-graphics/libepoxy/libepoxy/0003-select-platforms-based-on-configuration-results.patch
new file mode 100644
index 0000000..1acf4bd
--- /dev/null
+++ b/recipes-graphics/libepoxy/libepoxy/0003-select-platforms-based-on-configuration-results.patch
@@ -0,0 +1,109 @@
+From 49605218875ad0b1b7bc05011f2802e3b47d476e Mon Sep 17 00:00:00 2001
+From: Prabhu <prabhu.sundararaj at freescale.com>
+Date: Wed, 20 May 2015 16:46:33 -0500
+Subject: [PATCH 3/4] select platforms based on configuration results
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Müller <schnitzeltony at googlemail.com>
+
+Signed-off-by: Prabhu <prabhu.sundararaj at freescale.com>
+---
+ configure.ac          | 13 +++++--------
+ src/dispatch_common.c |  9 ++++++---
+ src/dispatch_common.h |  3 ++-
+ 3 files changed, 13 insertions(+), 12 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index f97c9b0..40e02bb 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -58,6 +58,10 @@ AC_CHECK_HEADER([KHR/khrplatform.h],
+ # uintptr_t to a void *") by default.  Kill that.
+ XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
+ 
++PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
++
++AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
++
+ has_znow=yes
+ 
+ case $host_os in
+@@ -86,7 +90,7 @@ case $host_os in
+         ;;
+     *)
+         build_egl=yes
+-        build_glx=yes
++        build_glx=$x11
+         build_wgl=no
+         # On platforms with dlopen, we load everything dynamically and
+         # don't link against a specific window system or GL implementation.
+@@ -144,13 +148,6 @@ esac
+ 
+ AC_SUBST([VISIBILITY_CFLAGS])
+ 
+-PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
+-if test x$x11 = xno -a x$build_glx = xyes; then
+-    AC_MSG_ERROR([libX11 headers (libx11-dev) required to build with GLX support])
+-fi
+-
+-AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
+-
+ PKG_CHECK_MODULES(GL, [gl], [gl=yes], [gl=no])
+ 
+ AC_CONFIG_FILES([
+diff --git a/src/dispatch_common.c b/src/dispatch_common.c
+index 9d17878..f5cea75 100644
+--- a/src/dispatch_common.c
++++ b/src/dispatch_common.c
+@@ -596,10 +596,13 @@ epoxy_get_proc_address(const char *name)
+ #elif defined(__APPLE__)
+     return epoxy_gl_dlsym(name);
+ #else
++#if PLATFORM_HAS_GLX
+     if (epoxy_current_context_is_glx()) {
+         return glXGetProcAddressARB((const GLubyte *)name);
+-    } else {
++    } else
++#endif /* PLATFORM_HAS_GLX */
+ #if PLATFORM_HAS_EGL
++    {
+         GLenum egl_api = epoxy_egl_get_current_gl_context_api();
+ 
+         switch (egl_api) {
+@@ -609,10 +612,10 @@ epoxy_get_proc_address(const char *name)
+         case EGL_NONE:
+             break;
+         }
+-#endif
+     }
++#endif /* PLATFORM_HAS_EGL */
+     errx(1, "Couldn't find current GLX or EGL context.\n");
+-#endif
++#endif /* _WIN32 | __APPLE__*/
+ }
+ 
+ void
+diff --git a/src/dispatch_common.h b/src/dispatch_common.h
+index 28bf533..4c64855 100644
+--- a/src/dispatch_common.h
++++ b/src/dispatch_common.h
+@@ -21,12 +21,13 @@
+  * IN THE SOFTWARE.
+  */
+ 
++#include <config.h>
+ #include <stdbool.h>
+ 
+ #ifdef _WIN32
+ #define PLATFORM_HAS_EGL 0
+ #define PLATFORM_HAS_GLX 0
+-#define PLATFORM_HAS_WGL 1
++#define PLATFORM_HAS_WGL BUILD_WGL
+ #define EPOXY_IMPORTEXPORT __declspec(dllexport)
+ #elif defined(__APPLE__)
+ #define PLATFORM_HAS_EGL 0
+-- 
+2.3.6
+
diff --git a/recipes-graphics/libepoxy/libepoxy/0004-add-an-option-to-disable-glx-support.patch b/recipes-graphics/libepoxy/libepoxy/0004-add-an-option-to-disable-glx-support.patch
new file mode 100644
index 0000000..e707f18
--- /dev/null
+++ b/recipes-graphics/libepoxy/libepoxy/0004-add-an-option-to-disable-glx-support.patch
@@ -0,0 +1,38 @@
+From 689e5595510d2cb5c734dc93430afbd9659d46a7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony at googlemail.com>
+Date: Wed, 6 May 2015 11:05:48 +0200
+Subject: [PATCH 4/4] add an option to disable glx support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+this option would help us in yocto to get deterministic build results
+
+Signed-off-by: Andreas Müller <schnitzeltony at googlemail.com>
+---
+ configure.ac | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 40e02bb..25835cc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -58,7 +58,14 @@ AC_CHECK_HEADER([KHR/khrplatform.h],
+ # uintptr_t to a void *") by default.  Kill that.
+ XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
+ 
+-PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
++AC_ARG_ENABLE([glx],
++                [AS_HELP_STRING([--disable-glx],
++				[disable if you don't want x11/glx support])],
++                [],
++                [enable_glx=yes]
++             )
++
++PKG_CHECK_MODULES(X11, [x11], [x11=$enable_glx], [x11=no])
+ 
+ AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
+ 
+-- 
+2.3.6
+
diff --git a/recipes-graphics/libepoxy/libepoxy_%.bbappend b/recipes-graphics/libepoxy/libepoxy_%.bbappend
new file mode 100644
index 0000000..dd3b67a
--- /dev/null
+++ b/recipes-graphics/libepoxy/libepoxy_%.bbappend
@@ -0,0 +1,7 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+SRC_URI_append_mx6 = " file://0001-Use-the-EGL-pkgconfig-for-finding-eglplatform.h.patch \
+                   file://0002-Avoid-name-conflicts-between-pkgconfig-s-EGL_LIBS-an.patch \
+                   file://0003-select-platforms-based-on-configuration-results.patch \
+                   file://0004-add-an-option-to-disable-glx-support.patch"
+
+EXTRA_OECONF_mx6 += " --disable-glx"
-- 
1.9.1



More information about the meta-freescale mailing list