Re: [Mesa-dev] [PATCH] glx: conditionaly build dri3 and present loader (v3)

2013-11-11 Thread Brian Paul

On 11/08/2013 05:00 PM, Matt Turner wrote:

On Fri, Nov 8, 2013 at 3:06 PM, Armin K kre...@email.com wrote:

This patch makes it possible to disable DRI3 if desired.


Reviewed-by: Matt Turner matts...@gmail.com

Unless non-Linux users still need to be able to disable DRI3, by the
time Mesa 10.0 is released I think we want to require these bits for
DRI builds. I'll plan to revert most of this commit before the
release.


I'd like to keep the --disable-dri3 option until the new dependencies 
are easy to resolve (see my other msg).


And if the dependencies aren't easily resolved with yum, apt-get etc. 
let's at least update the documentation with some pointers to where to 
find these things.


Thanks.

-Brian

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] glx: conditionaly build dri3 and present loader (v3)

2013-11-09 Thread Armin K.
On 11/09/2013 01:00 AM, Matt Turner wrote:
 On Fri, Nov 8, 2013 at 3:06 PM, Armin K kre...@email.com wrote:
 This patch makes it possible to disable DRI3 if desired.
 
 Reviewed-by: Matt Turner matts...@gmail.com
 
 Unless non-Linux users still need to be able to disable DRI3, by the
 time Mesa 10.0 is released I think we want to require these bits for
 DRI builds. I'll plan to revert most of this commit before the
 release.
 

Well, DRI3 requires udev, which is, iirc, Linux specific. It's easy to
disable gbm on such platforms to avoid the direct dep (EGL uses it
optionally), but you need a way to disable it on another platforms which
don't support it.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] glx: conditionaly build dri3 and present loader (v3)

2013-11-08 Thread Armin K
This patch makes it possible to disable DRI3 if desired.

v2:

Incorporated changes from Ian Romanick and Aaron Watry
Unified libudev check and made libGL link to it only
when DRI3 was enabled.

v3:

Correct misspelled Ian's last name in commit message.

Adding Brian Paul to CC since he asked if DRI3 stuff
can be put behind some sort of config option.

Tested with:

./configure --disable-dri3 --with-dri-drivers=i965 \
--with-gallium-drivers= --disable-vdpau --disable-egl \
--disable-gbm --disable-xvmc

CC: Ian Romanick i...@freedesktop.org
CC: Aaron Watry awa...@gmail.com
CC: Brian Paul bri...@vmware.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71397
---
 configure.ac| 44 ++--
 src/glx/Makefile.am |  8 ++--
 src/glx/glxext.c|  4 
 3 files changed, 44 insertions(+), 12 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8fb5e0d..f756b73 100644
--- a/configure.ac
+++ b/configure.ac
@@ -536,6 +536,11 @@ AC_ARG_ENABLE([dri],
 [enable DRI modules @:@default=enabled@:@])],
 [enable_dri=$enableval],
 [enable_dri=yes])
+AC_ARG_ENABLE([dri3],
+[AS_HELP_STRING([--enable-dri3],
+[enable DRI3 @:@default=enabled@:@])],
+[enable_dri3=$enableval],
+[enable_dri3=yes])
 AC_ARG_ENABLE([glx],
 [AS_HELP_STRING([--enable-glx],
 [enable GLX library @:@default=enabled@:@])],
@@ -702,6 +707,7 @@ fi
 AM_CONDITIONAL(HAVE_DRI_GLX, test x$enable_glx = xyes -a \
   x$enable_dri = xyes)
 AM_CONDITIONAL(HAVE_DRI, test x$enable_dri = xyes)
+AM_CONDITIONAL(HAVE_DRI3, test x$enable_dri3 = xyes)
 
 AC_ARG_ENABLE([shared-glapi],
 [AS_HELP_STRING([--enable-shared-glapi],
@@ -756,6 +762,9 @@ AC_SUBST([MESA_LLVM])
 PKG_CHECK_MODULES([LIBDRM], [libdrm = $LIBDRM_REQUIRED],
   [have_libdrm=yes], [have_libdrm=no])
 
+PKG_CHECK_MODULES([LIBUDEV], [libudev = $LIBUDEV_REQUIRED],
+  have_libudev=yes, have_libudev=no)
+
 if test x$enable_dri = xyes; then
 # DRI must be shared, I think
 if test $enable_static = yes; then
@@ -811,13 +820,21 @@ xyesno)
 fi
 PKG_CHECK_MODULES([DRI2PROTO], [dri2proto = $DRI2PROTO_REQUIRED])
 GL_PC_REQ_PRIV=$GL_PC_REQ_PRIV libdrm = $LIBDRM_REQUIRED
-PKG_CHECK_MODULES([DRI3PROTO], [dri3proto = $DRI3PROTO_REQUIRED])
-PKG_CHECK_MODULES([PRESENTPROTO], [presentproto = 
$PRESENTPROTO_REQUIRED])
-PKG_CHECK_MODULES([LIBUDEV], [libudev = $LIBUDEV_REQUIRED])
+if test x$enable_dri3 = xyes; then
+if test x$have_libudev != xyes; then
+  AC_MSG_ERROR([DRI3 requires libudev = $LIBUDEV_REQUIRED])
+fi
+PKG_CHECK_MODULES([DRI3PROTO], [dri3proto = $DRI3PROTO_REQUIRED])
+PKG_CHECK_MODULES([PRESENTPROTO], [presentproto = 
$PRESENTPROTO_REQUIRED])
+fi
 fi
 
 # find the DRI deps for libGL
-dri_modules=x11 xext xdamage xfixes x11-xcb xcb-glx = 1.8.1 xcb-dri2 = 
1.8 xcb-dri3 xcb-present xcb-sync xshmfence
+dri_modules=x11 xext xdamage xfixes x11-xcb xcb-glx = 1.8.1 xcb-dri2 = 
1.8
+
+if test x$enable_dri3 = xyes; then
+dri_modules=$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence
+fi
 
 # add xf86vidmode if available
 PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, 
HAVE_XF86VIDMODE=no)
@@ -827,8 +844,13 @@ xyesno)
 
 PKG_CHECK_MODULES([DRIGL], [$dri_modules])
 GL_PC_REQ_PRIV=$GL_PC_REQ_PRIV $dri_modules
-X11_INCLUDES=$X11_INCLUDES $DRIGL_CFLAGS $LIBUDEV_CFLAGS
-GL_LIB_DEPS=$DRIGL_LIBS $LIBUDEV_LIBS
+X11_INCLUDES=$X11_INCLUDES $DRIGL_CFLAGS
+GL_LIB_DEPS=$DRIGL_LIBS
+
+if test x$enable_dri3$have_libudev = xyesyes; then
+X11_INCLUDES=$X11_INCLUDES $LIBUDEV_CFLAGS
+GL_LIB_DEPS=$GL_LIB_DEPS $LIBUDEV_LIBS
+fi
 
 # need DRM libs, $PTHREAD_LIBS, etc.
 GL_LIB_DEPS=$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS
@@ -947,6 +969,9 @@ if test x$enable_dri = xyes; then
 linux*)
 DEFINES=$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1
 DEFINES=$DEFINES -DHAVE_ALIAS
+if test x$enable_dri3 = xyes; then
+DEFINES=$DEFINES -DHAVE_DRI3
+fi
 
 case $host_cpu in
 x86_64|amd64)
@@ -1142,8 +1167,9 @@ if test x$enable_gbm = xauto; then
 esac
 fi
 if test x$enable_gbm = xyes; then
-PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
-  AC_MSG_ERROR([gbm needs udev]))
+if test x$have_libudev != xyes; then
+AC_MSG_ERROR([gbm needs udev])
+fi
 
 if test x$enable_dri = xyes; then
 GBM_BACKEND_DIRS=$GBM_BACKEND_DIRS dri
@@ -1170,8 +1196,6 @@ if test x$enable_egl = xyes; then
 
 if test $enable_static != yes; then
 # build egl_glx when libGL is built
-PKG_CHECK_MODULES([LIBUDEV], [libudev  150],
-  [have_libudev=yes],[have_libudev=no])
 if test $have_libudev = yes; then
 

Re: [Mesa-dev] [PATCH] glx: conditionaly build dri3 and present loader (v3)

2013-11-08 Thread Matt Turner
On Fri, Nov 8, 2013 at 3:06 PM, Armin K kre...@email.com wrote:
 This patch makes it possible to disable DRI3 if desired.

Reviewed-by: Matt Turner matts...@gmail.com

Unless non-Linux users still need to be able to disable DRI3, by the
time Mesa 10.0 is released I think we want to require these bits for
DRI builds. I'll plan to revert most of this commit before the
release.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] glx: conditionaly build dri3 and present loader (v3)

2013-11-08 Thread Ian Romanick
On 11/08/2013 03:06 PM, Armin K wrote:
 This patch makes it possible to disable DRI3 if desired.

Should we squash this with Jose's patch?

 v2:
 
 Incorporated changes from Ian Romanick and Aaron Watry
 Unified libudev check and made libGL link to it only
 when DRI3 was enabled.
 
 v3:
 
 Correct misspelled Ian's last name in commit message.
 
 Adding Brian Paul to CC since he asked if DRI3 stuff
 can be put behind some sort of config option.
 
 Tested with:
 
 ./configure --disable-dri3 --with-dri-drivers=i965 \
 --with-gallium-drivers= --disable-vdpau --disable-egl \
 --disable-gbm --disable-xvmc
 
 CC: Ian Romanick i...@freedesktop.org

Reviewed-by: Ian Romanick ian.d.roman...@intel.com

 CC: Aaron Watry awa...@gmail.com
 CC: Brian Paul bri...@vmware.com
 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71397
 ---
  configure.ac| 44 ++--
  src/glx/Makefile.am |  8 ++--
  src/glx/glxext.c|  4 
  3 files changed, 44 insertions(+), 12 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
 index 8fb5e0d..f756b73 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -536,6 +536,11 @@ AC_ARG_ENABLE([dri],
  [enable DRI modules @:@default=enabled@:@])],
  [enable_dri=$enableval],
  [enable_dri=yes])
 +AC_ARG_ENABLE([dri3],
 +[AS_HELP_STRING([--enable-dri3],
 +[enable DRI3 @:@default=enabled@:@])],
 +[enable_dri3=$enableval],
 +[enable_dri3=yes])
  AC_ARG_ENABLE([glx],
  [AS_HELP_STRING([--enable-glx],
  [enable GLX library @:@default=enabled@:@])],
 @@ -702,6 +707,7 @@ fi
  AM_CONDITIONAL(HAVE_DRI_GLX, test x$enable_glx = xyes -a \
x$enable_dri = xyes)
  AM_CONDITIONAL(HAVE_DRI, test x$enable_dri = xyes)
 +AM_CONDITIONAL(HAVE_DRI3, test x$enable_dri3 = xyes)
  
  AC_ARG_ENABLE([shared-glapi],
  [AS_HELP_STRING([--enable-shared-glapi],
 @@ -756,6 +762,9 @@ AC_SUBST([MESA_LLVM])
  PKG_CHECK_MODULES([LIBDRM], [libdrm = $LIBDRM_REQUIRED],
[have_libdrm=yes], [have_libdrm=no])
  
 +PKG_CHECK_MODULES([LIBUDEV], [libudev = $LIBUDEV_REQUIRED],
 +  have_libudev=yes, have_libudev=no)
 +
  if test x$enable_dri = xyes; then
  # DRI must be shared, I think
  if test $enable_static = yes; then
 @@ -811,13 +820,21 @@ xyesno)
  fi
  PKG_CHECK_MODULES([DRI2PROTO], [dri2proto = $DRI2PROTO_REQUIRED])
  GL_PC_REQ_PRIV=$GL_PC_REQ_PRIV libdrm = $LIBDRM_REQUIRED
 -PKG_CHECK_MODULES([DRI3PROTO], [dri3proto = $DRI3PROTO_REQUIRED])
 -PKG_CHECK_MODULES([PRESENTPROTO], [presentproto = 
 $PRESENTPROTO_REQUIRED])
 -PKG_CHECK_MODULES([LIBUDEV], [libudev = $LIBUDEV_REQUIRED])
 +if test x$enable_dri3 = xyes; then
 +if test x$have_libudev != xyes; then
 +  AC_MSG_ERROR([DRI3 requires libudev = $LIBUDEV_REQUIRED])
 +fi
 +PKG_CHECK_MODULES([DRI3PROTO], [dri3proto = 
 $DRI3PROTO_REQUIRED])
 +PKG_CHECK_MODULES([PRESENTPROTO], [presentproto = 
 $PRESENTPROTO_REQUIRED])
 +fi
  fi
  
  # find the DRI deps for libGL
 -dri_modules=x11 xext xdamage xfixes x11-xcb xcb-glx = 1.8.1 xcb-dri2 
 = 1.8 xcb-dri3 xcb-present xcb-sync xshmfence
 +dri_modules=x11 xext xdamage xfixes x11-xcb xcb-glx = 1.8.1 xcb-dri2 
 = 1.8
 +
 +if test x$enable_dri3 = xyes; then
 +dri_modules=$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence
 +fi
  
  # add xf86vidmode if available
  PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, 
 HAVE_XF86VIDMODE=no)
 @@ -827,8 +844,13 @@ xyesno)
  
  PKG_CHECK_MODULES([DRIGL], [$dri_modules])
  GL_PC_REQ_PRIV=$GL_PC_REQ_PRIV $dri_modules
 -X11_INCLUDES=$X11_INCLUDES $DRIGL_CFLAGS $LIBUDEV_CFLAGS
 -GL_LIB_DEPS=$DRIGL_LIBS $LIBUDEV_LIBS
 +X11_INCLUDES=$X11_INCLUDES $DRIGL_CFLAGS
 +GL_LIB_DEPS=$DRIGL_LIBS
 +
 +if test x$enable_dri3$have_libudev = xyesyes; then
 +X11_INCLUDES=$X11_INCLUDES $LIBUDEV_CFLAGS
 +GL_LIB_DEPS=$GL_LIB_DEPS $LIBUDEV_LIBS
 +fi
  
  # need DRM libs, $PTHREAD_LIBS, etc.
  GL_LIB_DEPS=$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS
 @@ -947,6 +969,9 @@ if test x$enable_dri = xyes; then
  linux*)
  DEFINES=$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1
  DEFINES=$DEFINES -DHAVE_ALIAS
 +if test x$enable_dri3 = xyes; then
 +DEFINES=$DEFINES -DHAVE_DRI3
 +fi
  
  case $host_cpu in
  x86_64|amd64)
 @@ -1142,8 +1167,9 @@ if test x$enable_gbm = xauto; then
  esac
  fi
  if test x$enable_gbm = xyes; then
 -PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
 -  AC_MSG_ERROR([gbm needs udev]))
 +if test x$have_libudev != xyes; then
 +AC_MSG_ERROR([gbm needs udev])
 +fi
  
  if test x$enable_dri = xyes; then
  GBM_BACKEND_DIRS=$GBM_BACKEND_DIRS dri
 @@ -1170,8 +1196,6 @@ if test x$enable_egl = 

Re: [Mesa-dev] [PATCH] glx: conditionaly build dri3 and present loader (v3)

2013-11-08 Thread Armin K.
On 11/09/2013 01:15 AM, Ian Romanick wrote:
 On 11/08/2013 03:06 PM, Armin K wrote:
 This patch makes it possible to disable DRI3 if desired.
 
 Should we squash this with Jose's patch?
 

Yes, that would be nice. They do the same thing but for different build
systems.

 v2:

 Incorporated changes from Ian Romanick and Aaron Watry
 Unified libudev check and made libGL link to it only
 when DRI3 was enabled.

 v3:

 Correct misspelled Ian's last name in commit message.

 Adding Brian Paul to CC since he asked if DRI3 stuff
 can be put behind some sort of config option.

 Tested with:

 ./configure --disable-dri3 --with-dri-drivers=i965 \
 --with-gallium-drivers= --disable-vdpau --disable-egl \
 --disable-gbm --disable-xvmc

 CC: Ian Romanick i...@freedesktop.org
 
 Reviewed-by: Ian Romanick ian.d.roman...@intel.com
 
 CC: Aaron Watry awa...@gmail.com
 CC: Brian Paul bri...@vmware.com
 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71397
 ---
  configure.ac| 44 ++--
  src/glx/Makefile.am |  8 ++--
  src/glx/glxext.c|  4 
  3 files changed, 44 insertions(+), 12 deletions(-)

 diff --git a/configure.ac b/configure.ac
 index 8fb5e0d..f756b73 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -536,6 +536,11 @@ AC_ARG_ENABLE([dri],
  [enable DRI modules @:@default=enabled@:@])],
  [enable_dri=$enableval],
  [enable_dri=yes])
 +AC_ARG_ENABLE([dri3],
 +[AS_HELP_STRING([--enable-dri3],
 +[enable DRI3 @:@default=enabled@:@])],
 +[enable_dri3=$enableval],
 +[enable_dri3=yes])
  AC_ARG_ENABLE([glx],
  [AS_HELP_STRING([--enable-glx],
  [enable GLX library @:@default=enabled@:@])],
 @@ -702,6 +707,7 @@ fi
  AM_CONDITIONAL(HAVE_DRI_GLX, test x$enable_glx = xyes -a \
x$enable_dri = xyes)
  AM_CONDITIONAL(HAVE_DRI, test x$enable_dri = xyes)
 +AM_CONDITIONAL(HAVE_DRI3, test x$enable_dri3 = xyes)
  
  AC_ARG_ENABLE([shared-glapi],
  [AS_HELP_STRING([--enable-shared-glapi],
 @@ -756,6 +762,9 @@ AC_SUBST([MESA_LLVM])
  PKG_CHECK_MODULES([LIBDRM], [libdrm = $LIBDRM_REQUIRED],
[have_libdrm=yes], [have_libdrm=no])
  
 +PKG_CHECK_MODULES([LIBUDEV], [libudev = $LIBUDEV_REQUIRED],
 +  have_libudev=yes, have_libudev=no)
 +
  if test x$enable_dri = xyes; then
  # DRI must be shared, I think
  if test $enable_static = yes; then
 @@ -811,13 +820,21 @@ xyesno)
  fi
  PKG_CHECK_MODULES([DRI2PROTO], [dri2proto = $DRI2PROTO_REQUIRED])
  GL_PC_REQ_PRIV=$GL_PC_REQ_PRIV libdrm = $LIBDRM_REQUIRED
 -PKG_CHECK_MODULES([DRI3PROTO], [dri3proto = $DRI3PROTO_REQUIRED])
 -PKG_CHECK_MODULES([PRESENTPROTO], [presentproto = 
 $PRESENTPROTO_REQUIRED])
 -PKG_CHECK_MODULES([LIBUDEV], [libudev = $LIBUDEV_REQUIRED])
 +if test x$enable_dri3 = xyes; then
 +if test x$have_libudev != xyes; then
 +  AC_MSG_ERROR([DRI3 requires libudev = $LIBUDEV_REQUIRED])
 +fi
 +PKG_CHECK_MODULES([DRI3PROTO], [dri3proto = 
 $DRI3PROTO_REQUIRED])
 +PKG_CHECK_MODULES([PRESENTPROTO], [presentproto = 
 $PRESENTPROTO_REQUIRED])
 +fi
  fi
  
  # find the DRI deps for libGL
 -dri_modules=x11 xext xdamage xfixes x11-xcb xcb-glx = 1.8.1 xcb-dri2 
 = 1.8 xcb-dri3 xcb-present xcb-sync xshmfence
 +dri_modules=x11 xext xdamage xfixes x11-xcb xcb-glx = 1.8.1 xcb-dri2 
 = 1.8
 +
 +if test x$enable_dri3 = xyes; then
 +dri_modules=$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence
 +fi
  
  # add xf86vidmode if available
  PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, 
 HAVE_XF86VIDMODE=no)
 @@ -827,8 +844,13 @@ xyesno)
  
  PKG_CHECK_MODULES([DRIGL], [$dri_modules])
  GL_PC_REQ_PRIV=$GL_PC_REQ_PRIV $dri_modules
 -X11_INCLUDES=$X11_INCLUDES $DRIGL_CFLAGS $LIBUDEV_CFLAGS
 -GL_LIB_DEPS=$DRIGL_LIBS $LIBUDEV_LIBS
 +X11_INCLUDES=$X11_INCLUDES $DRIGL_CFLAGS
 +GL_LIB_DEPS=$DRIGL_LIBS
 +
 +if test x$enable_dri3$have_libudev = xyesyes; then
 +X11_INCLUDES=$X11_INCLUDES $LIBUDEV_CFLAGS
 +GL_LIB_DEPS=$GL_LIB_DEPS $LIBUDEV_LIBS
 +fi
  
  # need DRM libs, $PTHREAD_LIBS, etc.
  GL_LIB_DEPS=$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS
 @@ -947,6 +969,9 @@ if test x$enable_dri = xyes; then
  linux*)
  DEFINES=$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1
  DEFINES=$DEFINES -DHAVE_ALIAS
 +if test x$enable_dri3 = xyes; then
 +DEFINES=$DEFINES -DHAVE_DRI3
 +fi
  
  case $host_cpu in
  x86_64|amd64)
 @@ -1142,8 +1167,9 @@ if test x$enable_gbm = xauto; then
  esac
  fi
  if test x$enable_gbm = xyes; then
 -PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
 -  AC_MSG_ERROR([gbm needs udev]))
 +if test x$have_libudev != xyes; then
 +AC_MSG_ERROR([gbm needs udev])
 +fi
  
  if test