[PATCH] Adding --enable-egl-dri2-x11&drm option.

Arthur Zhu xiaoxiaomuyusajiangtian at gmail.com
Sun Feb 6 21:50:55 PST 2011


---
 configure.ac |   34 +++++++++++++++++++++-------------
 1 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/configure.ac b/configure.ac
index 46938f4..18c2731 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1091,6 +1091,20 @@ if test "x$enable_egl" =3D xno; then
         AC_MSG_ERROR([cannot enable OpenVG without EGL])
     fi
 fi
+
+AC_ARG_ENABLE([egl-dri2-x11],
+    [AS_HELP_STRING([--enable-egl-dri2-x11],
+        [enable EGL egl-dri2-x11 driver,
+        Just omits libudev package checking. @<:@default=3Ddisabled@:>@])]=
,
+    [enable_egl_dri2_x11=3D"$enableval"],
+    [enable_egl_dri2_x11=3Dno])
+
+AC_ARG_ENABLE([egl-dri2-drm],
+    [AS_HELP_STRING([--enable-egl-dri2-drm],
+        [enable EGL egl-dri2-drm driver. @<:@default=3Ddisabled@:>@])],
+    [enable_egl_dri2_drm=3D"$enableval"],
+    [enable_egl_dri2_drm=3Dno])
+
 if test "x$enable_egl" =3D xyes; then
     SRC_DIRS=3D"$SRC_DIRS egl"
     EGL_LIB_DEPS=3D"$DLOPEN_LIBS -lpthread"
@@ -1100,20 +1114,14 @@ if test "x$enable_egl" =3D xyes; then
         if test "$mesa_driver" =3D xlib -o "$mesa_driver" =3D dri; then
             EGL_DRIVERS_DIRS=3D"glx"
         fi
-
-        if test "$mesa_driver" =3D dri; then
+        if test "x$enable_egl_dri2_x11" =3D xyes -o "x$enable_egl_dri2_drm=
" =3D
xyes -a "$mesa_driver" =3D dri; then
             # build egl_dri2 when xcb-dri2 is available
-            PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes],
-                      [have_xcb_dri2=3Dyes],[have_xcb_dri2=3Dno])
-            PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
-                      [have_libudev=3Dyes],[have_libudev=3Dno])
-
-            if test "$have_xcb_dri2" =3D yes; then
-                EGL_DRIVER_DRI2=3Ddri2
-                DEFINES=3D"$DEFINES -DHAVE_XCB_DRI2"
-                if test "$have_libudev" =3D yes; then
-                    DEFINES=3D"$DEFINES -DHAVE_LIBUDEV"
-                fi
+            PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes])
+            EGL_DRIVER_DRI2=3Ddri2
+            DEFINES=3D"$DEFINES -DHAVE_XCB_DRI2"
+            if test "x$enable_egl_dri2_drm" =3D xyes; then
+                PKG_CHECK_MODULES([LIBUDEV], [libudev > 150])
+                DEFINES=3D"$DEFINES -DHAVE_LIBUDEV"
             fi
     fi

--=20
1.7.0.4


Arthur


2011/2/3 Kristian H=F8gsberg <krh at bitplanet.net>

> On Thu, Feb 3, 2011 at 9:15 AM, Dan Nicholson <dbn.lists at gmail.com> wrote=
:
> > On Thu, Feb 3, 2011 at 5:26 AM, Arthur Zhu
> > <xiaoxiaomuyusajiangtian at gmail.com> wrote:
> >>
> >> Thanks your good suggestions.
> >>
> >> Arthur
> >>
> >>
> >> From 7034307045f1d334e25adf7f739c5144a9afcb46 Mon Sep 17 00:00:00 2001
> >> From: Arthur Zhu <xiaoxiaomuyusajiangtian at gmail.com>
> >> Date: Thu, 3 Feb 2011 21:12:04 +0800
> >> Subject: [PATCH] Adding -enable-egl-dri2 option.
> >>
> >> ---
> >>  configure.ac |   26 ++++++++++++--------------
> >>  1 files changed, 12 insertions(+), 14 deletions(-)
> >>
> >> diff --git a/configure.ac b/configure.ac
> >> index 46938f4..bd50767 100644
> >> --- a/configure.ac
> >> +++ b/configure.ac
> >> @@ -1091,6 +1091,12 @@ if test "x$enable_egl" =3D xno; then
> >>          AC_MSG_ERROR([cannot enable OpenVG without EGL])
> >>      fi
> >>  fi
> >> +
> >> +AC_ARG_ENABLE([egl-dri2],
> >> +    [AS_HELP_STRING([--enable-egl-dri2],
> >> +        [enable EGL egl-dri2 driver @<:@default=3Ddisabled@:>@])],
> >> +    [enable_egl_dri2=3D"$enableval"],
> >> +    [enable_egl_dri2=3Dno])
> >>  if test "x$enable_egl" =3D xyes; then
> >>      SRC_DIRS=3D"$SRC_DIRS egl"
> >>      EGL_LIB_DEPS=3D"$DLOPEN_LIBS -lpthread"
> >> @@ -1100,21 +1106,13 @@ if test "x$enable_egl" =3D xyes; then
> >>          if test "$mesa_driver" =3D xlib -o "$mesa_driver" =3D dri; th=
en
> >>              EGL_DRIVERS_DIRS=3D"glx"
> >>          fi
> >> -
> >> -        if test "$mesa_driver" =3D dri; then
> >> +        if test "x$enable_egl_dri2" =3D xyes -a "$mesa_driver" =3D dr=
i;
> then
> >>              # build egl_dri2 when xcb-dri2 is available
> >> -            PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2
> xcb-xfixes],
> >> -                      [have_xcb_dri2=3Dyes],[have_xcb_dri2=3Dno])
> >> -            PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
> >> -                      [have_libudev=3Dyes],[have_libudev=3Dno])
> >> -
> >> -            if test "$have_xcb_dri2" =3D yes; then
> >> -                EGL_DRIVER_DRI2=3Ddri2
> >> -                DEFINES=3D"$DEFINES -DHAVE_XCB_DRI2"
> >> -                if test "$have_libudev" =3D yes; then
> >> -                    DEFINES=3D"$DEFINES -DHAVE_LIBUDEV"
> >> -                fi
> >> -            fi
> >> +            PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2
> xcb-xfixes])
> >> +            EGL_DRIVER_DRI2=3Ddri2
> >> +            DEFINES=3D"$DEFINES -DHAVE_XCB_DRI2"
> >> +            PKG_CHECK_MODULES([LIBUDEV], [libudev > 150])
> >> +            DEFINES=3D"$DEFINES -DHAVE_LIBUDEV"
> >
> > I didn't notice this the first time, but there are a couple changes of
> > the semantics. Now if you say --enable-egl-dri2, configure will fail
> > if you don't have XCB_DRI2. I think that's OK since the user has to
> > explicitly enable the option.
>
> In fact, I think that's better because we've had problems in the past
> with egl_dri2 not working on X11 because configure silently failed to
> find the xcb devel headers.  Having an option to explicitly request
> that and fail it not available is very useful.
>
> > However, now the LIBUDEV dependency is
> > unconditional, too. Is libudev required for egl-dri2?
>
> It's required for drm-only (X-less) functionality of egl-dri2.  I
> think it makes sense to split this option into --enable-egl-dri2-x11
> and --enable-egl-dri2-drm, and then check for xcb and udev
> respectively.
>
> Kristian
>

--90e6ba53a502389a87049baaeb97
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable



More information about the mesa-dev mailing list