Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | From a1b59ca6b1781442f37ffc1b697635db126b3a22 Mon Sep 17 00:00:00 2001 |
| 2 | From: Carlos Rafael Giani <dv@pseudoterminal.org> |
| 3 | Date: Thu, 19 Jul 2018 10:30:54 +0200 |
| 4 | Subject: [PATCH] gl: Add switch for explicitely enabling/disabling GBM support |
| 5 | |
| 6 | Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=796833] |
| 7 | |
| 8 | Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org> |
| 9 | --- |
| 10 | m4/gst-gl.m4 | 30 ++++++++++++++++++++++++++++-- |
| 11 | 1 file changed, 28 insertions(+), 2 deletions(-) |
| 12 | |
| 13 | diff --git a/m4/gst-gl.m4 b/m4/gst-gl.m4 |
| 14 | index 1e9724094..aca5295cc 100644 |
| 15 | --- a/m4/gst-gl.m4 |
| 16 | +++ b/m4/gst-gl.m4 |
| 17 | @@ -117,6 +117,15 @@ AC_ARG_ENABLE([dispmanx], |
| 18 | *) AC_MSG_ERROR([bad value ${enableval} for --enable-dispmanx]) ;; |
| 19 | esac],[NEED_DISPMANX=auto]) |
| 20 | |
| 21 | +AC_ARG_ENABLE([gbm], |
| 22 | + [ --enable-gbm Enable Mesa3D GBM support (requires EGL) @<:@default=auto@:>@], |
| 23 | + [case "${enableval}" in |
| 24 | + yes) NEED_GBM=yes ;; |
| 25 | + no) NEED_GBM=no ;; |
| 26 | + auto) NEED_GBM=auto ;; |
| 27 | + *) AC_MSG_ERROR([bad value ${enableval} for --enable-gbm]) ;; |
| 28 | + esac],[NEED_GBM=auto]) |
| 29 | + |
| 30 | AG_GST_PKG_CHECK_MODULES(X11_XCB, x11-xcb) |
| 31 | save_CPPFLAGS="$CPPFLAGS" |
| 32 | save_LIBS="$LIBS" |
| 33 | @@ -172,15 +181,32 @@ case $host in |
| 34 | AC_CHECK_LIB([EGL], [fbGetDisplay], [HAVE_VIV_FB_EGL=yes]) |
| 35 | fi |
| 36 | |
| 37 | - if test "x$HAVE_EGL" = "xyes"; then |
| 38 | + if test "x$NEED_GBM" != "xno"; then |
| 39 | + if test "x$HAVE_EGL" = "xyes"; then |
| 40 | PKG_CHECK_MODULES(DRM, libdrm >= 2.4.55, HAVE_DRM=yes, HAVE_DRM=no) |
| 41 | AC_SUBST(DRM_CFLAGS) |
| 42 | AC_SUBST(DRM_LIBS) |
| 43 | + if test "x$NEED_GBM" = "xyes"; then |
| 44 | + if test "x$HAVE_DRM" = "xno"; then |
| 45 | + AC_MSG_ERROR([GBM support requested but libdrm is not available]) |
| 46 | + fi |
| 47 | + if test "x$HAVE_GUDEV" = "xno"; then |
| 48 | + AC_MSG_ERROR([GBM support requested but gudev is not available]) |
| 49 | + fi |
| 50 | + fi |
| 51 | if test "x$HAVE_DRM" = "xyes" -a "x$HAVE_GUDEV" = "xyes"; then |
| 52 | PKG_CHECK_MODULES(GBM, gbm, HAVE_GBM_EGL=yes, HAVE_GBM_EGL=no) |
| 53 | + if test "x$HAVE_GBM_EGL" = "xno" -a "x$NEED_GBM" = "xyes"; then |
| 54 | + AC_MSG_ERROR([GBM support requested but gbm library is not available]) |
| 55 | + fi |
| 56 | AC_SUBST(GBM_CFLAGS) |
| 57 | AC_SUBST(GBM_LIBS) |
| 58 | - fi |
| 59 | + fi |
| 60 | + elif test "x$NEED_GBM" = "xyes"; then |
| 61 | + AC_MSG_ERROR([GBM support requested but EGL is not available]) |
| 62 | + else |
| 63 | + AC_MSG_NOTICE([GBM support requested but EGL is not available; not enabling GBM support]) |
| 64 | + fi |
| 65 | fi |
| 66 | |
| 67 | dnl FIXME: Mali EGL depends on GLESv1 or GLESv2 |
| 68 | -- |
| 69 | 2.17.1 |
| 70 | |