Merge remote branch 'origin/master' into pipe-video
authorChristian König <deathsimple@vodafone.de>
Thu, 11 Nov 2010 20:07:42 +0000 (21:07 +0100)
committerChristian König <deathsimple@vodafone.de>
Thu, 11 Nov 2010 20:07:42 +0000 (21:07 +0100)
1  2 
configure.ac
src/gallium/auxiliary/SConscript
src/gallium/drivers/nvfx/nvfx_screen.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/softpipe/SConscript
src/gallium/drivers/softpipe/sp_screen.c

diff --combined configure.ac
index 5d2f9d75d0e661d432efd2142cfcdc932c586f89,b43a9fd1e86abe59fcd740db8c7e9a2b3e037e99..c172c1cbaed169dcac7937c59fd940b8e4afda26
@@@ -465,6 -465,71 +465,71 @@@ if test "x$enable_selinux" = "xyes"; th
      DEFINES="$DEFINES -DMESA_SELINUX"
  fi
  
+ dnl Determine which APIs to support
+ AC_ARG_ENABLE([opengl],
+     [AS_HELP_STRING([--disable-opengl],
+         [disable support for standard OpenGL API @<:@default=no@:>@])],
+     [enable_opengl="$enableval"],
+     [enable_opengl=yes])
+ AC_ARG_ENABLE([gles1],
+     [AS_HELP_STRING([--enable-gles1],
+         [enable support for OpenGL ES 1.x API @<:@default=no@:>@])],
+     [enable_gles1="$enableval"],
+     [enable_gles1=no])
+ AC_ARG_ENABLE([gles2],
+     [AS_HELP_STRING([--enable-gles2],
+         [enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
+     [enable_gles2="$enableval"],
+     [enable_gles2=no])
+ AC_ARG_ENABLE([gles-overlay],
+     [AS_HELP_STRING([--enable-gles-overlay],
+         [build separate OpenGL ES only libraries @<:@default=no@:>@])],
+     [enable_gles_overlay="$enableval"],
+     [enable_gles_overlay=no])
+ AC_ARG_ENABLE([openvg],
+     [AS_HELP_STRING([--enable-openvg],
+         [enable support for OpenVG API @<:@default=no@:>@])],
+     [enable_openvg="$enableval"],
+     [enable_openvg=no])
+ dnl smooth the transition; should be removed eventually
+ if test "x$enable_openvg" = xno; then
+     case "x$with_state_trackers" in
+     x*vega*)
+         AC_MSG_WARN([vega state tracker is enabled without --enable-openvg])
+         enable_openvg=yes
+         ;;
+     esac
+ fi
+ if test "x$enable_opengl" = xno -a \
+         "x$enable_gles1" = xno -a \
+         "x$enable_gles2" = xno -a \
+         "x$enable_gles_overlay" = xno -a \
+         "x$enable_openvg" = xno; then
+     AC_MSG_ERROR([at least one API should be enabled])
+ fi
+ API_DEFINES=""
+ GLES_OVERLAY=0
+ if test "x$enable_opengl" = xno; then
+     API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
+ else
+     API_DEFINES="$API_DEFINES -DFEATURE_GL=1"
+ fi
+ if test "x$enable_gles1" = xyes; then
+     API_DEFINES="$API_DEFINES -DFEATURE_ES1=1"
+ fi
+ if test "x$enable_gles2" = xyes; then
+     API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
+ fi
+ if test "x$enable_gles_overlay" = xyes; then
+     GLES_OVERLAY=1
+ fi
+ AC_SUBST([API_DEFINES])
+ AC_SUBST([GLES_OVERLAY])
  dnl
  dnl Driver configuration. Options are xlib, dri and osmesa right now.
  dnl More later: fbdev, ...
@@@ -484,6 -549,10 +549,10 @@@ linux*
      ;;
  esac
  
+ if test "x$enable_opengl" = xno; then
+     default_driver="no"
+ fi
  AC_ARG_WITH([driver],
      [AS_HELP_STRING([--with-driver=DRIVER],
          [driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])],
  dnl Check for valid option
  case "x$mesa_driver" in
  xxlib|xdri|xosmesa)
+     if test "x$enable_opengl" = xno; then
+         AC_MSG_ERROR([Driver '$mesa_driver' requires OpenGL enabled])
+     fi
+     ;;
+ xno)
      ;;
  *)
      AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
@@@ -507,7 -581,7 +581,7 @@@ dnl Driver specific build directorie
  dnl
  
  dnl this variable will be prepended to SRC_DIRS and is not exported
- CORE_DIRS="mapi/glapi glsl mesa"
+ CORE_DIRS=""
  
  SRC_DIRS=""
  GLU_DIRS="sgi"
@@@ -517,6 -591,30 +591,30 @@@ GALLIUM_WINSYS_DIRS="sw
  GALLIUM_DRIVERS_DIRS="softpipe failover galahad trace rbug identity"
  GALLIUM_STATE_TRACKERS_DIRS=""
  
+ # build glapi if OpenGL is enabled
+ if test "x$enable_opengl" = xyes; then
+     CORE_DIRS="$CORE_DIRS mapi/glapi"
+ fi
+ # build es1api and es2api if OpenGL ES is enabled
+ case "x$enable_gles1$enable_gles2$enable_gles_overlay" in
+ x*yes*)
+     CORE_DIRS="$CORE_DIRS mapi/es1api mapi/es2api"
+     ;;
+ esac
+ # build vgapi if OpenVG is enabled
+ if test "x$enable_openvg" = xyes; then
+     CORE_DIRS="$CORE_DIRS mapi/vgapi"
+ fi
+ # build glsl and mesa if OpenGL or OpenGL ES is enabled
+ case "x$enable_opengl$enable_gles1$enable_gles2$enable_gles_overlay" in
+ x*yes*)
+     CORE_DIRS="$CORE_DIRS glsl mesa"
+     ;;
+ esac
  case "$mesa_driver" in
  xlib)
      DRIVER_DIRS="x11"
@@@ -531,6 -629,9 +629,9 @@@ dri
  osmesa)
      DRIVER_DIRS="osmesa"
      ;;
+ no)
+     DRIVER_DRIS=""
+     ;;
  esac
  AC_SUBST([SRC_DIRS])
  AC_SUBST([GLU_DIRS])
@@@ -623,7 -724,7 +724,7 @@@ xlib
          GL_LIB_DEPS=""
      fi
      ;;
- dri)
+ dri|no) # these checks are still desired when there is no mesa_driver
      # DRI must be shared, I think
      if test "$enable_static" = yes; then
          AC_MSG_ERROR([Can't use static libraries for DRI drivers])
@@@ -748,51 -849,6 +849,6 @@@ if test "x$with_dri_drivers" = x; the
      with_dri_drivers=no
  fi
  
- dnl Determine which APIs to support
- AC_ARG_ENABLE([opengl],
-     [AS_HELP_STRING([--disable-opengl],
-         [disable support for standard OpenGL API @<:@default=no@:>@])],
-     [enable_opengl="$enableval"],
-     [enable_opengl=yes])
- AC_ARG_ENABLE([gles1],
-     [AS_HELP_STRING([--enable-gles1],
-         [enable support for OpenGL ES 1.x API @<:@default=no@:>@])],
-     [enable_gles1="$enableval"],
-     [enable_gles1=no])
- AC_ARG_ENABLE([gles2],
-     [AS_HELP_STRING([--enable-gles2],
-         [enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
-     [enable_gles2="$enableval"],
-     [enable_gles2=no])
- AC_ARG_ENABLE([gles-overlay],
-     [AS_HELP_STRING([--enable-gles-overlay],
-         [build separate OpenGL ES only libraries @<:@default=no@:>@])],
-     [enable_gles_overlay="$enableval"],
-     [enable_gles_overlay=no])
- API_DEFINES=""
- GLES_OVERLAY=0
- if test "x$enable_opengl" = xno; then
-     API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
- else
-     API_DEFINES="$API_DEFINES -DFEATURE_GL=1"
- fi
- if test "x$enable_gles1" = xyes; then
-     API_DEFINES="$API_DEFINES -DFEATURE_ES1=1"
- fi
- if test "x$enable_gles2" = xyes; then
-     API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
- fi
- if test "x$enable_gles_overlay" = xyes -o \
-     "x$enable_gles1" = xyes -o "x$enable_gles2" = xyes; then
-     CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
-     if test "x$enable_gles_overlay" = xyes; then
-         GLES_OVERLAY=1
-     fi
- fi
- AC_SUBST([API_DEFINES])
- AC_SUBST([GLES_OVERLAY])
  dnl If $with_dri_drivers is yes, directories will be added through
  dnl platform checks
  DRI_DIRS=""
@@@ -813,7 -869,7 +869,7 @@@ yes
  esac
  
  dnl Set DRI_DIRS, DEFINES and LIB_DEPS
- if test "$mesa_driver" = dri; then
+ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
      # Use TLS in GLX?
      if test "x$GLX_USE_TLS" = xyes; then
          DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS"
      DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/  */ /g'`
  
      # Check for expat
-     EXPAT_INCLUDES=""
-     EXPAT_LIB=-lexpat
-     AC_ARG_WITH([expat],
-         [AS_HELP_STRING([--with-expat=DIR],
-             [expat install directory])],[
-         EXPAT_INCLUDES="-I$withval/include"
-         CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
-         LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
-         EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
-         ])
-     AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
-     AC_CHECK_LIB([expat],[XML_ParserCreate],[],
-         [AC_MSG_ERROR([Expat required for DRI.])])
+     if test "$mesa_driver" = dri; then
+         EXPAT_INCLUDES=""
+         EXPAT_LIB=-lexpat
+         AC_ARG_WITH([expat],
+             [AS_HELP_STRING([--with-expat=DIR],
+                 [expat install directory])],[
+             EXPAT_INCLUDES="-I$withval/include"
+             CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
+             LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
+             EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
+             ])
+         AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
+         AC_CHECK_LIB([expat],[XML_ParserCreate],[],
+             [AC_MSG_ERROR([Expat required for DRI.])])
+     fi
  
      # put all the necessary libs together
      DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS $TALLOC_LIBS"
@@@ -944,6 -1002,9 +1002,9 @@@ AC_ARG_ENABLE([gl-osmesa]
      [gl_osmesa="$enableval"],
      [gl_osmesa="$default_gl_osmesa"])
  if test "x$gl_osmesa" = xyes; then
+     if test "x$enable_opengl" = xno; then
+         AC_MSG_ERROR([OpenGL is not available for OSMesa driver])
+     fi
      if test "$mesa_driver" = osmesa; then
          AC_MSG_ERROR([libGL is not available for OSMesa driver])
      else
@@@ -1000,13 -1061,21 +1061,21 @@@ AC_ARG_ENABLE([egl]
          [disable EGL library @<:@default=enabled@:>@])],
      [enable_egl="$enableval"],
      [enable_egl=yes])
+ if test "x$enable_egl" = xno; then
+     if test "x$mesa_driver" = xno; then
+         AC_MSG_ERROR([cannot disable EGL when there is no mesa driver])
+     fi
+     if test "x$enable_openvg" = xyes; then
+         AC_MSG_ERROR([cannot enable OpenVG without EGL])
+     fi
+ fi
  if test "x$enable_egl" = xyes; then
      SRC_DIRS="$SRC_DIRS egl"
      EGL_LIB_DEPS="$DLOPEN_LIBS -lpthread"
      EGL_DRIVERS_DIRS=""
      if test "$enable_static" != yes; then
          # build egl_glx when libGL is built
-         if test "$mesa_driver" != osmesa; then
+         if test "$mesa_driver" = xlib -o "$mesa_driver" = dri; then
              EGL_DRIVERS_DIRS="glx"
          fi
  
@@@ -1040,6 -1109,12 +1109,12 @@@ AC_ARG_ENABLE([glu]
          [enable OpenGL Utility library @<:@default=enabled@:>@])],
      [enable_glu="$enableval"],
      [enable_glu=yes])
+ if test "x$enable_glu" = xyes -a "x$mesa_driver" = xno; then
+     AC_MSG_NOTICE([Disabling GLU since there is no OpenGL driver])
+     enable_glu=no
+ fi
  if test "x$enable_glu" = xyes; then
      SRC_DIRS="$SRC_DIRS glu"
  
@@@ -1089,9 -1164,13 +1164,13 @@@ AC_ARG_ENABLE([glw]
      [enable_glw="$enableval"],
      [enable_glw=yes])
  dnl Don't build GLw on osmesa
- if test "x$enable_glw" = xyes && test "$mesa_driver" = osmesa; then
-     AC_MSG_WARN([Disabling GLw since the driver is OSMesa])
-     enable_glw=no
+ if test "x$enable_glw" = xyes; then
+     case "$mesa_driver" in
+     osmesa|no)
+         AC_MSG_NOTICE([Disabling GLw since there is no OpenGL driver])
+         enable_glw=no
+         ;;
+     esac
  fi
  AC_ARG_ENABLE([motif],
      [AS_HELP_STRING([--enable-motif],
@@@ -1165,16 -1244,20 +1244,20 @@@ AC_ARG_ENABLE([glut]
      [enable_glut="$enableval"],
      [enable_glut="$default_glut"])
  
+ dnl Don't build glut on osmesa
+ if test "x$enable_glut" = xyes; then
+     case "$mesa_driver" in
+     osmesa|no)
+         AC_MSG_NOTICE([Disabling glut since there is no OpenGL driver])
+         enable_glut=no
+         ;;
+     esac
+ fi
  dnl Can't build glut if GLU not available
  if test "x$enable_glu$enable_glut" = xnoyes; then
      AC_MSG_WARN([Disabling glut since GLU is disabled])
      enable_glut=no
  fi
- dnl Don't build glut on osmesa
- if test "x$enable_glut" = xyes && test "$mesa_driver" = osmesa; then
-     AC_MSG_WARN([Disabling glut since the driver is OSMesa])
-     enable_glut=no
- fi
  
  if test "x$enable_glut" = xyes; then
      SRC_DIRS="$SRC_DIRS glut/glx"
@@@ -1239,6 -1322,9 +1322,9 @@@ AC_ARG_ENABLE([gallium]
          [build gallium @<:@default=enabled@:>@])],
      [enable_gallium="$enableval"],
      [enable_gallium=yes])
+ if test "x$enable_gallium" = xno -a "x$enable_openvg" = xyes; then
+     AC_MSG_ERROR([cannot enable OpenVG without Gallium])
+ fi
  if test "x$enable_gallium" = xyes; then
      SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
      AC_CHECK_HEADER([udis86.h], [HAS_UDIS86="yes"],
@@@ -1251,15 -1337,30 +1337,30 @@@ AC_SUBST([LLVM_LIBS]
  AC_SUBST([LLVM_LDFLAGS])
  AC_SUBST([LLVM_VERSION])
  
- VG_LIB_DEPS=""
- EGL_CLIENT_APIS='$(GL_LIB)'
- if test "x$enable_gles_overlay" = xyes; then
-     EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GLESv1_CM_LIB) $(GLESv2_LIB)'
- fi
  dnl
  dnl Gallium state trackers configuration
  dnl
+ AC_ARG_ENABLE([gallium-egl],
+     [AS_HELP_STRING([--enable-gallium-egl],
+         [enable gallium EGL state tracker @<:@default=auto@:>@])],
+     [enable_gallium_egl="$enableval"],
+     [enable_gallium_egl=auto])
+ if test "x$enable_gallium_egl" = xauto; then
+     case "$mesa_driver" in
+     dri|no)
+         enable_gallium_egl=$enable_egl
+         ;;
+     *)
+         enable_gallium_egl=no
+         ;;
+     esac
+ fi
+ case "x$enable_egl$enable_gallium_egl" in
+ xnoyes)
+     AC_MSG_ERROR([cannot build Gallium EGL state tracker without EGL])
+ esac
  AC_ARG_WITH([state-trackers],
      [AS_HELP_STRING([--with-state-trackers@<:@=DIRS...@:>@],
          [comma delimited state_trackers list, e.g.
      dri)
          GALLIUM_STATE_TRACKERS_DIRS="dri"
          HAVE_ST_DRI="yes"
-         if test "x$enable_egl" = xyes; then
-             GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl"
-             HAVE_ST_EGL="yes"
-         fi
          # Have only tested st/xorg on 1.6.0 servers
          PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6.0 libdrm >= $LIBDRM_XORG_REQUIRED libkms >= $LIBKMS_XORG_REQUIRED],
              HAVE_ST_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg",
              HAVE_ST_XORG="no")
          ;;
      esac
+     if test "x$enable_egl" = xyes; then
+         if test "$enable_openvg" = yes; then
+             GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vega"
+             st_egl="yes"
+         fi
+         if test "$enable_gallium_egl" = yes; then
+             GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl"
+             HAVE_ST_EGL="yes"
+         fi
+     fi
      ;;
  *)
      # verify the requested state tracker exist
              PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
              HAVE_ST_XORG="yes"
              ;;
-         es)
-             AC_MSG_WARN([state tracker 'es' has been replaced by --enable-gles-overlay])
-             if test "x$enable_gles_overlay" != xyes; then
-                 if test "x$enable_gles1" != xyes -a "x$enable_gles2" != xyes; then
-                     CORE_DIRS="mapi/es1api mapi/es2api $CORE_DIRS"
-                 fi
-                 GLES_OVERLAY=1
-                 EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GLESv1_CM_LIB) $(GLESv2_LIB)'
-             fi
-           tracker=""
-             ;;
          vega)
-             CORE_DIRS="$CORE_DIRS mapi/vgapi"
-             VG_LIB_DEPS="$VG_LIB_DEPS -lpthread"
-             EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
+             if test "x$enable_openvg" != xyes; then
+                 AC_MSG_ERROR([cannot build vega state tracker without --enable-openvg])
+             fi
              ;;
 +        xorg/xvmc)
 +            # Check for libXvMC?
 +            if test "x$enable_gallium_g3dvl" != xyes; then
 +                AC_MSG_ERROR([cannot build XvMC state tracker without --enable-gallium-g3dvl])
 +            fi
 +            HAVE_ST_XVMC="yes"
 +            ;;
          esac
  
        if test -n "$tracker"; then
      ;;
  esac
  
+ EGL_CLIENT_APIS=""
+ VG_LIB_DEPS=""
+ case "x$enable_opengl$enable_gles1$enable_gles2" in
+ x*yes*)
+     EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
+     ;;
+ esac
+ if test "x$enable_gles_overlay" = xyes; then
+     EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GLESv1_CM_LIB) $(GLESv2_LIB)'
+ fi
+ if test "x$enable_openvg" = xyes; then
+     EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
+     VG_LIB_DEPS="$VG_LIB_DEPS -lpthread"
+ fi
  AC_SUBST([VG_LIB_DEPS])
  AC_SUBST([EGL_CLIENT_APIS])
  
@@@ -1473,7 -1580,7 +1587,7 @@@ dn
  dnl Gallium helper functions
  dnl
  gallium_check_st() {
 -    if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_XORG" = xyes; then
 +    if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_XORG" = xyes || test "x$HAVE_ST_XVMC" = xyes; then
           GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
      fi
      if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then
      if test "x$HAVE_ST_XORG" = xyes && test "x$3" != x; then
           GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
      fi
 +    if test "x$HAVE_ST_XVMC" = xyes && test "x$5" != x; then
 +         GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $5"
 +    fi
  }
  
  
@@@ -1571,7 -1675,7 +1685,7 @@@ AC_ARG_ENABLE([gallium-r600]
  if test "x$enable_gallium_r600" = xyes; then
      if test "x$HAVE_LIBDRM_RADEON" = xyes; then
        GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
 -      gallium_check_st "r600/drm" "dri-r600"
 +      gallium_check_st "r600/drm" "dri-r600" "xvmc-r600"
      else
        AC_MSG_ERROR([libdrm_radeon is missing, cannot build gallium-r600])
      fi
@@@ -1587,26 -1691,7 +1701,26 @@@ AC_ARG_ENABLE([gallium-nouveau]
      [enable_gallium_nouveau=no])
  if test "x$enable_gallium_nouveau" = xyes; then
      GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50"
 -    gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau"
 +    gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau" "xvmc-nouveau"
 +fi
 +
 +dnl
 +dnl Gallium G3DVL configuration
 +dnl
 +AC_ARG_ENABLE([gallium-g3dvl],
 +    [AS_HELP_STRING([--enable-gallium-g3dvl],
 +        [build gallium g3dvl @<:@default=disabled@:>@])],
 +    [enable_gallium_g3dvl="$enableval"],
 +    [enable_gallium_g3dvl=no])
 +if test "x$enable_gallium_g3dvl" = xyes; then
 +    case "$mesa_driver" in
 +    xlib)
 +        GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS xvmc-softpipe"
 +        ;;
 +    dri)
 +        GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS g3dvl/dri"
 +        ;;
 +    esac
  fi
  
  dnl
@@@ -1652,25 -1737,56 +1766,56 @@@ echo "        exec_prefix:     $exec_pr
  echo "        libdir:          $libdir"
  echo "        includedir:      $includedir"
  
+ dnl API info
+ echo ""
+ echo "        OpenGL:          $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
+ echo "        GLES overlay:    $enable_gles_overlay"
+ echo "        OpenVG:          $enable_openvg"
  dnl Driver info
  echo ""
  echo "        Driver:          $mesa_driver"
- if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
-     echo "        OSMesa:          lib$OSMESA_LIB"
- else
-     echo "        OSMesa:          no"
- fi
- if test "$mesa_driver" = dri; then
-     # cleanup the drivers var
-     dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/  */ /;s/ *$//'`
- if test "x$DRI_DIRS" = x; then
-     echo "        DRI drivers:     no"
- else
-     echo "        DRI drivers:     $dri_dirs"
+ if test "$mesa_driver" != no; then
+     if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
+         echo "        OSMesa:          lib$OSMESA_LIB"
+     else
+         echo "        OSMesa:          no"
+     fi
+     if test "$mesa_driver" = dri; then
+         # cleanup the drivers var
+         dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/  */ /;s/ *$//'`
+         if test "x$DRI_DIRS" = x; then
+             echo "        DRI drivers:     no"
+         else
+             echo "        DRI drivers:     $dri_dirs"
+         fi
+         echo "        DRI driver dir:  $DRI_DRIVER_INSTALL_DIR"
+         echo "        Use XCB:         $enable_xcb"
+     fi
  fi
-     echo "        DRI driver dir:  $DRI_DRIVER_INSTALL_DIR"
+ echo ""
+ echo "        GLU:             $enable_glu"
+ echo "        GLw:             $enable_glw (Motif: $enable_motif)"
+ echo "        glut:            $enable_glut"
+ dnl EGL
+ echo ""
+ echo "        EGL:             $enable_egl"
+ if test "$enable_egl" = yes; then
+     echo "        EGL platforms:   $EGL_PLATFORMS"
+     egl_drivers=""
+     for d in $EGL_DRIVERS_DIRS; do
+         egl_drivers="$egl_drivers egl_$d"
+     done
+     if test "$enable_gallium" = yes -a "$HAVE_ST_EGL" = yes; then
+         echo "        EGL drivers:    ${egl_drivers} egl_gallium"
+         echo "        EGL Gallium STs:$EGL_CLIENT_APIS"
+     else
+         echo "        EGL drivers:    $egl_drivers"
+     fi
  fi
- echo "        Use XCB:         $enable_xcb"
  
  echo ""
  if test "x$MESA_LLVM" = x1; then
@@@ -1689,9 -1805,6 +1834,6 @@@ if echo "$SRC_DIRS" | grep 'gallium' >/
      echo "        Winsys dirs:     $GALLIUM_WINSYS_DIRS"
      echo "        Driver dirs:     $GALLIUM_DRIVERS_DIRS"
      echo "        Trackers dirs:   $GALLIUM_STATE_TRACKERS_DIRS"
-     if test "x$HAVE_ST_EGL" = xyes; then
-         echo "        EGL client APIs: $EGL_CLIENT_APIS"
-     fi
  else
      echo "        Gallium:         no"
  fi
@@@ -1700,15 -1813,6 +1842,6 @@@ dnl Librarie
  echo ""
  echo "        Shared libs:     $enable_shared"
  echo "        Static libs:     $enable_static"
- if test "$enable_egl" = yes; then
-     echo "        EGL:             $EGL_DRIVERS_DIRS"
-     echo "        EGL platforms:   $EGL_PLATFORMS"
- else
-     echo "        EGL:             no"
- fi
- echo "        GLU:             $enable_glu"
- echo "        GLw:             $enable_glw (Motif: $enable_motif)"
- echo "        glut:            $enable_glut"
  
  dnl Compiler options
  # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
index f22c8b96123b25bf5cc1ebfc793da4613e579afa,0e5da1374ff18576d508cf303d3de7d7d2ed7413..4b9059d9aa3a56ff34f7232be4aa79871df0f297
@@@ -7,8 -7,6 +7,6 @@@ env.Append(CPPPATH = 
      'util',
  ])
  
- env.Tool('udis86')
  env.CodeGenerate(
      target = 'indices/u_indices_gen.c', 
      script = 'indices/u_indices_gen.py', 
@@@ -192,47 -190,52 +190,50 @@@ source = 
      'util/u_tile.c',
      'util/u_transfer.c',
      'util/u_upload_mgr.c',
 -    # Disabling until pipe-video branch gets merged in
 -    #'vl/vl_bitstream_parser.c',
 -    #'vl/vl_mpeg12_mc_renderer.c',
 -    #'vl/vl_compositor.c',
 -    #'vl/vl_csc.c',
 -    #'vl/vl_shader_build.c',
 +    'vl/vl_bitstream_parser.c',
 +    'vl/vl_mpeg12_mc_renderer.c',
 +    'vl/vl_compositor.c',
 +    'vl/vl_csc.c',
      'target-helpers/wrap_screen.c',
  ]
  
  if env['llvm']:
+     if env['UDIS86']:
+         env.Append(CPPDEFINES = [('HAVE_UDIS86', '1')])
      source += [
-     'gallivm/lp_bld_arit.c',
-     'gallivm/lp_bld_assert.c',
-     'gallivm/lp_bld_bitarit.c',
-     'gallivm/lp_bld_const.c',
-     'gallivm/lp_bld_conv.c',
-     'gallivm/lp_bld_debug.c',
-     'gallivm/lp_bld_flow.c',
-     'gallivm/lp_bld_format_aos.c',
-     'gallivm/lp_bld_format_soa.c',
-     'gallivm/lp_bld_format_yuv.c',
-     'gallivm/lp_bld_gather.c',
-     'gallivm/lp_bld_init.c',
-     'gallivm/lp_bld_intr.c',
-     'gallivm/lp_bld_logic.c',
-     'gallivm/lp_bld_misc.cpp',
-     'gallivm/lp_bld_pack.c',
-     'gallivm/lp_bld_printf.c',
-     'gallivm/lp_bld_quad.c',
-     'gallivm/lp_bld_sample.c',
-     'gallivm/lp_bld_sample_aos.c',
-     'gallivm/lp_bld_sample_soa.c',
-     'gallivm/lp_bld_struct.c',
-     'gallivm/lp_bld_swizzle.c',
-     'gallivm/lp_bld_tgsi_aos.c',
-     'gallivm/lp_bld_tgsi_info.c',
-     'gallivm/lp_bld_tgsi_soa.c',
-     'gallivm/lp_bld_type.c',
-     'draw/draw_llvm.c',
-     'draw/draw_llvm_sample.c',
-     'draw/draw_llvm_translate.c',
-     'draw/draw_pt_fetch_shade_pipeline_llvm.c',
-     'draw/draw_vs_llvm.c'
+         'gallivm/lp_bld_arit.c',
+         'gallivm/lp_bld_assert.c',
+         'gallivm/lp_bld_bitarit.c',
+         'gallivm/lp_bld_const.c',
+         'gallivm/lp_bld_conv.c',
+         'gallivm/lp_bld_debug.c',
+         'gallivm/lp_bld_flow.c',
+         'gallivm/lp_bld_format_aos.c',
+         'gallivm/lp_bld_format_soa.c',
+         'gallivm/lp_bld_format_yuv.c',
+         'gallivm/lp_bld_gather.c',
+         'gallivm/lp_bld_init.c',
+         'gallivm/lp_bld_intr.c',
+         'gallivm/lp_bld_logic.c',
+         'gallivm/lp_bld_misc.cpp',
+         'gallivm/lp_bld_pack.c',
+         'gallivm/lp_bld_printf.c',
+         'gallivm/lp_bld_quad.c',
+         'gallivm/lp_bld_sample.c',
+         'gallivm/lp_bld_sample_aos.c',
+         'gallivm/lp_bld_sample_soa.c',
+         'gallivm/lp_bld_struct.c',
+         'gallivm/lp_bld_swizzle.c',
+         'gallivm/lp_bld_tgsi_aos.c',
+         'gallivm/lp_bld_tgsi_info.c',
+         'gallivm/lp_bld_tgsi_soa.c',
+         'gallivm/lp_bld_type.c',
+         'draw/draw_llvm.c',
+         'draw/draw_llvm_sample.c',
+         'draw/draw_llvm_translate.c',
+         'draw/draw_pt_fetch_shade_pipeline_llvm.c',
+         'draw/draw_vs_llvm.c'
      ]
  
  gallium = env.ConvenienceLibrary(
      source = source,
  )
  
+ env.Alias('gallium', gallium)
  Export('gallium')
index 875b3a96ca693847db87a1ca8cbb51beec3256f7,3949cdaef9a04b67d87b34b396cb17fd193d62ba..f3ed4ad5bdd2ebfc78de7077c785620b82f933d5
@@@ -6,7 -6,6 +6,7 @@@
  #include "nouveau/nouveau_screen.h"
  #include "nouveau/nv_object.xml.h"
  #include "nvfx_context.h"
 +#include "nvfx_video_context.h"
  #include "nvfx_screen.h"
  #include "nvfx_resource.h"
  #include "nvfx_tex.h"
@@@ -78,6 -77,10 +78,10 @@@ nvfx_screen_get_param(struct pipe_scree
                return 1;
        case PIPE_CAP_DEPTH_CLAMP:
                return 0; // TODO: implement depth clamp
+       case PIPE_CAP_PRIMITIVE_RESTART:
+               return 0; // TODO: implement primitive restart
+       case PIPE_CAP_SHADER_STENCIL_EXPORT:
+               return 0;
        default:
                NOUVEAU_ERR("Warning: unknown PIPE_CAP %d\n", param);
                return 0;
@@@ -435,7 -438,6 +439,7 @@@ nvfx_screen_create(struct pipe_winsys *
        pscreen->get_paramf = nvfx_screen_get_paramf;
        pscreen->is_format_supported = nvfx_screen_is_format_supported;
        pscreen->context_create = nvfx_create;
 +      pscreen->video_context_create = nvfx_video_create;
  
        switch (dev->chipset & 0xf0) {
        case 0x30:
index 87ec8cd2e8310afe4326ac2fb40cd88dbbf6201b,8bc545d4175d2b469af8fdb9f7a42105d4800966..8a62d646d3ab27cf2631dc7d6c7b6c24ac2e448f
@@@ -43,7 -43,6 +43,7 @@@
  #include "r600_shader.h"
  #include "r600_pipe.h"
  #include "r600_state_inlines.h"
 +#include "r600_video_context.h"
  
  /*
   * pipe_context
@@@ -78,13 -77,16 +78,16 @@@ static void r600_destroy_context(struc
  {
        struct r600_pipe_context *rctx = (struct r600_pipe_context *)context;
  
+       rctx->context.delete_depth_stencil_alpha_state(&rctx->context, rctx->custom_dsa_flush);
        r600_context_fini(&rctx->ctx);
+       util_blitter_destroy(rctx->blitter);
        for (int i = 0; i < R600_PIPE_NSTATES; i++) {
                free(rctx->states[i]);
        }
  
-       util_blitter_destroy(rctx->blitter);
        u_upload_destroy(rctx->upload_vb);
        u_upload_destroy(rctx->upload_ib);
  
@@@ -219,24 -221,24 +222,24 @@@ static const char* r600_get_vendor(stru
  static const char *r600_get_family_name(enum radeon_family family)
  {
        switch(family) {
-       case CHIP_R600: return "R600";
-       case CHIP_RV610: return "RV610";
-       case CHIP_RV630: return "RV630";
-       case CHIP_RV670: return "RV670";
-       case CHIP_RV620: return "RV620";
-       case CHIP_RV635: return "RV635";
-       case CHIP_RS780: return "RS780";
-       case CHIP_RS880: return "RS880";
-       case CHIP_RV770: return "RV770";
-       case CHIP_RV730: return "RV730";
-       case CHIP_RV710: return "RV710";
-       case CHIP_RV740: return "RV740";
-       case CHIP_CEDAR: return "CEDAR";
-       case CHIP_REDWOOD: return "REDWOOD";
-       case CHIP_JUNIPER: return "JUNIPER";
-       case CHIP_CYPRESS: return "CYPRESS";
-       case CHIP_HEMLOCK: return "HEMLOCK";
-       default: return "unknown";
+       case CHIP_R600: return "AMD R600";
+       case CHIP_RV610: return "AMD RV610";
+       case CHIP_RV630: return "AMD RV630";
+       case CHIP_RV670: return "AMD RV670";
+       case CHIP_RV620: return "AMD RV620";
+       case CHIP_RV635: return "AMD RV635";
+       case CHIP_RS780: return "AMD RS780";
+       case CHIP_RS880: return "AMD RS880";
+       case CHIP_RV770: return "AMD RV770";
+       case CHIP_RV730: return "AMD RV730";
+       case CHIP_RV710: return "AMD RV710";
+       case CHIP_RV740: return "AMD RV740";
+       case CHIP_CEDAR: return "AMD CEDAR";
+       case CHIP_REDWOOD: return "AMD REDWOOD";
+       case CHIP_JUNIPER: return "AMD JUNIPER";
+       case CHIP_CYPRESS: return "AMD CYPRESS";
+       case CHIP_HEMLOCK: return "AMD HEMLOCK";
+       default: return "AMD unknown";
        }
  }
  
@@@ -274,6 -276,7 +277,7 @@@ static int r600_get_param(struct pipe_s
        /* Unsupported features (boolean caps). */
        case PIPE_CAP_TIMER_QUERY:
        case PIPE_CAP_STREAM_OUTPUT:
+       case PIPE_CAP_PRIMITIVE_RESTART:
        case PIPE_CAP_INDEP_BLEND_FUNC: /* FIXME allow this */
                return 0;
  
@@@ -429,6 -432,9 +433,9 @@@ static void r600_destroy_screen(struct 
  
        if (rscreen == NULL)
                return;
+       radeon_decref(rscreen->radeon);
        FREE(rscreen);
  }
  
@@@ -452,7 -458,6 +459,7 @@@ struct pipe_screen *r600_screen_create(
        rscreen->screen.get_paramf = r600_get_paramf;
        rscreen->screen.is_format_supported = r600_is_format_supported;
        rscreen->screen.context_create = r600_create_context;
 +      rscreen->screen.video_context_create = r600_video_create;
        r600_init_screen_texture_functions(&rscreen->screen);
        r600_init_screen_resource_functions(&rscreen->screen);
  
index dea7f885e0def451cbab52bfe416559df94660e1,ea10e8a9f986f5cbb7bd0933aaf1990abf4e3cfa..9b2abdfd7f11caa0e18fdc2b84ef12e86b49c1b3
@@@ -35,7 -35,8 +35,9 @@@ softpipe = env.ConvenienceLibrary
                'sp_tex_tile_cache.c',
                'sp_texture.c',
                'sp_tile_cache.c',
 +              'sp_video_context.c',
        ])
  
+ env.Alias('softpipe', softpipe)
  Export('softpipe')
index edc2a6dacf27ca8d004353b7769b7aad5057745b,5f171d314a3c5b7ea89e267df9a64f730f37d192..5e13d6323876048027a3e25c146b117f35d24d75
@@@ -39,7 -39,6 +39,7 @@@
  #include "sp_texture.h"
  #include "sp_screen.h"
  #include "sp_context.h"
 +#include "sp_video_context.h"
  #include "sp_fence.h"
  #include "sp_public.h"
  
@@@ -65,7 -64,12 +65,12 @@@ softpipe_get_param(struct pipe_screen *
     case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
        return PIPE_MAX_SAMPLERS;
     case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS:
+ #ifdef HAVE_LLVM
+       /* Softpipe doesn't yet know how to tell draw/llvm about textures */
+       return 0;
+ #else
        return PIPE_MAX_VERTEX_SAMPLERS;
+ #endif
     case PIPE_CAP_MAX_COMBINED_SAMPLERS:
        return PIPE_MAX_SAMPLERS + PIPE_MAX_VERTEX_SAMPLERS;
     case PIPE_CAP_NPOT_TEXTURES:
@@@ -299,7 -303,6 +304,7 @@@ softpipe_create_screen(struct sw_winsy
     screen->base.is_format_supported = softpipe_is_format_supported;
     screen->base.context_create = softpipe_create_context;
     screen->base.flush_frontbuffer = softpipe_flush_frontbuffer;
 +   screen->base.video_context_create = sp_video_create;
  
     util_format_s3tc_init();