aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0010-gl-Add-switch-for-explicitely-enabling-disabling-GBM.patch
blob: 45ba50750d9d2e802679d9f85793ca51c9fdddf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From a1b59ca6b1781442f37ffc1b697635db126b3a22 Mon Sep 17 00:00:00 2001
From: Carlos Rafael Giani <dv@pseudoterminal.org>
Date: Thu, 19 Jul 2018 10:30:54 +0200
Subject: [PATCH] gl: Add switch for explicitely enabling/disabling GBM support

Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=796833]

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
---
 m4/gst-gl.m4 | 30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/m4/gst-gl.m4 b/m4/gst-gl.m4
index 1e9724094..aca5295cc 100644
--- a/m4/gst-gl.m4
+++ b/m4/gst-gl.m4
@@ -117,6 +117,15 @@ AC_ARG_ENABLE([dispmanx],
        *) AC_MSG_ERROR([bad value ${enableval} for --enable-dispmanx]) ;;
      esac],[NEED_DISPMANX=auto])
 
+AC_ARG_ENABLE([gbm],
+     [  --enable-gbm        Enable Mesa3D GBM support (requires EGL) @<:@default=auto@:>@],
+     [case "${enableval}" in
+       yes)  NEED_GBM=yes ;;
+       no)   NEED_GBM=no ;;
+       auto) NEED_GBM=auto ;;
+       *) AC_MSG_ERROR([bad value ${enableval} for --enable-gbm]) ;;
+     esac],[NEED_GBM=auto])
+
 AG_GST_PKG_CHECK_MODULES(X11_XCB, x11-xcb)
 save_CPPFLAGS="$CPPFLAGS"
 save_LIBS="$LIBS"
@@ -172,15 +181,32 @@ case $host in
         AC_CHECK_LIB([EGL], [fbGetDisplay], [HAVE_VIV_FB_EGL=yes])
     fi
 
-    if test "x$HAVE_EGL" = "xyes"; then
+    if test "x$NEED_GBM" != "xno"; then
+      if test "x$HAVE_EGL" = "xyes"; then
         PKG_CHECK_MODULES(DRM, libdrm >= 2.4.55, HAVE_DRM=yes, HAVE_DRM=no)
         AC_SUBST(DRM_CFLAGS)
         AC_SUBST(DRM_LIBS)
+        if test "x$NEED_GBM" = "xyes"; then
+          if test "x$HAVE_DRM" = "xno"; then
+            AC_MSG_ERROR([GBM support requested but libdrm is not available])
+          fi
+          if test "x$HAVE_GUDEV" = "xno"; then
+            AC_MSG_ERROR([GBM support requested but gudev is not available])
+          fi
+        fi
         if test "x$HAVE_DRM" = "xyes" -a "x$HAVE_GUDEV" = "xyes"; then
           PKG_CHECK_MODULES(GBM, gbm, HAVE_GBM_EGL=yes, HAVE_GBM_EGL=no)
+          if test "x$HAVE_GBM_EGL" = "xno" -a "x$NEED_GBM" = "xyes"; then
+            AC_MSG_ERROR([GBM support requested but gbm library is not available])
+          fi
           AC_SUBST(GBM_CFLAGS)
           AC_SUBST(GBM_LIBS)
-       fi
+        fi
+      elif test "x$NEED_GBM" = "xyes"; then
+        AC_MSG_ERROR([GBM support requested but EGL is not available])
+      else
+        AC_MSG_NOTICE([GBM support requested but EGL is not available; not enabling GBM support])
+      fi
     fi
 
     dnl FIXME: Mali EGL depends on GLESv1 or GLESv2
-- 
2.17.1