[Mesa-dev] [PATCH] Adding -enable-egl-dri2 option. Happy Chinese Spring Festival!

Chia-I Wu olvaffe at gmail.com
Sun Feb 20 11:44:10 PST 2011


2011/2/6 Arthur Zhu <xiaoxiaomuyusajiangtian at gmail.com>:
> From 7f26f3b6692a8a8061c0d817388505d4190e88a0 Mon Sep 17 00:00:00 2001
> From: Arthur Zhu <xiaoxiaomuyusajiangtian at gmail.com>
> Date: Mon, 7 Feb 2011 13:50:55 +0800
> Subject: [PATCH] Adding --enable-egl-dri2-x11&drm option.
>
> ---
>  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" = 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=disabled@:>@])],
> +    [enable_egl_dri2_x11="$enableval"],
> +    [enable_egl_dri2_x11=no])
> +
> +AC_ARG_ENABLE([egl-dri2-drm],
> +    [AS_HELP_STRING([--enable-egl-dri2-drm],
> +        [enable EGL egl-dri2-drm driver. @<:@default=disabled@:>@])],
> +    [enable_egl_dri2_drm="$enableval"],
> +    [enable_egl_dri2_drm=no])
> +
$enable_egl_dri2_{x11,drm} should be "auto" by default, followed by

if test "x$mesa_driver" = "xdri"; then
    if test "x$enable_egl_dri2_x11" = "xauto"; then
        enable_egl_dri2_x11=yes
    fi
    if test "x$enable_egl_dri2_drm" = "xauto"; then
        enable_egl_dri2_drm=yes
    fi
fi

The check for $mesa_driver can be omitted below.
>  if test "x$enable_egl" = xyes; then
>      SRC_DIRS="$SRC_DIRS egl"
>      EGL_LIB_DEPS="$DLOPEN_LIBS -lpthread"
> @@ -1100,20 +1114,14 @@ if test "x$enable_egl" = xyes; then
>          if test "$mesa_driver" = xlib -o "$mesa_driver" = dri; then
>              EGL_DRIVERS_DIRS="glx"
>          fi
> -
> -        if test "$mesa_driver" = dri; then
> +        if test "x$enable_egl_dri2_x11" = xyes -o "x$enable_egl_dri2_drm" =
> xyes -a "$mesa_driver" = dri; then
>              # build egl_dri2 when xcb-dri2 is available
> -            PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes],
> -                      [have_xcb_dri2=yes],[have_xcb_dri2=no])
> -            PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
> -                      [have_libudev=yes],[have_libudev=no])
> -
> -            if test "$have_xcb_dri2" = yes; then
> -                EGL_DRIVER_DRI2=dri2
> -                DEFINES="$DEFINES -DHAVE_XCB_DRI2"
> -                if test "$have_libudev" = yes; then
> -                    DEFINES="$DEFINES -DHAVE_LIBUDEV"
> -                fi
> +            PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes])
> +            EGL_DRIVER_DRI2=dri2
> +            DEFINES="$DEFINES -DHAVE_XCB_DRI2"
> +            if test "x$enable_egl_dri2_drm" = xyes; then
> +                PKG_CHECK_MODULES([LIBUDEV], [libudev > 150])
> +                DEFINES="$DEFINES -DHAVE_LIBUDEV"
>              fi
>      fi
>
> --
> 1.7.0.4
>
>
> Arthur
>
>
> 2011/2/3 Kristian Høgsberg <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" = 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=disabled@:>@])],
>> >> +    [enable_egl_dri2="$enableval"],
>> >> +    [enable_egl_dri2=no])
>> >>  if test "x$enable_egl" = xyes; then
>> >>      SRC_DIRS="$SRC_DIRS egl"
>> >>      EGL_LIB_DEPS="$DLOPEN_LIBS -lpthread"
>> >> @@ -1100,21 +1106,13 @@ if test "x$enable_egl" = xyes; then
>> >>          if test "$mesa_driver" = xlib -o "$mesa_driver" = dri; then
>> >>              EGL_DRIVERS_DIRS="glx"
>> >>          fi
>> >> -
>> >> -        if test "$mesa_driver" = dri; then
>> >> +        if test "x$enable_egl_dri2" = xyes -a "$mesa_driver" = dri;
>> >> then
>> >>              # build egl_dri2 when xcb-dri2 is available
>> >> -            PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2
>> >> xcb-xfixes],
>> >> -                      [have_xcb_dri2=yes],[have_xcb_dri2=no])
>> >> -            PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
>> >> -                      [have_libudev=yes],[have_libudev=no])
>> >> -
>> >> -            if test "$have_xcb_dri2" = yes; then
>> >> -                EGL_DRIVER_DRI2=dri2
>> >> -                DEFINES="$DEFINES -DHAVE_XCB_DRI2"
>> >> -                if test "$have_libudev" = yes; then
>> >> -                    DEFINES="$DEFINES -DHAVE_LIBUDEV"
>> >> -                fi
>> >> -            fi
>> >> +            PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2
>> >> xcb-xfixes])
>> >> +            EGL_DRIVER_DRI2=dri2
>> >> +            DEFINES="$DEFINES -DHAVE_XCB_DRI2"
>> >> +            PKG_CHECK_MODULES([LIBUDEV], [libudev > 150])
>> >> +            DEFINES="$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
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>



-- 
olv at LunarG.com


More information about the mesa-dev mailing list