From: Christian König Date: Thu, 11 Nov 2010 20:07:42 +0000 (+0100) Subject: Merge remote branch 'origin/master' into pipe-video X-Git-Url: https://git.libre-soc.org/?p=mesa.git;a=commitdiff_plain;h=195bbe8ce218533569dde1368d04da0fd229913d;hp=99b57bc20e839043ec6160502814085a0976fccc Merge remote branch 'origin/master' into pipe-video --- diff --git a/SConstruct b/SConstruct index 558ebf90aaa..c6198041fb0 100644 --- a/SConstruct +++ b/SConstruct @@ -3,14 +3,14 @@ # # For example, invoke scons as # -# scons debug=1 dri=0 machine=x86 +# scons build=debug llvm=yes machine=x86 # # to set configuration variables. Or you can write those options to a file # named config.py: # # # config.py -# debug=1 -# dri=0 +# build='debug' +# llvm=True # machine='x86' # # Invoke @@ -30,54 +30,8 @@ import common ####################################################################### # Configuration options -default_statetrackers = 'mesa' -default_targets = 'graw-null' - -if common.default_platform in ('linux', 'freebsd', 'darwin'): - default_drivers = 'softpipe,galahad,failover,svga,i915,i965,trace,identity,llvmpipe' - default_winsys = 'xlib' -elif common.default_platform in ('winddk',): - default_drivers = 'softpipe,svga,i915,i965,trace,identity' - default_winsys = 'all' -elif common.default_platform in ('embedded',): - default_drivers = 'softpipe,llvmpipe' - default_winsys = 'xlib' -else: - default_drivers = 'all' - default_winsys = 'all' - opts = Variables('config.py') common.AddOptions(opts) -opts.Add(ListVariable('statetrackers', 'state trackers to build', default_statetrackers, - ['mesa', 'python', 'xorg', 'egl'])) -opts.Add(ListVariable('drivers', 'pipe drivers to build', default_drivers, - ['softpipe', 'galahad', 'failover', 'svga', 'i915', 'i965', 'trace', 'r300', 'r600', 'identity', 'llvmpipe', 'nouveau', 'nv50', 'nvfx'])) -opts.Add(ListVariable('winsys', 'winsys drivers to build', default_winsys, - ['xlib', 'vmware', 'i915', 'i965', 'gdi', 'radeon', 'r600', 'graw-xlib'])) - -opts.Add(ListVariable('targets', 'driver targets to build', default_targets, - ['dri-i915', - 'dri-i965', - 'dri-nouveau', - 'dri-radeong', - 'dri-swrast', - 'dri-vmwgfx', - 'egl-i915', - 'egl-i965', - 'egl-nouveau', - 'egl-radeon', - 'egl-swrast', - 'egl-vmwgfx', - 'graw-xlib', - 'graw-null', - 'libgl-gdi', - 'libgl-xlib', - 'xorg-i915', - 'xorg-i965', - 'xorg-nouveau', - 'xorg-radeon', - 'xorg-vmwgfx'])) - opts.Add(EnumVariable('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0'))) env = Environment( @@ -87,61 +41,26 @@ env = Environment( ENV = os.environ, ) -if os.environ.has_key('CC'): - env['CC'] = os.environ['CC'] -if os.environ.has_key('CFLAGS'): - env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS']) -if os.environ.has_key('CXX'): - env['CXX'] = os.environ['CXX'] -if os.environ.has_key('CXXFLAGS'): - env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS']) -if os.environ.has_key('LDFLAGS'): - env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS']) +# Backwards compatability with old target configuration variable +try: + targets = ARGUMENTS['targets'] +except KeyError: + pass +else: + targets = targets.split(',') + print 'scons: warning: targets option is deprecated; pass the targets on their own such as' + print + print ' scons %s' % ' '.join(targets) + print + COMMAND_LINE_TARGETS.append(targets) -Help(opts.GenerateHelpText(env)) -# replicate options values in local variables -debug = env['debug'] -dri = env['dri'] -machine = env['machine'] -platform = env['platform'] - -# derived options -x86 = machine == 'x86' -ppc = machine == 'ppc' -gcc = platform in ('linux', 'freebsd', 'darwin', 'embedded') -msvc = platform in ('windows', 'winddk') - -Export([ - 'debug', - 'x86', - 'ppc', - 'dri', - 'platform', - 'gcc', - 'msvc', -]) +Help(opts.GenerateHelpText(env)) ####################################################################### # Environment setup -# Always build trace, rbug, identity, softpipe, and llvmpipe (where possible) -if 'trace' not in env['drivers']: - env['drivers'].append('trace') -if 'rbug' not in env['drivers']: - env['drivers'].append('rbug') -if 'galahad' not in env['drivers']: - env['drivers'].append('galahad') -if 'identity' not in env['drivers']: - env['drivers'].append('identity') -if 'softpipe' not in env['drivers']: - env['drivers'].append('softpipe') -if env['llvm'] and 'llvmpipe' not in env['drivers']: - env['drivers'].append('llvmpipe') -if 'sw' not in env['drivers']: - env['drivers'].append('sw') - # Includes env.Prepend(CPPPATH = [ '#/include', @@ -157,7 +76,7 @@ if env['msvc']: env.Append(CPPPATH = ['#include/c99']) # Embedded -if platform == 'embedded': +if env['platform'] == 'embedded': env.Append(CPPDEFINES = [ '_POSIX_SOURCE', ('_POSIX_C_SOURCE', '199309L'), @@ -174,7 +93,7 @@ if platform == 'embedded': ]) # Posix -if platform in ('posix', 'linux', 'freebsd', 'darwin'): +if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'): env.Append(CPPDEFINES = [ '_POSIX_SOURCE', ('_POSIX_C_SOURCE', '199309L'), @@ -184,9 +103,9 @@ if platform in ('posix', 'linux', 'freebsd', 'darwin'): 'PTHREADS', 'HAVE_POSIX_MEMALIGN', ]) - if gcc: + if env['gcc']: env.Append(CFLAGS = ['-fvisibility=hidden']) - if platform == 'darwin': + if env['platform'] == 'darwin': env.Append(CPPDEFINES = ['_DARWIN_C_SOURCE']) env.Append(LIBS = [ 'm', @@ -212,5 +131,3 @@ SConscript( duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html ) -env.Default('src') - diff --git a/common.py b/common.py index 13e8dc83e97..b7749c925df 100644 --- a/common.py +++ b/common.py @@ -8,6 +8,8 @@ import subprocess import sys import platform as _platform +import SCons.Script.SConscript + ####################################################################### # Defaults @@ -20,6 +22,15 @@ _platform_map = { default_platform = sys.platform default_platform = _platform_map.get(default_platform, default_platform) +# Search sys.argv[] for a "platform=foo" argument since we don't have +# an 'env' variable at this point. +if 'platform' in SCons.Script.ARGUMENTS: + selected_platform = SCons.Script.ARGUMENTS['platform'] +else: + selected_platform = default_platform + +cross_compiling = selected_platform != default_platform + _machine_map = { 'x86': 'x86', 'i386': 'x86', @@ -37,38 +48,26 @@ if 'PROCESSOR_ARCHITECTURE' in os.environ: else: default_machine = _platform.machine() default_machine = _machine_map.get(default_machine, 'generic') +default_toolchain = 'default' + +if selected_platform == 'windows' and cross_compiling: + default_machine = 'x86' + default_toolchain = 'crossmingw' # find default_llvm value if 'LLVM' in os.environ: default_llvm = 'yes' else: - # Search sys.argv[] for a "platform=foo" argument since we don't have - # an 'env' variable at this point. - platform = default_platform - pattern = re.compile("(platform=)(.*)") - for arg in sys.argv: - m = pattern.match(arg) - if m: - platform = m.group(2) - default_llvm = 'no' try: - if platform != 'windows' and subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0: + if selected_platform != 'windows' and \ + subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0: default_llvm = 'yes' except: pass -# find default_dri value -if default_platform in ('linux', 'freebsd'): - default_dri = 'yes' -elif default_platform in ('winddk', 'windows', 'wince', 'darwin'): - default_dri = 'no' -else: - default_dri = 'no' - - ####################################################################### # Common options @@ -88,8 +87,7 @@ def AddOptions(opts): allowed_values=('generic', 'ppc', 'x86', 'x86_64'))) opts.Add(EnumOption('platform', 'target platform', default_platform, allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos5', 'freebsd8'))) - opts.Add('toolchain', 'compiler toolchain', 'default') + opts.Add('toolchain', 'compiler toolchain', default_toolchain) opts.Add(BoolOption('llvm', 'use LLVM', default_llvm)) - opts.Add(BoolOption('dri', 'build DRI drivers', default_dri)) opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes')) opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no')) diff --git a/configure.ac b/configure.ac index 5d2f9d75d0e..c172c1cbaed 100644 --- a/configure.ac +++ b/configure.ac @@ -465,6 +465,71 @@ if test "x$enable_selinux" = "xyes"; then 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 @@ 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@:>@])], @@ -492,6 +561,11 @@ AC_ARG_WITH([driver], 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 @@ dnl Driver specific build directories 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 @@ 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 @@ dri) osmesa) DRIVER_DIRS="osmesa" ;; +no) + DRIVER_DRIS="" + ;; esac AC_SUBST([SRC_DIRS]) AC_SUBST([GLU_DIRS]) @@ -623,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 @@ if test "x$with_dri_drivers" = x; then 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 @@ 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" @@ -891,19 +947,21 @@ if test "$mesa_driver" = dri; then 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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. @@ -1280,16 +1381,24 @@ yes) 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 @@ -1315,22 +1424,10 @@ yes) 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? @@ -1355,6 +1452,23 @@ yes) ;; 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]) @@ -1652,25 +1766,56 @@ echo " exec_prefix: $exec_prefix" 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 +1834,6 @@ if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then 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 +1842,6 @@ dnl Libraries 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 diff --git a/docs/egl.html b/docs/egl.html index d38f2dd7b7d..ee9bf355d7c 100644 --- a/docs/egl.html +++ b/docs/egl.html @@ -28,18 +28,17 @@ cards.

  1. -

    Run configure with the desired state trackers and enable -the Gallium driver for your hardware. For example

    +

    Run configure with the desired client APIs and enable +the driver for your hardware. For example

    -  $ ./configure --enable-gles-overlay --with-state-trackers=egl,vega --enable-gallium-intel
    +  $ ./configure --enable-gles2 --enable-openvg --enable-gallium-nouveau
     
    -

    The main library and OpenGL is enabled by default. The first option enables -OpenGL ES 1.x and 2.x. The egl state -tracker is needed by a number of EGL drivers. EGL drivers will be covered -later. The vega state tracker provides OpenVG -1.x.

    +

    The main library and OpenGL is enabled by default. The first option above +enables OpenGL ES 2.x. The second option enables +OpenVG.

    +
  2. Build and install Mesa as usual.
  3. @@ -80,31 +79,35 @@ types such as EGLNativeDisplayType or

    The available platforms are x11, drm, fbdev, and gdi. The gdi platform can -only be built with SCons.

    +only be built with SCons. Unless for special needs, the build system should +select the right platforms automatically.

    -
  4. --with-state-trackers +
  5. --enable-gles1 and --enable-gles2 -

    The argument is a comma separated string. It is usually used to specify the -rendering APIs, such as OpenVG, to build. But it is also used to specify -egl state tracker that egl_gallium depends on.

    +

    These options enable OpenGL ES support in OpenGL. The result is +one big library that supports multiple APIs.

  6. --enable-gles-overlay -

    OpenGL and OpenGL ES are not controlled by ---with-state-trackers. OpenGL is always built. To build OpenGL -ES, this option must be explicitly given.

    +

    This option enables OpenGL ES as separate libraries. This is an alternative +approach to enable OpenGL ES. It is only supported by +egl_gallium.

  7. -
  8. --enable-gles1 and --enable-gles2 +
  9. --enable-openvg -

    Unlike --enable-gles-overlay, which builds one library for each -rendering API, these options enable OpenGL ES support in OpenGL. The result is -one big library that supports multiple APIs.

    +

    OpenVG must be explicitly enabled by this option.

    + +
  10. + +
  11. --enable-gallium-egl + +

    Explicitly enable or disable egl_gallium.

  12. @@ -139,10 +142,6 @@ binaries.

    specified EGL driver to be loaded. It comes in handy when one wants to test a specific driver. This variable is ignored for setuid/setgid binaries.

    -

    egl_gallium dynamically loads hardware drivers and client API -modules found in EGL_DRIVERS_PATH. Thus, specifying this variable -alone is not sufficient for egl_gallium for uninstalled build.

    -
  13. EGL_PLATFORM @@ -150,7 +149,12 @@ alone is not sufficient for egl_gallium for uninstalled build.

    This variable specifies the native platform. The valid values are the same as those for --with-egl-platforms. When the variable is not set, the main library uses the first platform listed in ---with-egl-platforms as the native platform

    +--with-egl-platforms as the native platform.

    + +

    Extensions like EGL_MESA_drm_display define new functions to +create displays for non-native platforms. These extensions are usually used by +applications that support non-native platforms. Setting this variable is +probably required only for some of the demos found in mesa/demo repository.

  14. @@ -173,11 +177,19 @@ variable to true forces the use of software rendering.

    EGL Drivers

    @@ -295,7 +290,6 @@ should as well lock the display before using it.