Merge branch 'xa_branch'
authorThomas Hellstrom <thellstrom@vmware.com>
Mon, 4 Jul 2011 08:21:35 +0000 (10:21 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Mon, 4 Jul 2011 08:21:35 +0000 (10:21 +0200)
Conflicts:
configure.ac

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
379 files changed:
Makefile
SConstruct
common.py
configs/autoconf.in
configs/default
configs/linux-llvm
configure.ac
docs/GL3.txt
docs/egl.html
docs/opengles.html
docs/openvg.html
docs/relnotes-7.11.html
include/EGL/eglplatform.h
include/GL/internal/dri_interface.h
scons/custom.py
scons/gallium.py
src/SConscript
src/driclient/include/driclient.h [deleted file]
src/driclient/include/xf86dri.h [deleted file]
src/driclient/src/Makefile [deleted file]
src/driclient/src/XF86dri.c [deleted file]
src/driclient/src/driclient.c [deleted file]
src/driclient/src/xf86dristr.h [deleted file]
src/egl/drivers/dri2/Makefile
src/egl/drivers/dri2/egl_dri2.c
src/egl/drivers/dri2/egl_dri2.h
src/egl/drivers/dri2/platform_drm.c
src/egl/drivers/dri2/platform_wayland.c
src/egl/drivers/dri2/platform_x11.c
src/egl/drivers/glx/egl_glx.c
src/egl/main/Makefile
src/egl/main/eglapi.c
src/egl/main/eglapi.h
src/egl/main/eglarray.c
src/egl/main/eglarray.h
src/egl/main/eglcompiler.h
src/egl/main/eglconfig.c
src/egl/main/eglconfig.h
src/egl/main/eglcontext.c
src/egl/main/eglcontext.h
src/egl/main/eglcurrent.c
src/egl/main/eglcurrent.h
src/egl/main/egldefines.h
src/egl/main/egldisplay.c
src/egl/main/egldisplay.h
src/egl/main/egldriver.c
src/egl/main/egldriver.h
src/egl/main/eglfallbacks.c
src/egl/main/eglglobals.c
src/egl/main/eglglobals.h
src/egl/main/eglimage.c
src/egl/main/eglimage.h
src/egl/main/egllog.c
src/egl/main/egllog.h
src/egl/main/eglmisc.c
src/egl/main/eglmisc.h
src/egl/main/eglmode.c
src/egl/main/eglmode.h
src/egl/main/eglmutex.h
src/egl/main/eglscreen.c
src/egl/main/eglscreen.h
src/egl/main/eglstring.c
src/egl/main/eglstring.h
src/egl/main/eglsurface.c
src/egl/main/eglsurface.h
src/egl/main/eglsync.c
src/egl/main/eglsync.h
src/egl/main/egltypedefs.h
src/egl/wayland/wayland-drm/wayland-drm.c
src/gallium/SConscript
src/gallium/auxiliary/draw/draw_llvm.c
src/gallium/auxiliary/draw/draw_pipe_aaline.c
src/gallium/auxiliary/draw/draw_pipe_aapoint.c
src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
src/gallium/auxiliary/indices/u_unfilled_gen.py
src/gallium/auxiliary/indices/u_unfilled_indices.c
src/gallium/auxiliary/os/os_memory.h
src/gallium/auxiliary/os/os_misc.h
src/gallium/auxiliary/os/os_thread.h
src/gallium/auxiliary/os/os_time.c
src/gallium/auxiliary/util/u_debug.c
src/gallium/auxiliary/util/u_upload_mgr.c
src/gallium/auxiliary/util/u_upload_mgr.h
src/gallium/auxiliary/util/u_vbuf_mgr.c
src/gallium/auxiliary/util/u_vbuf_mgr.h
src/gallium/drivers/i915/Makefile
src/gallium/drivers/i915/SConscript
src/gallium/drivers/i915/TODO
src/gallium/drivers/i915/i915_clear.c
src/gallium/drivers/i915/i915_context.c
src/gallium/drivers/i915/i915_context.h
src/gallium/drivers/i915/i915_fpc.h
src/gallium/drivers/i915/i915_fpc_emit.c
src/gallium/drivers/i915/i915_fpc_translate.c
src/gallium/drivers/i915/i915_query.c [new file with mode: 0644]
src/gallium/drivers/i915/i915_query.h [new file with mode: 0644]
src/gallium/drivers/i915/i915_resource.c
src/gallium/drivers/i915/i915_resource.h
src/gallium/drivers/i915/i915_resource_texture.c
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/i915/i915_screen.h
src/gallium/drivers/i915/i915_state.c
src/gallium/drivers/i915/i915_state_derived.c
src/gallium/drivers/i915/i915_state_emit.c
src/gallium/drivers/i915/i915_state_inlines.h
src/gallium/drivers/i915/i915_state_sampler.c
src/gallium/drivers/i915/i915_state_static.c
src/gallium/drivers/llvmpipe/SConscript
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/nouveau/nouveau_screen.c
src/gallium/drivers/nouveau/nouveau_screen.h
src/gallium/drivers/nv50/nv50_context.c
src/gallium/drivers/nv50/nv50_context.h
src/gallium/drivers/nv50/nv50_screen.h
src/gallium/drivers/nv50/nv50_vbo.c
src/gallium/drivers/nvc0/nvc0_context.c
src/gallium/drivers/nvc0/nvc0_context.h
src/gallium/drivers/nvc0/nvc0_screen.h
src/gallium/drivers/nvc0/nvc0_vbo.c
src/gallium/drivers/nvfx/nvfx_context.c
src/gallium/drivers/nvfx/nvfx_screen.c
src/gallium/drivers/nvfx/nvfx_screen.h
src/gallium/drivers/r300/r300_render.c
src/gallium/drivers/r300/r300_texture.c
src/gallium/drivers/r600/SConscript
src/gallium/drivers/r600/eg_state_inlines.h
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600.h
src/gallium/drivers/r600/r600_asm.c
src/gallium/drivers/r600/r600_blit.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/r600/r600_query.c
src/gallium/drivers/r600/r600_shader.c
src/gallium/drivers/r600/r600_shader.h
src/gallium/drivers/r600/r600_state.c
src/gallium/drivers/r600/r600_state_common.c
src/gallium/drivers/r600/r600_state_inlines.h
src/gallium/drivers/r600/r600_texture.c
src/gallium/drivers/r600/r600d.h
src/gallium/drivers/svga/svga_context.c
src/gallium/drivers/svga/svga_context.h
src/gallium/drivers/svga/svga_draw.c
src/gallium/drivers/svga/svga_draw.h
src/gallium/drivers/svga/svga_draw_private.h
src/gallium/drivers/svga/svga_pipe_draw.c
src/gallium/drivers/svga/svga_resource_buffer.h
src/gallium/drivers/svga/svga_resource_buffer_upload.c
src/gallium/drivers/svga/svga_state_vdecl.c
src/gallium/include/pipe/p_config.h
src/gallium/include/state_tracker/st_api.h
src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp
src/gallium/state_trackers/dri/common/dri_context.c
src/gallium/state_trackers/dri/common/dri_drawable.c
src/gallium/state_trackers/dri/common/dri_drawable.h
src/gallium/state_trackers/dri/drm/SConscript
src/gallium/state_trackers/dri/drm/dri2.c
src/gallium/state_trackers/dri/sw/drisw.c
src/gallium/state_trackers/egl/Makefile
src/gallium/state_trackers/egl/SConscript
src/gallium/state_trackers/egl/common/egl_g3d.c
src/gallium/state_trackers/egl/common/egl_g3d.h
src/gallium/state_trackers/egl/common/egl_g3d_api.c
src/gallium/state_trackers/egl/common/egl_g3d_image.c
src/gallium/state_trackers/egl/common/egl_g3d_loader.h
src/gallium/state_trackers/egl/common/egl_g3d_st.c
src/gallium/state_trackers/egl/common/native.h
src/gallium/state_trackers/egl/common/native_buffer.h
src/gallium/state_trackers/egl/common/native_helper.c
src/gallium/state_trackers/egl/common/native_helper.h
src/gallium/state_trackers/egl/drm/modeset.c
src/gallium/state_trackers/egl/drm/native_drm.c
src/gallium/state_trackers/egl/drm/native_drm.h
src/gallium/state_trackers/egl/fbdev/native_fbdev.c
src/gallium/state_trackers/egl/gdi/native_gdi.c
src/gallium/state_trackers/egl/wayland/native_drm.c
src/gallium/state_trackers/egl/wayland/native_shm.c
src/gallium/state_trackers/egl/wayland/native_wayland.c
src/gallium/state_trackers/egl/wayland/native_wayland.h
src/gallium/state_trackers/egl/x11/native_dri2.c
src/gallium/state_trackers/egl/x11/native_x11.c
src/gallium/state_trackers/egl/x11/native_x11.h
src/gallium/state_trackers/egl/x11/native_ximage.c
src/gallium/state_trackers/gbm/Makefile [new file with mode: 0644]
src/gallium/state_trackers/gbm/gbm_drm.c [new file with mode: 0644]
src/gallium/state_trackers/gbm/gbm_gallium_drmint.h [new file with mode: 0644]
src/gallium/state_trackers/glx/xlib/xm_api.c
src/gallium/state_trackers/glx/xlib/xm_st.c
src/gallium/state_trackers/vega/vg_context.h
src/gallium/state_trackers/vega/vg_manager.c
src/gallium/state_trackers/wgl/stw_context.c
src/gallium/state_trackers/wgl/stw_ext_pbuffer.c
src/gallium/state_trackers/wgl/stw_st.c
src/gallium/state_trackers/xorg/SConscript
src/gallium/state_trackers/xorg/xorg_composite.c
src/gallium/state_trackers/xorg/xorg_crtc.c
src/gallium/targets/Makefile.xorg
src/gallium/targets/SConscript.dri
src/gallium/targets/dri-i915/SConscript
src/gallium/targets/dri-i965/SConscript
src/gallium/targets/dri-swrast/SConscript
src/gallium/targets/egl-static/Makefile [new file with mode: 0644]
src/gallium/targets/egl-static/SConscript
src/gallium/targets/egl-static/egl.c
src/gallium/targets/egl-static/egl_st.c
src/gallium/targets/egl-static/egl_st.h
src/gallium/targets/egl-static/st_GL.c [new file with mode: 0644]
src/gallium/targets/egl/Makefile [deleted file]
src/gallium/targets/egl/egl.c [deleted file]
src/gallium/targets/egl/egl.h [deleted file]
src/gallium/targets/egl/pipe_i915.c [deleted file]
src/gallium/targets/egl/pipe_i965.c [deleted file]
src/gallium/targets/egl/pipe_nouveau.c [deleted file]
src/gallium/targets/egl/pipe_r300.c [deleted file]
src/gallium/targets/egl/pipe_r600.c [deleted file]
src/gallium/targets/egl/pipe_swrast.c [deleted file]
src/gallium/targets/egl/pipe_vmwgfx.c [deleted file]
src/gallium/targets/egl/st_GL.c [deleted file]
src/gallium/targets/egl/st_OpenVG.c [deleted file]
src/gallium/targets/gbm/Makefile [new file with mode: 0644]
src/gallium/targets/gbm/gbm.c [new file with mode: 0644]
src/gallium/targets/gbm/pipe_i915.c [new file with mode: 0644]
src/gallium/targets/gbm/pipe_i965.c [new file with mode: 0644]
src/gallium/targets/gbm/pipe_loader.c [new file with mode: 0644]
src/gallium/targets/gbm/pipe_loader.h [new file with mode: 0644]
src/gallium/targets/gbm/pipe_nouveau.c [new file with mode: 0644]
src/gallium/targets/gbm/pipe_r300.c [new file with mode: 0644]
src/gallium/targets/gbm/pipe_r600.c [new file with mode: 0644]
src/gallium/targets/gbm/pipe_swrast.c [new file with mode: 0644]
src/gallium/targets/gbm/pipe_vmwgfx.c [new file with mode: 0644]
src/gallium/targets/libgl-xlib/SConscript
src/gallium/targets/xorg-nouveau/Makefile
src/gallium/targets/xorg-nouveau/nouveau_xorg.c
src/gallium/targets/xorg-vmwgfx/SConscript
src/gallium/tests/trivial/Makefile
src/gallium/tests/trivial/quad-tex.c
src/gallium/tests/trivial/tri.c
src/gallium/winsys/i915/drm/SConscript
src/gallium/winsys/i965/drm/SConscript
src/gallium/winsys/r600/drm/SConscript
src/gallium/winsys/r600/drm/r600_drm.c
src/gallium/winsys/r600/drm/r600_hw_context.c
src/gallium/winsys/radeon/drm/SConscript
src/gallium/winsys/svga/drm/SConscript
src/gallium/winsys/sw/fbdev/fbdev_sw_winsys.c
src/gallium/winsys/sw/fbdev/fbdev_sw_winsys.h
src/gallium/winsys/sw/wayland/wayland_sw_winsys.h
src/gbm/Makefile [new file with mode: 0644]
src/gbm/backends/Makefile [new file with mode: 0644]
src/gbm/backends/Makefile.template [new file with mode: 0644]
src/gbm/backends/dri/Makefile [new file with mode: 0644]
src/gbm/backends/dri/driver_name.c [new file with mode: 0644]
src/gbm/backends/dri/gbm_dri.c [new file with mode: 0644]
src/gbm/backends/dri/gbm_driint.h [new file with mode: 0644]
src/gbm/main/Makefile [new file with mode: 0644]
src/gbm/main/backend.c [new file with mode: 0644]
src/gbm/main/backend.h [new file with mode: 0644]
src/gbm/main/common.c [new file with mode: 0644]
src/gbm/main/common.h [new file with mode: 0644]
src/gbm/main/common_drm.h [new file with mode: 0644]
src/gbm/main/gbm.c [new file with mode: 0644]
src/gbm/main/gbm.h [new file with mode: 0644]
src/gbm/main/gbm.pc.in [new file with mode: 0644]
src/gbm/main/gbmint.h [new file with mode: 0644]
src/glsl/SConscript
src/glsl/ast_function.cpp
src/glsl/ast_to_hir.cpp
src/glsl/glsl_parser_extras.cpp
src/glsl/glsl_parser_extras.h
src/glsl/ir.cpp
src/glsl/ir.h
src/glsl/ir_constant_expression.cpp
src/glsl/ir_function.cpp
src/glsl/ir_validate.cpp
src/glsl/linker.cpp
src/glsl/lower_if_to_cond_assign.cpp
src/glsl/lower_instructions.cpp
src/glsl/lower_mat_op_to_vec.cpp
src/glsl/main.cpp
src/glw/GLwDrawA.h
src/glw/GLwDrawAP.h
src/glx/SConscript [new file with mode: 0644]
src/glx/apple/apple_glapi.c
src/glx/applegl_glx.c
src/glx/dri2_glx.c
src/glx/dri_common.c
src/glx/dri_glx.c
src/glx/drisw_glx.c
src/glx/glx_pbuffer.c
src/glx/glxclient.h
src/glx/glxcmds.c
src/glx/glxcurrent.c
src/glx/indirect_glx.c
src/mapi/glapi/SConscript
src/mapi/glapi/gen/ARB_geometry_shader4.xml
src/mesa/drivers/dri/i915/i830_vtbl.c
src/mesa/drivers/dri/i915/i915_vtbl.c
src/mesa/drivers/dri/i965/brw_clip.c
src/mesa/drivers/dri/i965/brw_clip_state.c
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_draw.c
src/mesa/drivers/dri/i965/brw_draw_upload.c
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
src/mesa/drivers/dri/i965/brw_fs_emit.cpp
src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
src/mesa/drivers/dri/i965/brw_gs.c
src/mesa/drivers/dri/i965/brw_gs_state.c
src/mesa/drivers/dri/i965/brw_misc_state.c
src/mesa/drivers/dri/i965/brw_sf.c
src/mesa/drivers/dri/i965/brw_sf_state.c
src/mesa/drivers/dri/i965/brw_state.h
src/mesa/drivers/dri/i965/brw_state_cache.c
src/mesa/drivers/dri/i965/brw_state_dump.c
src/mesa/drivers/dri/i965/brw_state_upload.c
src/mesa/drivers/dri/i965/brw_vs.c
src/mesa/drivers/dri/i965/brw_vs_emit.c
src/mesa/drivers/dri/i965/brw_vs_state.c
src/mesa/drivers/dri/i965/brw_vtbl.c
src/mesa/drivers/dri/i965/brw_wm.c
src/mesa/drivers/dri/i965/brw_wm.h
src/mesa/drivers/dri/i965/brw_wm_state.c
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/gen6_cc.c
src/mesa/drivers/dri/i965/gen6_gs_state.c
src/mesa/drivers/dri/i965/gen6_sampler_state.c
src/mesa/drivers/dri/i965/gen6_scissor_state.c
src/mesa/drivers/dri/i965/gen6_urb.c
src/mesa/drivers/dri/i965/gen6_viewport_state.c
src/mesa/drivers/dri/i965/gen6_vs_state.c
src/mesa/drivers/dri/i965/gen6_wm_state.c
src/mesa/drivers/dri/i965/gen7_disable.c
src/mesa/drivers/dri/i965/gen7_urb.c
src/mesa/drivers/dri/i965/gen7_vs_state.c
src/mesa/drivers/dri/i965/gen7_wm_state.c
src/mesa/drivers/dri/intel/intel_batchbuffer.c
src/mesa/drivers/dri/intel/intel_batchbuffer.h
src/mesa/drivers/dri/intel/intel_buffers.c
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_context.h
src/mesa/drivers/dri/intel/intel_extensions.c
src/mesa/drivers/dri/intel/intel_fbo.c
src/mesa/drivers/dri/intel/intel_fbo.h
src/mesa/drivers/dri/intel/intel_screen.c
src/mesa/drivers/dri/intel/intel_span.c
src/mesa/drivers/dri/intel/intel_tex.c
src/mesa/drivers/dri/intel/intel_tex_image.c
src/mesa/drivers/dri/intel/intel_tex_obj.h
src/mesa/drivers/dri/r200/r200_cmdbuf.c
src/mesa/drivers/dri/r600/r700_render.c
src/mesa/drivers/dri/radeon/radeon_screen.c
src/mesa/main/buffers.c
src/mesa/main/buffers.h
src/mesa/main/context.c
src/mesa/main/fbobject.c
src/mesa/main/mtypes.h
src/mesa/main/pack.c
src/mesa/main/renderbuffer.c
src/mesa/main/renderbuffer.h
src/mesa/main/state.c
src/mesa/main/teximage.c
src/mesa/main/texobj.c
src/mesa/main/texstore.c
src/mesa/main/version.h
src/mesa/program/ir_to_mesa.cpp
src/mesa/state_tracker/st_atom_pixeltransfer.c
src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_cb_viewport.c
src/mesa/state_tracker/st_context.h
src/mesa/state_tracker/st_draw.c
src/mesa/state_tracker/st_format.c
src/mesa/state_tracker/st_format.h
src/mesa/state_tracker/st_manager.c
src/mesa/vbo/vbo_rebase.c

index 07ec6868856c38ef86485702477250af6c26c9a9..0a3deb8168ec7fa204a8b3ff683925d3240df0dc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -183,7 +183,7 @@ ultrix-gcc:
 
 # Rules for making release tarballs
 
-VERSION=7.11-devel
+VERSION=7.12-devel
 DIRECTORY = Mesa-$(VERSION)
 LIB_NAME = MesaLib-$(VERSION)
 GLUT_NAME = MesaGLUT-$(VERSION)
@@ -345,6 +345,16 @@ EGL_FILES = \
        $(DIRECTORY)/src/egl/main/*.pc.in                               \
        $(DIRECTORY)/src/egl/main/*.def
 
+GBM_FILES = \
+       $(DIRECTORY)/src/gbm/Makefile                                   \
+       $(DIRECTORY)/src/gbm/main/*.pc.in                               \
+       $(DIRECTORY)/src/gbm/main/*.[ch]                                \
+       $(DIRECTORY)/src/gbm/main/Makefile                              \
+       $(DIRECTORY)/src/gbm/backends/Makefile                          \
+       $(DIRECTORY)/src/gbm/backends/Makefile.template                 \
+       $(DIRECTORY)/src/gbm/backends/*/*.[ch]                          \
+       $(DIRECTORY)/src/gbm/backends/*/Makefile                        \
+
 GALLIUM_FILES = \
        $(DIRECTORY)/src/mesa/state_tracker/*[ch]                       \
        $(DIRECTORY)/src/gallium/Makefile                               \
@@ -376,8 +386,7 @@ DRI_FILES = \
        $(DIRECTORY)/src/glx/Makefile                                   \
        $(DIRECTORY)/src/glx/*.[ch]                                     \
        $(APPLE_DRI_FILES)                                              \
-       $(DIRECTORY)/src/mesa/drivers/dri/Makefile                      \
-       $(DIRECTORY)/src/mesa/drivers/dri/Makefile.template             \
+       $(DIRECTORY)/src/mesa/drivers/dri/Makefile*                     \
        $(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in                     \
        $(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po           \
        $(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS]                     \
@@ -443,6 +452,7 @@ LIB_FILES = \
        $(MAPI_FILES)           \
        $(ES_FILES)             \
        $(EGL_FILES)            \
+       $(GBM_FILES)            \
        $(GALLIUM_FILES)        \
        $(DRI_FILES)            \
        $(SGI_GLU_FILES)        \
index 8607d2cd8e0ab726039d02202e067c158ae75ff4..4a3fef0805942f904618ebcff889dcc41b408d0f 100644 (file)
@@ -40,6 +40,9 @@ env = Environment(
        ENV = os.environ,
 )
 
+# XXX: This creates a many problems as it saves...
+#opts.Save('config.py', env)
+
 # Backwards compatability with old target configuration variable
 try:
     targets = ARGUMENTS['targets']
@@ -80,44 +83,6 @@ env.Append(CPPPATH = [
 if env['msvc']:
     env.Append(CPPPATH = ['#include/c99'])
 
-# Embedded
-if env['platform'] == 'embedded':
-       env.Append(CPPDEFINES = [
-               '_POSIX_SOURCE',
-               ('_POSIX_C_SOURCE', '199309L'), 
-               '_SVID_SOURCE',
-               '_BSD_SOURCE', 
-               '_GNU_SOURCE',
-               
-               'PTHREADS',
-       ])
-       env.Append(LIBS = [
-               'm',
-               'pthread',
-               'dl',
-       ])
-
-# Posix
-if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
-       env.Append(CPPDEFINES = [
-               '_POSIX_SOURCE',
-               ('_POSIX_C_SOURCE', '199309L'), 
-               '_SVID_SOURCE',
-               '_BSD_SOURCE', 
-               '_GNU_SOURCE',
-               'PTHREADS',
-               'HAVE_POSIX_MEMALIGN',
-       ])
-       if env['gcc']:
-               env.Append(CFLAGS = ['-fvisibility=hidden'])
-       if env['platform'] == 'darwin':
-               env.Append(CPPDEFINES = ['_DARWIN_C_SOURCE'])
-       env.Append(LIBS = [
-               'm',
-               'pthread',
-               'dl',
-       ])
-
 # for debugging
 #print env.Dump()
 
@@ -130,7 +95,7 @@ if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
 #
 
 # Create host environent
-if env['crosscompile'] and env['platform'] != 'embedded':
+if env['crosscompile'] and not env['embedded']:
     host_env = Environment(
         options = opts,
         # no tool used
@@ -179,3 +144,18 @@ SConscript(
        duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
 )
 
+
+########################################################################
+# List all aliases
+
+try:
+    from SCons.Node.Alias import default_ans
+except ImportError:
+    pass
+else:
+    aliases = default_ans.keys()
+    aliases.sort()
+    env.Help('\n')
+    env.Help('Recognized targets:\n')
+    for alias in aliases:
+        env.Help('    %s\n' % alias)
index 0a3dcdcf54309995dbdcd5176a5080dab44604f3..8657030ea3f6480109e9fb17c12f7f4dbd4f9a9f 100644 (file)
--- a/common.py
+++ b/common.py
@@ -79,14 +79,17 @@ def AddOptions(opts):
                from SCons.Options.EnumOption import EnumOption
        opts.Add(EnumOption('build', 'build type', 'debug',
                          allowed_values=('debug', 'checked', 'profile', 'release')))
-       opts.Add(BoolOption('quiet', 'quiet command lines', 'yes'))
+       opts.Add(BoolOption('verbose', 'verbose output', 'no'))
        opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
                                                                                         allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
        opts.Add(EnumOption('platform', 'target platform', host_platform,
-                                                                                        allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos', 'freebsd8')))
+                                                                                        allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'cygwin', 'sunos', 'freebsd8')))
+       opts.Add(BoolOption('embedded', 'embedded build', 'no'))
        opts.Add('toolchain', 'compiler toolchain', default_toolchain)
        opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
        opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
        opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
        opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
-       opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
+       opts.Add(BoolOption('quiet', 'DEPRECATED: profile build', 'yes'))
+       if host_platform == 'windows':
+               opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
index abc01b1b2dd5b7a2174abd20ea95b9ca607588cb..cac4befe940221c55b6612875822e5b6cfbf1830 100644 (file)
@@ -75,6 +75,7 @@ GLESv2_LIB = GLESv2
 VG_LIB = OpenVG
 GLAPI_LIB = glapi
 WAYLAND_EGL_LIB = wayland-egl
+GBM_LIB = gbm
 
 # Library names (actual file names)
 GL_LIB_NAME = @GL_LIB_NAME@
@@ -88,6 +89,7 @@ GLESv2_LIB_NAME = @GLESv2_LIB_NAME@
 VG_LIB_NAME = @VG_LIB_NAME@
 GLAPI_LIB_NAME = @GLAPI_LIB_NAME@
 WAYLAND_EGL_LIB_NAME = @WAYLAND_EGL_LIB_NAME@
+GBM_LIB_NAME = @GBM_LIB_NAME@
 
 # Globs used to install the lib and all symlinks
 GL_LIB_GLOB = @GL_LIB_GLOB@
@@ -101,6 +103,7 @@ GLESv2_LIB_GLOB = @GLESv2_LIB_GLOB@
 VG_LIB_GLOB = @VG_LIB_GLOB@
 GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@
 WAYLAND_EGL_LIB_GLOB = @WAYLAND_EGL_LIB_GLOB@
+GBM_LIB_GLOB = @GBM_LIB_GLOB@
 
 # Directories to build
 LIB_DIR = @LIB_DIR@
@@ -108,6 +111,7 @@ SRC_DIRS = @SRC_DIRS@
 GLU_DIRS = @GLU_DIRS@
 DRIVER_DIRS = @DRIVER_DIRS@
 EGL_DRIVERS_DIRS = @EGL_DRIVERS_DIRS@
+GBM_BACKEND_DIRS = @GBM_BACKEND_DIRS@
 GALLIUM_DIRS = @GALLIUM_DIRS@
 GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
 GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
@@ -147,7 +151,8 @@ GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv1_CM_LIB_DEPS@
 GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
 VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
 GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@
-WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIBPATH) @WAYLAND_EGL_LIB_DEPS@
+WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @WAYLAND_EGL_LIB_DEPS@
+GBM_LIB_DEPS = $(EXTRA_LIB_PATH) @GBM_LIB_DEPS@
 
 # DRI dependencies
 MESA_MODULES = @MESA_MODULES@
@@ -206,6 +211,9 @@ EGL_PC_CFLAGS = @GL_PC_CFLAGS@
 WAYLAND_EGL_PC_REQ_PRIV = @WAYLAND_EGL_PC_REQ_PRIV@
 WAYLAND_EGL_PC_LIB_PRIV = @WAYLAND_EGL_PC_LIB_PRIV@
 WAYLAND_EGL_PC_CFLAGS = @WAYLAND_EGL_PC_CFLAGS@
+GBM_PC_REQ_PRIV = @GBM_PC_REQ_PRIV@
+GBM_PC_LIB_PRIV = @GBM_PC_LIB_PRIV@
+GBM_PC_CFLAGS = @GBM_PC_CFLAGS@
 
 XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@
 XCB_DRI2_LIBS = @XCB_DRI2_LIBS@
index b7acfd2f1a57d293acb3b3eec9234c43e7d57129..132ccbee3cfaf75d8162ec77415b34569116513e 100644 (file)
@@ -9,7 +9,7 @@ CONFIG_NAME = default
 
 # Version info
 MESA_MAJOR=7
-MESA_MINOR=11
+MESA_MINOR=12
 MESA_TINY=0
 MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
 
@@ -63,7 +63,7 @@ GLESv2_LIB = GLESv2
 VG_LIB = OpenVG
 GLAPI_LIB = glapi
 WAYLAND_EGL_LIB = wayland-egl
-
+GBM_LIB = gbm
 
 # Library names (actual file names)
 GL_LIB_NAME = lib$(GL_LIB).so
@@ -77,6 +77,7 @@ GLESv2_LIB_NAME = lib$(GLESv2_LIB).so
 VG_LIB_NAME = lib$(VG_LIB).so
 GLAPI_LIB_NAME = lib$(GLAPI_LIB).so
 WAYLAND_EGL_LIB_NAME = lib$(WAYLAND_EGL_LIB).so
+GBM_LIB_NAME = lib$(GBM_LIB).so
 
 # globs used to install the lib and all symlinks
 GL_LIB_GLOB = $(GL_LIB_NAME)*
@@ -90,6 +91,7 @@ GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
 VG_LIB_GLOB = $(VG_LIB_NAME)*
 GLAPI_LIB_GLOB = $(GLAPI_LIB_NAME)*
 WAYLAND_EGL_LIB_GLOB = $(WAYLAND_EGL_LIB_NAME)*
+GBM_LIB_GLOB = $(GBM_LIB_NAME)*
 
 DRI_CFLAGS = $(CFLAGS)
 DRI_CXXFLAGS = $(CXXFLAGS)
@@ -113,6 +115,9 @@ DRIVER_DIRS = x11 osmesa
 # EGL drivers to build
 EGL_DRIVERS_DIRS = glx
 
+# gbm backends to build
+GBM_BACKEND_DIRS = dri
+
 # Gallium directories and 
 GALLIUM_DIRS = auxiliary drivers state_trackers
 GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
@@ -140,6 +145,7 @@ GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
 VG_LIB_DEPS    = $(EXTRA_LIB_PATH) -lpthread
 GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
 WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -lwayland-client -ldrm
+GBM_LIB_DEPS = $(EXTRA_LIB_PATH) -ludev -ldl
 
 # Program dependencies - specific GL/glut libraries added in Makefiles
 APP_LIB_DEPS = -lm
@@ -159,6 +165,9 @@ DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
 # EGL driver install directory
 EGL_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/egl
 
+# gbm backend install directory
+GBM_BACKEND_INSTALL_DIR = $(INSTALL_LIB_DIR)/gbm
+
 # Xorg driver install directory (for xorg state-tracker)
 XORG_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/xorg/modules/drivers
 
@@ -191,3 +200,6 @@ VG_PC_CFLAGS =
 WAYLAND_EGL_PC_REQ_PRIV =
 WAYLAND_EGL_PC_LIB_PRIV =
 WAYLAND_EGL_PC_CFLAGS =
+GBM_PC_REQ_PRIV =
+GBM_PC_LIB_PRIV =
+GBM_PC_CFLAGS =
index 359bee28250674adee7d80b5a3bc3d593edb62e1..54d82b5376c12d7cae2401eb23ad9aade3e396d0 100644 (file)
@@ -42,3 +42,6 @@ endif
 
 LD = g++
 GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -lstdc++
+
+# to allow the NV drivers to compile
+LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
index a99a4e25f74c039dc35d779fd6ba95dfd1dffb71..f19f6478b6aa2addaa13d353afcd7862a5d36677 100644 (file)
@@ -177,8 +177,10 @@ if test "x$GXX" = xyes; then
     AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
     VISIBILITY_CXXFLAGS="-fvisibility=hidden"
     CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
+    AC_LANG_PUSH([C++])
     AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
                   [VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]);
+    AC_LANG_POP([C++])
 
     # Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed.
     CXXFLAGS=$save_CXXFLAGS
@@ -187,6 +189,15 @@ if test "x$GXX" = xyes; then
     CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
 fi
 
+dnl even if the compiler appears to support it, using visibility attributes isn't
+dnl going to do anything useful currently on cygwin apart from emit lots of warnings
+case "$host_os" in
+cygwin*)
+    VISIBILITY_CFLAGS=""
+    VISIBILITY_CXXFLAGS=""
+    ;;
+esac
+
 AC_SUBST([VISIBILITY_CFLAGS])
 AC_SUBST([VISIBILITY_CXXFLAGS])
 
@@ -352,6 +363,7 @@ GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
 VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
 GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
 WAYLAND_EGL_LIB_NAME='lib$(WAYLAND_EGL_LIB).'${LIB_EXTENSION}
+GBM_LIB_NAME='lib$(GBM_LIB).'${LIB_EXTENSION}
 
 GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
 GLU_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLU_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
@@ -365,6 +377,7 @@ GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LI
 VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
 GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
 WAYLAND_EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(WAYLAND_EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
+GBM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GBM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
 
 AC_SUBST([GL_LIB_NAME])
 AC_SUBST([GLU_LIB_NAME])
@@ -377,6 +390,7 @@ AC_SUBST([GLESv2_LIB_NAME])
 AC_SUBST([VG_LIB_NAME])
 AC_SUBST([GLAPI_LIB_NAME])
 AC_SUBST([WAYLAND_EGL_LIB_NAME])
+AC_SUBST([GBM_LIB_NAME])
 
 AC_SUBST([GL_LIB_GLOB])
 AC_SUBST([GLU_LIB_GLOB])
@@ -389,6 +403,7 @@ AC_SUBST([GLESv2_LIB_GLOB])
 AC_SUBST([VG_LIB_GLOB])
 AC_SUBST([GLAPI_LIB_GLOB])
 AC_SUBST([WAYLAND_EGL_LIB_GLOB])
+AC_SUBST([GBM_LIB_GLOB])
 
 dnl
 dnl Arch/platform-specific settings
@@ -507,7 +522,7 @@ if test "x$enable_selinux" = "xyes"; then
     DEFINES="$DEFINES -DMESA_SELINUX"
 fi
 
-dnl Determine which APIs to support
+dnl Options for APIs
 AC_ARG_ENABLE([opengl],
     [AS_HELP_STRING([--disable-opengl],
         [disable support for standard OpenGL API @<:@default=no@:>@])],
@@ -523,32 +538,92 @@ AC_ARG_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],
-        [DEPRECATED.  Same as --enable-gles1 and --enable-gles2])],
-    [enable_gles1="$enableval"; enable_gles2="$enableval"],
-    [])
-
 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
+AC_ARG_ENABLE([dri],
+    [AS_HELP_STRING([--enable-dri],
+        [enable DRI modules @<:@default=auto@:>@])],
+    [enable_dri="$enableval"],
+    [enable_dri=auto])
+AC_ARG_ENABLE([glx],
+    [AS_HELP_STRING([--enable-glx],
+        [enable GLX library @<:@default=auto@:>@])],
+    [enable_glx="$enableval"],
+    [enable_glx=auto])
+AC_ARG_ENABLE([osmesa],
+    [AS_HELP_STRING([--enable-osmesa],
+        [enable OSMesa library @<:@default=auto@:>@])],
+    [enable_osmesa="$enableval"],
+    [enable_osmesa=auto])
+AC_ARG_ENABLE([egl],
+    [AS_HELP_STRING([--disable-egl],
+        [disable EGL library @<:@default=enabled@:>@])],
+    [enable_egl="$enableval"],
+    [enable_egl=yes])
+
+AC_ARG_ENABLE([xorg],
+    [AS_HELP_STRING([--enable-xorg],
+        [enable support for X.Org DDX API @<:@default=no@:>@])],
+    [enable_xorg="$enableval"],
+    [enable_xorg=no])
+AC_ARG_ENABLE([xa],
+    [AS_HELP_STRING([--enable-xa],
+        [enable build of the XA X Acceleration API @<:@default=no@:>@])],
+    [enable_xa="$enableval"],
+    [enable_xa=no])
+AC_ARG_ENABLE([d3d1x],
+    [AS_HELP_STRING([--enable-d3d1x],
+        [enable support for Direct3D 10 & 11 low-level API @<:@default=no@:>@])],
+    [enable_d3d1x="$enableval"],
+    [enable_d3d1x=no])
+AC_ARG_ENABLE([gbm],
+   [AS_HELP_STRING([--enable-gbm],
+         [enable gbm library @<:@default=auto@:>@])],
+   [enable_gbm="$enableval"],
+   [enable_gbm=auto])
+
+AC_ARG_ENABLE([xlib_glx],
+    [AS_HELP_STRING([--enable-xlib-glx],
+        [make GLX library Xlib-based instead of DRI-based @<:@default=disable@:>@])],
+    [enable_xlib_glx="$enableval"],
+    [enable_xlib_glx=auto])
+AC_ARG_ENABLE([gallium_egl],
+    [AS_HELP_STRING([--enable-gallium-egl],
+        [enable optional EGL state tracker (not required
+         for EGL support in Gallium with OpenGL and OpenGL ES)
+         @<:@default=disable@:>@])],
+    [enable_gallium_egl="$enableval"],
+    [enable_gallium_egl=no])
+AC_ARG_ENABLE([gallium_gbm],
+    [AS_HELP_STRING([--enable-gallium-gbm],
+        [enable optional gbm state tracker (not required for
+         gbm support in Gallium)
+         @<:@default=auto@:>@])],
+    [enable_gallium_gbm="$enableval"],
+    [enable_gallium_gbm=auto])
+
+# Option for Gallium drivers
+GALLIUM_DRIVERS_DEFAULT="r300,r600,swrast"
+
+AC_ARG_WITH([gallium-drivers],
+    [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
+        [comma delimited Gallium drivers list, e.g.
+        "i915,i965,nouveau,r300,r600,svga,swrast"
+        @<:@default=r300,r600,swrast@:>@])],
+    [with_gallium_drivers="$withval"],
+    [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
 
 if test "x$enable_opengl" = xno -a \
         "x$enable_gles1" = xno -a \
         "x$enable_gles2" = xno -a \
-        "x$enable_openvg" = xno; then
+        "x$enable_openvg" = xno -a \
+        "x$enable_xorg" = xno -a \
+        "x$enable_xa" = xno -a \
+        "x$enable_d3d1x" = xno; then
     AC_MSG_ERROR([at least one API should be enabled])
 fi
 
@@ -602,24 +677,60 @@ if test "x$enable_opengl" = xno; then
 fi
 
 AC_ARG_WITH([driver],
-    [AS_HELP_STRING([--with-driver=DRIVER],
-        [driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])],
+    [AS_HELP_STRING([--with-driver=DRIVER], [DEPRECATED])],
     [mesa_driver="$withval"],
-    [mesa_driver="$default_driver"])
+    [mesa_driver=auto])
 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])
+xxlib|xdri|xosmesa|xno)
+    if test "x$enable_dri" != xauto -o \
+            "x$enable_glx" != xauto -o \
+            "x$enable_osmesa" != xauto -o \
+            "x$enable_xlib_glx" != xauto; then
+        AC_MSG_ERROR([--with-driver=$mesa_driver is deprecated])
     fi
     ;;
-xno)
+xauto)
+    mesa_driver="$default_driver"
     ;;
 *)
     AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
     ;;
 esac
 
+# map $mesa_driver to APIs
+if test "x$enable_dri" = xauto; then
+    case "x$mesa_driver" in
+    xdri) enable_dri=yes ;;
+    *)    enable_dri=no ;;
+    esac
+fi
+
+if test "x$enable_glx" = xauto; then
+    case "x$mesa_driver" in
+    xdri|xxlib) enable_glx=yes ;;
+    *)          enable_glx=no ;;
+    esac
+fi
+
+if test "x$enable_osmesa" = xauto; then
+    case "x$mesa_driver" in
+    xxlib|xosmesa) enable_osmesa=yes ;;
+    *)             enable_osmesa=no ;;
+    esac
+fi
+
+if test "x$enable_xlib_glx" = xauto; then
+    case "x$mesa_driver" in
+    xxlib) enable_xlib_glx=yes ;;
+    *)     enable_xlib_glx=no ;;
+    esac
+fi
+
+if test "x$enable_glx" = xno; then
+    enable_xlib_glx=no
+fi
+
 dnl
 dnl Driver specific build directories
 dnl
@@ -657,11 +768,6 @@ if test "x$enable_gles2" = xyes; then
     CORE_DIRS="$CORE_DIRS mapi/es2api"
 fi
 
-# 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" in
 x*yes*)
@@ -669,24 +775,36 @@ x*yes*)
     ;;
 esac
 
-case "$mesa_driver" in
-xlib)
-    DRIVER_DIRS="x11"
+case "x$enable_glx$enable_xlib_glx" in
+xyesyes)
+    DRIVER_DIRS="$DRIVER_DIRS x11"
     GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
     GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
+    GALLIUM_STATE_TRACKERS_DIRS="glx $GALLIUM_STATE_TRACKERS_DIRS"
     ;;
-dri)
+xyesno)
+    # DRI-based GLX
     SRC_DIRS="$SRC_DIRS glx"
-    DRIVER_DIRS="dri"
-    GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib sw/dri"
-    ;;
-osmesa)
-    DRIVER_DIRS="osmesa"
-    ;;
-no)
-    DRIVER_DRIS=""
     ;;
 esac
+
+if test "x$enable_dri" = xyes; then
+    DRIVER_DIRS="$DRIVER_DIRS dri"
+
+    GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib sw/dri"
+    GALLIUM_STATE_TRACKERS_DIRS="dri $GALLIUM_STATE_TRACKERS_DIRS"
+    HAVE_ST_DRI="yes"
+fi
+
+if test "x$enable_osmesa" = xyes; then
+    # the empty space matters for osmesa... (see src/mesa/Makefile)
+    if test -n "$DRIVER_DIRS"; then
+        DRIVER_DIRS="$DRIVER_DIRS osmesa"
+    else
+        DRIVER_DIRS="osmesa"
+    fi
+fi
+
 AC_SUBST([SRC_DIRS])
 AC_SUBST([GLU_DIRS])
 AC_SUBST([DRIVER_DIRS])
@@ -697,6 +815,22 @@ AC_SUBST([GALLIUM_DRIVERS_DIRS])
 AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
 AC_SUBST([MESA_LLVM])
 
+# Check for libdrm
+PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
+                  [have_libdrm=yes], [have_libdrm=no])
+
+if test "x$enable_dri" = xyes; then
+    # DRI must be shared, I think
+    if test "$enable_static" = yes; then
+        AC_MSG_ERROR([Can't use static libraries for DRI drivers])
+    fi
+
+    # not a hard requirement as swrast does not depend on it
+    if test "x$have_libdrm" = xyes; then
+        DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
+    fi
+fi
+
 dnl
 dnl Find out if X is available. The variable have_x is set if libX11 is
 dnl found to mimic AC_PATH_XTRA.
@@ -731,13 +865,9 @@ m4_divert_once([HELP_BEGIN],
 pkg-config utility.])
 
 dnl We need X for xlib and dri, so bomb now if it's not found
-case "$mesa_driver" in
-xlib|dri)
-    if test "$no_x" = yes; then
-        AC_MSG_ERROR([X11 development libraries needed for $mesa_driver driver])
-    fi
-    ;;
-esac
+if test "x$enable_glx" = xyes -a "x$no_x" = xyes; then
+    AC_MSG_ERROR([X11 development libraries needed for GLX])
+fi
 
 dnl XCB - this is only used for GLX right now
 AC_ARG_ENABLE([xcb],
@@ -775,8 +905,9 @@ AC_ARG_ENABLE([driglx-direct],
 dnl
 dnl libGL configuration per driver
 dnl
-case "$mesa_driver" in
-xlib)
+case "x$enable_glx$enable_xlib_glx" in
+xyesyes)
+    # Xlib-based GLX
     if test "$x11_pkgconfig" = yes; then
         PKG_CHECK_MODULES([XLIBGL], [x11 xext])
         GL_PC_REQ_PRIV="x11 xext"
@@ -799,22 +930,16 @@ xlib)
         GL_LIB_DEPS=""
     fi
     ;;
-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])
-    fi
-
+xyesno)
+    # DRI-based GLX
     PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
     GL_PC_REQ_PRIV="glproto >= $GLPROTO_REQUIRED"
-    DRI_PC_REQ_PRIV=""
-
     if test x"$driglx_direct" = xyes; then
-        # Check for libdrm
-        PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
+        if test "x$have_libdrm" != xyes; then
+            AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED])
+        fi
         PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
         GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
-        DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
     fi
 
     # find the DRI deps for libGL
@@ -839,7 +964,11 @@ dri|no) # these checks are still desired when there is no mesa_driver
     else
         # should check these...
         X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
-        GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
+        if test "x$HAVE_XF86VIDMODE" == xyes; then
+           GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
+       else
+           GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXdamage -lXfixes"
+       fi
         GL_PC_LIB_PRIV="$GL_LIB_DEPS"
         GL_PC_CFLAGS="$X11_INCLUDES"
 
@@ -855,16 +984,14 @@ dri|no) # these checks are still desired when there is no mesa_driver
     # need DRM libs, -lpthread, etc.
     GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
     GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
-    GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
-    GLESv1_CM_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
-    GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
-    GLESv2_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
-    ;;
-osmesa)
-    # No libGL for osmesa
-    GL_LIB_DEPS=""
     ;;
 esac
+
+GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
+GLESv1_CM_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
+GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
+GLESv2_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
+
 AC_SUBST([GL_LIB_DEPS])
 AC_SUBST([GL_PC_REQ_PRIV])
 AC_SUBST([GL_PC_LIB_PRIV])
@@ -890,7 +1017,7 @@ AC_ARG_ENABLE([shared-dricore],
         [link DRI modules with shared core DRI routines @<:@default=disabled@:>@])],
     [enable_dricore="$enableval"],
     [enable_dricore=no])
-if test "$mesa_driver" = dri ; then
+if test "x$enable_dri" = xyes ; then
    if test "$enable_dricore" = yes ; then
       if test "$GCC$GXX" != yesyes ; then
         AC_MSG_WARN([Shared dricore requires GCC-compatible rpath handling.  Disabling shared dricore])
@@ -921,11 +1048,19 @@ PKG_CHECK_MODULES([LIBDRM_RADEON],
                  HAVE_LIBDRM_RADEON=no)
 
 dnl
-dnl More X11 setup
+dnl More GLX setup
 dnl
-if test "$mesa_driver" = xlib; then
+case "x$enable_glx$enable_xlib_glx" in
+xyesyes)
     DEFINES="$DEFINES -DUSE_XSHM"
-fi
+    ;;
+xyesno)
+    DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
+    if test "x$driglx_direct" = xyes; then
+        DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
+    fi
+    ;;
+esac
 
 dnl
 dnl TLS detection
@@ -975,7 +1110,10 @@ DRI_DIRS=""
 case "$with_dri_drivers" in
 no) ;;
 yes)
-    DRI_DIRS="yes"
+    # classic DRI drivers require FEATURE_GL to build
+    if test "x$enable_opengl" = xyes; then
+        DRI_DIRS="yes"
+    fi
     ;;
 *)
     # verify the requested driver directories exist
@@ -985,19 +1123,19 @@ yes)
             AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
     done
     DRI_DIRS="$dri_drivers"
+    if test -n "$DRI_DIRS" -a "x$enable_opengl" != xyes; then
+        AC_MSG_ERROR([--with-dri-drivers requires OpenGL])
+    fi
     ;;
 esac
 
 dnl Set DRI_DIRS, DEFINES and LIB_DEPS
-if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
+if test "x$enable_dri" = xyes; then
     # Platform specific settings and drivers to build
     case "$host_os" in
     linux*)
         DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
-        if test "x$driglx_direct" = xyes; then
-            DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
-        fi
-        DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
+        DEFINES="$DEFINES -DHAVE_ALIAS"
 
         case "$host_cpu" in
         x86_64)
@@ -1027,10 +1165,6 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
     freebsd* | dragonfly* | *netbsd*)
         DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
         DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
-        DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
-        if test "x$driglx_direct" = xyes; then
-            DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
-        fi
 
         if test "x$DRI_DIRS" = "xyes"; then
             DRI_DIRS="i810 i915 i965 mach64 mga nouveau r128 r200 r300 r600 \
@@ -1039,21 +1173,13 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
         ;;
     gnu*)
         DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
-        DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
+        DEFINES="$DEFINES -DHAVE_ALIAS"
        ;;
     solaris*)
         DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
-        DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
-        if test "x$driglx_direct" = xyes; then
-            DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
-        fi
         ;;
     cygwin*)
         DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
-        DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
-        if test "x$driglx_direct" = xyes; then
-            DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
-        fi
         if test "x$DRI_DIRS" = "xyes"; then
             DRI_DIRS="swrast"
         fi
@@ -1069,7 +1195,7 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
     DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/  */ /g'`
 
     # Check for expat
-    if test "$mesa_driver" = dri; then
+    if test "x$enable_dri" = xyes; then
         EXPAT_INCLUDES=""
         EXPAT_LIB=-lexpat
         AC_ARG_WITH([expat],
@@ -1085,6 +1211,13 @@ if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
             [AC_MSG_ERROR([Expat required for DRI.])])
     fi
 
+    # libdrm is required for all except swrast
+    if test -n "$DRI_DIRS" -a x"$DRI_DIRS" != xswrast; then
+        if test "x$have_libdrm" != xyes; then
+            AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED])
+        fi
+    fi
+
     # put all the necessary libs together, including possibly libdricore
     DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
 fi
@@ -1119,26 +1252,6 @@ AC_SUBST([RADEON_LDFLAGS])
 dnl
 dnl OSMesa configuration
 dnl
-if test "$mesa_driver" = xlib; then
-    default_gl_osmesa=yes
-else
-    default_gl_osmesa=no
-fi
-AC_ARG_ENABLE([gl-osmesa],
-    [AS_HELP_STRING([--enable-gl-osmesa],
-        [enable OSMesa with libGL @<:@default=enabled for xlib driver@:>@])],
-    [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
-        DRIVER_DIRS="$DRIVER_DIRS osmesa"
-    fi
-fi
 
 dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
 AC_ARG_WITH([osmesa-bits],
@@ -1146,9 +1259,11 @@ AC_ARG_WITH([osmesa-bits],
         [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
     [osmesa_bits="$withval"],
     [osmesa_bits=8])
-if test "$mesa_driver" != osmesa && test "x$osmesa_bits" != x8; then
-    AC_MSG_WARN([Ignoring OSMesa channel bits for non-OSMesa driver])
-    osmesa_bits=8
+if test "x$osmesa_bits" != x8; then
+    if test "x$enable_dri" = xyes -o "x$enable_glx" = xyes; then
+        AC_MSG_WARN([Ignoring OSMesa channel bits because of non-OSMesa driver])
+        osmesa_bits=8
+    fi
 fi
 case "x$osmesa_bits" in
 x8)
@@ -1164,8 +1279,7 @@ x16|x32)
 esac
 AC_SUBST([OSMESA_LIB])
 
-case "$DRIVER_DIRS" in
-*osmesa*)
+if test "x$enable_osmesa" = xyes; then
     # only link libraries with osmesa if shared
     if test "$enable_static" = no; then
         OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
@@ -1174,8 +1288,7 @@ case "$DRIVER_DIRS" in
     fi
     OSMESA_MESA_DEPS=""
     OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
-    ;;
-esac
+fi
 AC_SUBST([OSMESA_LIB_DEPS])
 AC_SUBST([OSMESA_MESA_DEPS])
 AC_SUBST([OSMESA_PC_REQ])
@@ -1184,26 +1297,16 @@ AC_SUBST([OSMESA_PC_LIB_PRIV])
 dnl
 dnl EGL configuration
 dnl
-AC_ARG_ENABLE([egl],
-    [AS_HELP_STRING([--disable-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
+EGL_CLIENT_APIS=""
+
 if test "x$enable_egl" = xyes; then
     SRC_DIRS="$SRC_DIRS egl"
     EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS -lpthread"
     EGL_DRIVERS_DIRS=""
+
     if test "$enable_static" != yes; then
         # build egl_glx when libGL is built
-        if test "$mesa_driver" = xlib -o "$mesa_driver" = dri; then
+        if test "x$enable_glx" = xyes; then
             EGL_DRIVERS_DIRS="glx"
         fi
 
@@ -1212,7 +1315,7 @@ if test "x$enable_egl" = xyes; then
         if test "$have_libudev" = yes; then
             DEFINES="$DEFINES -DHAVE_LIBUDEV"
         fi
-        if test "$mesa_driver" = dri; then
+        if test "x$enable_dri" = xyes; 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])
@@ -1232,6 +1335,142 @@ fi
 AC_SUBST([EGL_LIB_DEPS])
 AC_SUBST([EGL_DRIVERS_DIRS])
 
+dnl
+dnl gbm configuration
+dnl
+if test "x$enable_gbm" = xauto; then
+    case "$with_egl_platforms" in
+        *drm*)
+            enable_gbm=yes ;;
+         *)
+            enable_gbm=no ;;
+    esac
+fi
+if test "x$enable_gbm" = xyes; then
+    SRC_DIRS="$SRC_DIRS gbm"
+    GBM_BACKEND_DIRS=""
+
+    PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
+                      AC_MSG_ERROR([gbm needs udev]))
+    GBM_LIB_DEPS="$DLOPEN_LIBS $LIBUDEV_LIBS"
+
+    if test "x$enable_dri" = xyes; then
+        GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
+        if test "$SHARED_GLAPI" -eq 0; then
+            AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
+        fi
+    fi
+fi
+AC_SUBST([GBM_LIB_DEPS])
+AC_SUBST([GBM_BACKEND_DIRS])
+GBM_PC_REQ_PRIV="libudev"
+GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
+GBM_PC_CFLAGS=
+AC_SUBST([GBM_PC_REQ_PRIV])
+AC_SUBST([GBM_PC_LIB_PRIV])
+AC_SUBST([GBM_PC_CFLAGS])
+
+dnl
+dnl EGL Gallium configuration
+dnl
+if test "x$enable_gallium_egl" = xyes; then
+    if test "x$with_gallium_drivers" = x; then
+        AC_MSG_ERROR([cannot enable egl_gallium without Gallium])
+    fi
+    if test "x$enable_egl" = xno; then
+        AC_MSG_ERROR([cannot enable egl_gallium without EGL])
+    fi
+    if test "x$have_libdrm" != xyes; then
+        AC_MSG_ERROR([egl_gallium requires libdrm >= $LIBDRM_REQUIRED])
+    fi
+
+    GALLIUM_STATE_TRACKERS_DIRS="egl $GALLIUM_STATE_TRACKERS_DIRS"
+    GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-static"
+    HAVE_ST_EGL="yes"
+fi
+
+dnl
+dnl gbm Gallium configuration
+dnl
+if test "x$enable_gallium_gbm" = xauto; then
+    case "$enable_gbm$HAVE_ST_EGL$with_egl_platforms" in
+        yesyes*drm*)
+            enable_gallium_gbm=yes ;;
+         *)
+            enable_gallium_gbm=no ;;
+    esac
+fi
+if test "x$enable_gallium_gbm" = xyes; then
+    if test "x$with_gallium_drivers" = x; then
+        AC_MSG_ERROR([cannot enable gbm_gallium without Gallium])
+    fi
+    if test "x$enable_gbm" = xno; then
+        AC_MSG_ERROR([cannot enable gbm_gallium without gbm])
+    fi
+
+    GALLIUM_STATE_TRACKERS_DIRS="gbm $GALLIUM_STATE_TRACKERS_DIRS"
+    GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS gbm"
+    HAVE_ST_GBM="yes"
+fi
+
+dnl
+dnl X.Org DDX configuration
+dnl
+if test "x$enable_xorg" = xyes; then
+    PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0])
+    PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
+    PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
+    PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
+        HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
+        HAVE_XEXTPROTO_71="no")
+    GALLIUM_STATE_TRACKERS_DIRS="xorg $GALLIUM_STATE_TRACKERS_DIRS"
+    HAVE_ST_XORG=yes
+fi
+
+dnl
+dnl XA configuration
+dnl
+if test "x$enable_xa" = xyes; then
+    GALLIUM_STATE_TRACKERS_DIRS="xa $GALLIUM_STATE_TRACKERS_DIRS"
+    HAVE_ST_XA=yes
+fi
+
+dnl
+dnl OpenVG configuration
+dnl
+VG_LIB_DEPS=""
+
+if test "x$enable_openvg" = xyes; then
+    if test "x$enable_egl" = xno; then
+        AC_MSG_ERROR([cannot enable OpenVG without EGL])
+    fi
+    if test "x$with_gallium_drivers" = x; then
+        AC_MSG_ERROR([cannot enable OpenVG without Gallium])
+    fi
+    if test "x$enable_gallium_egl" = xno; then
+        AC_MSG_ERROR([cannot enable OpenVG without egl_gallium])
+    fi
+
+    EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
+    VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS -lpthread"
+    CORE_DIRS="$CORE_DIRS mapi/vgapi"
+    GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
+    HAVE_ST_VEGA=yes
+fi
+
+dnl
+dnl D3D1X configuration
+dnl
+
+if test "x$enable_d3d1x" = xyes; then
+    if test "x$with_gallium_drivers" = x; then
+        AC_MSG_ERROR([cannot enable D3D1X without Gallium])
+    fi
+
+    GALLIUM_STATE_TRACKERS_DIRS="d3d1x $GALLIUM_STATE_TRACKERS_DIRS"
+    HAVE_ST_D3D1X=yes
+fi
+
 dnl
 dnl GLU configuration
 dnl
@@ -1241,16 +1480,17 @@ AC_ARG_ENABLE([glu],
     [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
+if test "x$enable_glu" = xyes; then
+    if test "x$enable_glx" = xno -a "x$enable_osmesa" = xno; then
+        AC_MSG_NOTICE([Disabling GLU since there is no OpenGL driver])
+        enable_glu=no
+    fi
 fi
 
 if test "x$enable_glu" = xyes; then
     SRC_DIRS="$SRC_DIRS glu"
 
-    case "$mesa_driver" in
-    osmesa)
+    if test "x$enable_glx" = xno; then
         # Link libGLU to libOSMesa instead of libGL
         GLU_LIB_DEPS=""
         GLU_PC_REQ="osmesa"
@@ -1259,8 +1499,7 @@ if test "x$enable_glu" = xyes; then
         else
             GLU_MESA_DEPS=""
         fi
-        ;;
-    *)
+    else
         # If static, empty GLU_LIB_DEPS and add libs for programs to link
         GLU_PC_REQ="gl"
         GLU_PC_LIB_PRIV="-lm"
@@ -1272,8 +1511,7 @@ if test "x$enable_glu" = xyes; then
             GLU_MESA_DEPS=""
             APP_LIB_DEPS="$APP_LIB_DEPS -lstdc++"
         fi
-        ;;
-    esac
+    fi
 fi
 if test "$enable_static" = no; then
     GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
@@ -1295,13 +1533,9 @@ AC_ARG_ENABLE([glw],
     [enable_glw="$enableval"],
     [enable_glw=yes])
 dnl Don't build GLw on osmesa
-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
+if test "x$enable_glw" = xyes -a "x$enable_glx" = xno; then
+    AC_MSG_NOTICE([Disabling GLw since there is no OpenGL driver])
+    enable_glw=no
 fi
 AC_ARG_ENABLE([motif],
     [AS_HELP_STRING([--enable-motif],
@@ -1375,14 +1609,10 @@ 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
+dnl Don't build glut without GLX
+if test "x$enable_glut" = xyes -a "x$enable_glx" = xno; then
+    AC_MSG_NOTICE([Disabling glut since there is no OpenGL driver])
+    enable_glut=no
 fi
 dnl Can't build glut if GLU not available
 if test "x$enable_glu$enable_glut" = xnoyes; then
@@ -1448,17 +1678,11 @@ AC_SUBST([PROGRAM_DIRS])
 dnl
 dnl Gallium configuration
 dnl
-AC_ARG_ENABLE([gallium],
-    [AS_HELP_STRING([--disable-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
+if test "x$with_gallium_drivers" != x; then
     SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
     AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
+else
+    LLVM_CONFIG=no
 fi
 
 AC_SUBST([LLVM_CFLAGS])
@@ -1466,174 +1690,31 @@ AC_SUBST([LLVM_LIBS])
 AC_SUBST([LLVM_LDFLAGS])
 AC_SUBST([LLVM_VERSION])
 
-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=$enable_openvg
-        ;;
-    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.
-        "egl,glx" @<:@default=auto@:>@])],
-    [with_state_trackers="$withval"],
-    [with_state_trackers=yes])
-
-case "$with_state_trackers" in
-no)
-    GALLIUM_STATE_TRACKERS_DIRS=""
-    ;;
-yes)
-    # look at what else is built
-    case "$mesa_driver" in
-    xlib)
-        GALLIUM_STATE_TRACKERS_DIRS=glx
-        ;;
-    dri)
-        GALLIUM_STATE_TRACKERS_DIRS="dri"
-        HAVE_ST_DRI="yes"
-        # 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
-    state_trackers=""
-    _state_trackers=`IFS=', '; echo $with_state_trackers`
-    for tracker in $_state_trackers; do
-        case "$tracker" in
-        dri)
-            if test "x$mesa_driver" != xdri; then
-                AC_MSG_ERROR([cannot build dri state tracker without mesa driver set to dri])
-            fi
-            HAVE_ST_DRI="yes"
-            ;;
-        egl)
-            if test "x$enable_egl" != xyes; then
-                AC_MSG_ERROR([cannot build egl state tracker without EGL library])
-            fi
-            HAVE_ST_EGL="yes"
-            ;;
-        xorg)
-            PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0])
-            PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
-            PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
-            HAVE_ST_XORG="yes"
-            ;;
-        vega)
-            if test "x$enable_openvg" != xyes; then
-                AC_MSG_ERROR([cannot build vega state tracker without --enable-openvg])
-            fi
-            have_st_vega="yes"
-            ;;
-       xa)
-           HAVE_ST_XA="yes"
-           ;;
-        esac
 
-       if test -n "$tracker"; then
-            test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
-                AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
-            if test -n "$state_trackers"; then
-                state_trackers="$state_trackers $tracker"
-            else
-                state_trackers="$tracker"
-            fi
-        fi
-    done
-    GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
-
-    # append --enable-openvg/--enable-gallium-egl to --with-state-trackers
-    if test "x$have_st_vega" != xyes -a "x$enable_openvg" = xyes; then
-        AC_MSG_ERROR([--with-state-trackers specified but vega is missing])
-    fi
-    if test "x$HAVE_ST_EGL" != xyes -a "x$enable_gallium_egl" = xyes; then
-        AC_MSG_ERROR([--with-state-trackers specified but egl is missing])
-    fi
-    ;;
-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_openvg" = xyes; then
-    EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
-    VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS -lpthread"
-fi
 
 AC_SUBST([VG_LIB_DEPS])
 AC_SUBST([EGL_CLIENT_APIS])
 
-if test "x$HAVE_ST_EGL" = xyes; then
-       GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl"
-fi
-
-if test "x$HAVE_ST_XORG" = xyes; then
-    PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
-        HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
-        HAVE_XEXTPROTO_71="no")
-fi
-
 AC_ARG_WITH([egl-platforms],
     [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
         [comma delimited native platforms libEGL supports, e.g.
         "x11,drm" @<:@default=auto@:>@])],
     [with_egl_platforms="$withval"],
     [with_egl_platforms=yes])
-AC_ARG_WITH([egl-displays],
-    [AS_HELP_STRING([--with-egl-displays@<:@=DIRS...@:>@],
-        [DEPRECATED.  Use --with-egl-platforms instead])],
-    [with_egl_platforms="$withval"])
 
 EGL_PLATFORMS=""
 WAYLAND_EGL_LIB_DEPS=""
 
 case "$with_egl_platforms" in
 yes)
-    if test "x$enable_egl" = xyes && test "x$mesa_driver" != xosmesa; then
+    if test "x$enable_egl" = xyes; then
         EGL_PLATFORMS="x11"
-        if test "$mesa_driver" = dri; then
-            EGL_PLATFORMS="$EGL_PLATFORMS drm"
-        fi
     fi
     ;;
 *)
@@ -1654,6 +1735,13 @@ yes)
                WAYLAND_EGL_LIB_DEPS="$WAYLAND_LIBS $LIBDRM_LIBS"
                 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
        fi
+        if test "$plat" = "drm" && test "x$enable_gbm" = "xno"; then
+                AC_MSG_ERROR([EGL platform drm needs gbm])
+        fi
+        case "$plat$have_libudev" in
+                waylandno|drmno)
+                    AC_MSG_ERROR([cannot build $plat platfrom without udev]) ;;
+        esac
     done
     EGL_PLATFORMS="$egl_platforms"
     ;;
@@ -1707,6 +1795,9 @@ AC_ARG_ENABLE([gallium-llvm],
         [build gallium LLVM support @<:@default=enabled on x86/x86_64@:>@])],
     [enable_gallium_llvm="$enableval"],
     [enable_gallium_llvm=auto])
+if test "x$with_gallium_drivers" = x; then
+    enable_gallium_llvm=no
+fi
 if test "x$enable_gallium_llvm" = xauto; then
     case "$host_cpu" in
     i*86|x86_64) enable_gallium_llvm=yes;;
@@ -1735,6 +1826,9 @@ dnl
 gallium_check_st() {
     if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_XORG" = xyes ||
         test "x$HAVE_ST_XA" = xyes; then
+         if test "x$have_libdrm" != xyes; then
+            AC_MSG_ERROR([DRI or Xorg DDX requires libdrm >= $LIBDRM_REQUIRED])
+         fi
          GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
     fi
     if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then
@@ -1756,107 +1850,46 @@ gallium_require_llvm() {
     fi
 }
 
-dnl
-dnl Gallium SVGA configuration
-dnl
-AC_ARG_ENABLE([gallium-svga],
-    [AS_HELP_STRING([--enable-gallium-svga],
-        [build gallium SVGA @<:@default=disabled@:>@])],
-    [enable_gallium_svga="$enableval"],
-    [enable_gallium_svga=auto])
-if test "x$enable_gallium_svga" = xyes; then
-    GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
-    gallium_check_st "svga/drm" "dri-vmwgfx" "xorg-vmwgfx" "xa-vmwgfx"
-elif test "x$enable_gallium_svga" = xauto; then
-    GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
-fi
-
-dnl
-dnl Gallium i915 configuration
-dnl
-AC_ARG_ENABLE([gallium-i915],
-    [AS_HELP_STRING([--enable-gallium-i915],
-        [build gallium i915 @<:@default=disabled@:>@])],
-    [enable_gallium_i915="$enableval"],
-    [enable_gallium_i915=auto])
-if test "x$enable_gallium_i915" = xyes; then
+dnl Gallium drivers
+if test "x$with_gallium_drivers" != x; then
+    # This is for compile-testing
+    GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965 r300 svga"
     GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
-    GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915"
-    gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
-elif test "x$enable_gallium_i915" = xauto; then
-    GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
-    GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915"
-fi
 
-dnl
-dnl Gallium i965 configuration
-dnl
-AC_ARG_ENABLE([gallium-i965],
-    [AS_HELP_STRING([--enable-gallium-i965],
-        [build gallium i965 @<:@default=disabled@:>@])],
-    [enable_gallium_i965="$enableval"],
-    [enable_gallium_i965=auto])
-if test "x$enable_gallium_i965" = xyes; then
-    GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i965"
-    gallium_check_st "i965/drm" "dri-i965" "xorg-i965"
-elif test "x$enable_gallium_i965" = xauto; then
-    GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i965"
-fi
-
-dnl
-dnl Gallium Radeon r300g configuration
-dnl
-AC_ARG_ENABLE([gallium-r300],
-    [AS_HELP_STRING([--disable-gallium-r300],
-        [build R300 driver @<:@default=enabled@:>@])],
-    [enable_gallium_r300="$enableval"],
-    [enable_gallium_r300=yes])
-
-if test "x$enable_gallium_r300" = xyes && test "x$mesa_driver" = xdri; then
-    gallium_require_llvm "Gallium R300"
-
-    GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
-    gallium_check_st "radeon/drm" "dri-r300" "xorg-r300"
-fi
-
-dnl
-dnl Gallium Radeon r600g configuration
-dnl
-AC_ARG_ENABLE([gallium-r600],
-    [AS_HELP_STRING([--enable-gallium-r600],
-        [build gallium r600 @<:@default=disabled@:>@])],
-    [enable_gallium_r600="$enableval"],
-    [enable_gallium_r600=auto])
-if test "x$enable_gallium_r600" = xyes; then
-    GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
-    gallium_check_st "r600/drm" "dri-r600"
-fi
-
-dnl
-dnl Gallium Nouveau configuration
-dnl
-AC_ARG_ENABLE([gallium-nouveau],
-    [AS_HELP_STRING([--enable-gallium-nouveau],
-        [build gallium nouveau @<:@default=disabled@:>@])],
-    [enable_gallium_nouveau="$enableval"],
-    [enable_gallium_nouveau=no])
-if test "x$enable_gallium_nouveau" = xyes; then
-    GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50 nvc0"
-    gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau"
-fi
-
-dnl
-dnl Gallium swrast configuration
-dnl
-AC_ARG_ENABLE([gallium-swrast],
-    [AS_HELP_STRING([--enable-gallium-swrast],
-        [build gallium swrast @<:@default=auto@:>@])],
-    [enable_gallium_swrast="$enableval"],
-    [enable_gallium_swrast=auto])
-if test "x$enable_gallium_swrast" = xyes || test "x$enable_gallium_swrast" = xauto; then
-    if test "x$HAVE_ST_DRI" = xyes; then
-        GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
-    fi
+    gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
+    for driver in $gallium_drivers; do
+        case "x$driver" in
+        xsvga)
+            gallium_check_st "svga/drm" "dri-vmwgfx" "xorg-vmwgfx" "xa-vmwgfx"
+            ;;
+        xi915)
+            gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
+            ;;
+        xi965)
+            gallium_check_st "i965/drm" "dri-i965" "xorg-i965"
+            ;;
+        xr300)
+            gallium_require_llvm "Gallium R300"
+            gallium_check_st "radeon/drm" "dri-r300" "xorg-r300"
+            ;;
+        xr600)
+            GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
+            gallium_check_st "r600/drm" "dri-r600"
+            ;;
+        xnouveau)
+            GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50 nvc0"
+            gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau"
+            ;;
+        xswrast)
+            if test "x$HAVE_ST_DRI" = xyes; then
+                GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
+            fi
+            ;;
+        *)
+            AC_MSG_ERROR([Unknown Gallium driver: $driver])
+            ;;
+        esac
+    done
 fi
 
 dnl prepend CORE_DIRS to SRC_DIRS
@@ -1877,6 +1910,12 @@ fi
 ln -s autoconf configs/current
 ])
 
+dnl Sort the dirs alphabetically
+GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort|tr "\n" " "`
+GALLIUM_WINSYS_DIRS=`echo $GALLIUM_WINSYS_DIRS|tr " " "\n"|sort|tr "\n" " "`
+GALLIUM_DRIVERS_DIRS=`echo $GALLIUM_DRIVERS_DIRS|tr " " "\n"|sort|tr "\n" " "`
+GALLIUM_STATE_TRACKERS_DIRS=`echo $GALLIUM_STATE_TRACKERS_DIRS|tr " " "\n"|sort|tr "\n" " "`
+
 AC_OUTPUT
 
 dnl
@@ -1895,14 +1934,13 @@ echo "        OpenVG:          $enable_openvg"
 
 dnl Driver info
 echo ""
-echo "        Driver:          $mesa_driver"
-if test "$mesa_driver" != no; then
-    if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
+if test "x$enable_osmesa" != xno; then
         echo "        OSMesa:          lib$OSMESA_LIB"
-    else
+else
         echo "        OSMesa:          no"
-    fi
-    if test "$mesa_driver" = dri; then
+fi
+
+if test "x$enable_dri" != xno; then
         # cleanup the drivers var
         dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/  */ /;s/ *$//'`
         if test "x$DRI_DIRS" = x; then
@@ -1911,10 +1949,22 @@ if test "$mesa_driver" != no; then
             echo "        DRI drivers:     $dri_dirs"
         fi
         echo "        DRI driver dir:  $DRI_DRIVER_INSTALL_DIR"
-        echo "        Use XCB:         $enable_xcb"
         echo "        Shared dricore:  $enable_dricore"
-    fi
 fi
+
+case "x$enable_glx$enable_xlib_glx" in
+xyesyes)
+    echo "        GLX:             Xlib-based"
+    ;;
+xyesno)
+    echo "        GLX:             DRI-based"
+    echo "        Use XCB:         $enable_xcb"
+    ;;
+*)
+    echo "        GLX:             $enable_glx"
+    ;;
+esac
+
 echo ""
 echo "        GLU:             $enable_glu"
 echo "        GLw:             $enable_glw (Motif: $enable_motif)"
@@ -1931,7 +1981,7 @@ if test "$enable_egl" = yes; then
         egl_drivers="$egl_drivers builtin:egl_$d"
     done
 
-    if test "$enable_gallium" = yes -a "$HAVE_ST_EGL" = yes; then
+    if test "x$HAVE_ST_EGL" = xyes; then
         echo "        EGL drivers:    ${egl_drivers} egl_gallium"
         echo "        EGL Gallium STs:$EGL_CLIENT_APIS"
     else
index d86c4b0bf600b05c6c5333688bd5f4ffa5190f98..49b48472a4a9b78b7b8364d881cd443d7944c2ae 100644 (file)
@@ -40,7 +40,7 @@ glTexParameterI, glGetTexParameterI commands          DONE
 glVertexAttribI commands                              DONE (but converts int
                                                             values to floats)
 Depth format cube textures                            0% done
-
+GLX_ARB_create_context (GLX 1.4 is required)          not started
 
 
 GL 3.1:
@@ -49,7 +49,7 @@ GLSL 1.40                                             not started
 Instanced drawing (GL_ARB_draw_instanced)             DONE (gallium, swrast)
 Buffer copying (GL_ARB_copy_buffer)                   DONE
 Primitive restart (GL_NV_primitive_restart)           DONE (gallium)
-16 vertex texture image units                         not started
+16 vertex texture image units                         DONE
 Texture buffer objs (GL_ARB_texture_buffer_object)    not started
 Rectangular textures (GL_ARB_texture_rectangle)       DONE
 Uniform buffer objs (GL_ARB_uniform_buffer_object)    not started
@@ -69,6 +69,7 @@ Seamless cubemaps (GL_ARB_seamless_cube_map)          DONE
 Multisample textures (GL_ARB_texture_multisample)     not started
 Frag depth clamp (GL_ARB_depth_clamp)                 DONE
 Fence objects (GL_ARB_sync)                           DONE
+GLX_ARB_create_context_profile                        not started
 
 
 GL 3.3:
index fb15086679f5ba6310d063caa32fbe45e9060a68..5b750070ca1ff4e9503240066546a177c1aabf8b 100644 (file)
@@ -29,12 +29,14 @@ directly dispatched to the drivers.</p>
 the driver for your hardware.  For example</p>
 
 <pre>
-  $ ./configure --enable-gles2 --enable-openvg --enable-gallium-nouveau
+  $ ./configure --enable-gles1 --enable-gles2 \
+                --with-dri-drivers=... \
+                --with-gallium-drivers=...
 </pre>
 
-<p>The main library and OpenGL is enabled by default.  The first option above
-enables <a href="opengles.html">OpenGL ES 2.x</a>.  The second option enables
-<a href="openvg.html">OpenVG</a>.</p>
+<p>The main library and OpenGL is enabled by default.  The first two options
+above enables <a href="opengles.html">OpenGL ES 1.x and 2.x</a>.  The last two
+options enables the listed classic and and Gallium drivers respectively.</p>
 
 </li>
 
@@ -42,8 +44,8 @@ enables <a href="opengles.html">OpenGL ES 2.x</a>.  The second option enables
 </ol>
 
 <p>In the given example, it will build and install <code>libEGL</code>,
-<code>libGL</code>, <code>libGLESv1_CM</code>, <code>libGLESv2</code>,
-<code>libOpenVG</code>, and one or more EGL drivers.</p>
+<code>libGL</code>, <code>libGLESv1_CM</code>, <code>libGLESv2</code>, and one
+or more EGL drivers.</p>
 
 <h3>Configure Options</h3>
 
@@ -65,6 +67,12 @@ drivers will be installed to <code>${libdir}/egl</code>.</p>
 
 </li>
 
+<li><code>--enable-gallium-egl</code>
+
+<p>Enable the optional <code>egl_gallium</code> driver.</p>
+
+</li>
+
 <li><code>--with-egl-platforms</code>
 
 <p>List the platforms (window systems) to support.  Its argument is a comma
@@ -88,15 +96,17 @@ internal library that supports multiple APIs.</p>
 
 </li>
 
-<li><code>--enable-openvg</code>
+<li><code>--enable-shared-glapi</code>
 
-<p>OpenVG must be explicitly enabled by this option.</p>
+<p>By default, <code>libGL</code> has its own copy of <code>libglapi</code>.
+This options makes <code>libGL</code> use the shared <code>libglapi</code>.  This
+is required if applications mix OpenGL and OpenGL ES.</p>
 
 </li>
 
-<li><code>--enable-gallium-egl</code>
+<li><code>--enable-openvg</code>
 
-<p>Explicitly enable or disable <code>egl_gallium</code>.</p>
+<p>OpenVG must be explicitly enabled by this option.</p>
 
 </li>
 
@@ -220,8 +230,7 @@ distribution.</p>
 <p>Generally, <code>egl_dri2</code> is preferred over <code>egl_gallium</code>
 when the system already has DRI drivers.  As <code>egl_gallium</code> is loaded
 before <code>egl_dri2</code> when both are available, <code>egl_gallium</code>
-may either be disabled with <code>--disable-gallium-egl</code> or packaged
-separately.</p>
+is disabled by default.</p>
 
 <h2>Developers</h2>
 
@@ -307,17 +316,5 @@ not be called with the sample display at the same time.  If a driver has access
 to an <code>EGLDisplay</code> without going through the EGL APIs, the driver
 should as well lock the display before using it.
 
-<h3>TODOs</h3>
-
-<ul>
-<li>Pass the conformance tests</li>
-<li>Mixed use of OpenGL, OpenGL ES 1.1, and OpenGL ES 2.0 is supported.  But
-which one of <code>libGL.so</code>, <code>libGLESv1_CM.so</code>, and
-<code>libGLESv2.so</code> should an application link to?  Bad things may happen
-when, say, an application is linked to <code>libGLESv2.so</code> and
-<code>libcairo</code>, which is linked to <code>libGL.so</code> instead.</li>
-
-</ul>
-
 </body>
 </html>
index 742182e76a3ff483e5b760377103f5a547717a6e..0fee488e1a1a10f96c702fb729de8af88ae105ad 100644 (file)
@@ -34,27 +34,10 @@ EGL drivers for your hardware.</p>
 
 <h2>Run the Demos</h2>
 
-<p>There are some demos in <code>progs/egl/</code>.  You can use them to test
-your build.  For example,</p>
-
-<pre>
-  $ cd progs/egl/eglut
-  $ make
-  $ cd ../opengles1
-  $ make
-  $ ./torus_x11
-</pre>
+<p>There are some demos in <code>mesa/demos</code> repository.</p>
 
 <h2>Developers</h2>
 
-<h3>Internal Libraries</h3>
-
-<table border="1" style="text-align: center;">
-       <tr><td>Library Name</td><td>Used By</td><td>Enabled</td><td>OpenGL</td><td>OpenGL ES 1.x</td><td>OpenGL ES 2.x</td></tr>
-       <tr><td><code>libmesa.a</td><td>Classic DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
-       <tr><td><code>libmesagallium.a</td><td>Gallium EGL and DRI drivers</td><td>y</td><td>y</td><td>--enable-gles1</td><td>--enable-gles2</td></tr>
-</table>
-
 <h3>Dispatch Table</h3>
 
 <p>OpenGL ES has an additional indirection when dispatching fucntions</p>
index eff8c5828e2307ba3735a9f457925dfbda9d5117..81e50b65f36093eb80b66880007f33140c97613d 100644 (file)
@@ -11,7 +11,7 @@
 <H1>OpenVG State Tracker</H1>
 
 <p>
-The current version of the OpenVG state tracker implements OpenVG 1.0.
+The current version of the OpenVG state tracker implements OpenVG 1.1.
 </p>
 <p>
 More informations about OpenVG can be found at
@@ -26,9 +26,9 @@ Please refer to <a href="egl.html">Mesa EGL</a> for more information about EGL.
 
 <h2>Building the library</h2>
 <ol>
-<li>Run <code>configure</code> with <code>--enable-openvg</code>.  If you do
-not need OpenGL, you can add <code>--disable-opengl</code> to save the
-compilation time.</li>
+<li>Run <code>configure</code> with <code>--enable-openvg</code> and
+<code>--enable-gallium-egl</code>.  If you do not need OpenGL, you can add
+<code>--disable-opengl</code> to save the compilation time.</li>
 
 <li>Build and install Mesa as usual.</li>
 </ol>
@@ -36,7 +36,7 @@ compilation time.</li>
 <h3>Sample build</h3>
 A sample build looks as follows:
 <pre>
-  $ ./configure --disable-opengl --enable-openvg
+  $ ./configure --disable-opengl --enable-openvg --enable-gallium-egl
   $ make
   $ make install
 </pre>
index aaeabc252884ff8bee2ff4c4b65d8acfe847037f..c81ac9f15c9714ab96ad3ed857bd0d59e1aec3d6 100644 (file)
@@ -45,7 +45,7 @@ tbd
 <li>GL_ARB_robustness (all drivers)
 <li>GL_ARB_sampler_objects (gallium drivers)
 <li>GL_ARB_seamless_cube_map (gallium r600)
-<li>GL_ARB_shader_texture_lod (gallium drivers)
+<li>GL_ARB_shader_texture_lod (gallium drivers, i965)
 <li>GL_ARB_sync (gallium drivers only, intel support was in 7.6)
 <li>GL_ARB_texture_compression_rgtc (gallium drivers, swrast, i965)
 <li>GL_ARB_texture_float (gallium, i965)
index e4aa0994be9e55ea3837d333cc91fe35ef5a5fbd..fbfdce32ef45cb28656afa45e5d5eee0812cc2b8 100644 (file)
@@ -84,6 +84,12 @@ typedef struct wl_display     *EGLNativeDisplayType;
 typedef struct wl_egl_pixmap  *EGLNativePixmapType;
 typedef struct wl_egl_window  *EGLNativeWindowType;
 
+#elif defined(__GBM__)
+
+typedef struct gbm_device  *EGLNativeDisplayType;
+typedef struct gbm_bo      *EGLNativePixmapType;
+typedef void               *EGLNativeWindowType;
+
 #elif defined(__unix__) || defined(__unix)
 
 #ifdef MESA_EGL_NO_X11_HEADERS
index f022b44b26048fc5d86d668c995f524456c376b3..4fe9e943b55888220a1b83391f50813d858764a9 100644 (file)
@@ -849,6 +849,11 @@ struct __DRIimageExtensionRec {
                               void *loaderPrivate);
 
    GLboolean (*queryImage)(__DRIimage *image, int attrib, int *value);
+
+   /**
+    * The new __DRIimage will share the content with the old one, see dup(2).
+    */
+   __DRIimage *(*dupImage)(__DRIimage *image, void *loaderPrivate);
 };
 
 
index a2c690f655efd1de99b7817937491f74d1faed38..df7ac93bb006492e401f8e66332b4a7b462e31c3 100644 (file)
@@ -33,6 +33,8 @@ Custom builders and methods.
 import os
 import os.path
 import re
+import sys
+import subprocess
 
 import SCons.Action
 import SCons.Builder
@@ -154,15 +156,90 @@ def createCodeGenerateMethod(env):
     env.AddMethod(code_generate, 'CodeGenerate')
 
 
+def _pkg_check_modules(env, name, modules):
+    '''Simple wrapper for pkg-config.'''
+
+    env['HAVE_' + name] = False
+
+    # For backwards compatability
+    env[name.lower()] = False
+
+    if env['platform'] == 'windows':
+        return
+
+    if not env.Detect('pkg-config'):
+        return
+
+    if subprocess.call(["pkg-config", "--exists", ' '.join(modules)]) != 0:
+        return
+
+    # Other flags may affect the compilation of unrelated targets, so store
+    # them with a prefix, (e.g., XXX_CFLAGS, XXX_LIBS, etc)
+    try:
+        flags = env.ParseFlags('!pkg-config --cflags --libs ' + ' '.join(modules))
+    except OSError:
+        return
+    prefix = name + '_'
+    for flag_name, flag_value in flags.iteritems():
+        assert '_' not in flag_name
+        env[prefix + flag_name] = flag_value
+
+    env['HAVE_' + name] = True
+
+def pkg_check_modules(env, name, modules):
+
+    sys.stdout.write('Checking for %s...' % name)
+    _pkg_check_modules(env, name, modules)
+    result = env['HAVE_' + name]
+    sys.stdout.write(' %s\n' % ['no', 'yes'][int(bool(result))])
+
+    # XXX: For backwards compatability
+    env[name.lower()] = result
+
+
+def pkg_use_modules(env, names):
+    '''Search for all environment flags that match NAME_FOO and append them to
+    the FOO environment variable.'''
+
+    names = env.Flatten(names)
+
+    for name in names:
+        prefix = name + '_'
+
+        if not 'HAVE_' + name in env:
+            print 'Attempt to use unknown module %s' % name
+            env.Exit(1)
+
+        if not env['HAVE_' + name]:
+            print 'Attempt to use unavailable module %s' % name
+            env.Exit(1)
+
+        flags = {}
+        for flag_name, flag_value in env.Dictionary().iteritems():
+            if flag_name.startswith(prefix):
+                flag_name = flag_name[len(prefix):]
+                if '_' not in flag_name:
+                    flags[flag_name] = flag_value
+        if flags:
+            env.MergeFlags(flags)
+
+
+def createPkgConfigMethods(env):
+    env.AddMethod(pkg_check_modules, 'PkgCheckModules')
+    env.AddMethod(pkg_use_modules, 'PkgUseModules')
+
+
 def generate(env):
     """Common environment generation code"""
 
-    if env.get('quiet', True):
+    verbose = env.get('verbose', False) or not env.get('quiet', True)
+    if not verbose:
         quietCommandLines(env)
 
     # Custom builders and methods
     createConvenienceLibBuilder(env)
     createCodeGenerateMethod(env)
+    createPkgConfigMethods(env)
 
     # for debugging
     #print env.Dump()
index a94bf7364808a492b24e773b7b94eb57dac7d33b..8cd3bc7f6e0dd3385c82f5589fefb9b9b89b6f8b 100755 (executable)
@@ -104,41 +104,6 @@ def num_jobs():
     return 1
 
 
-def pkg_config_modules(env, name, modules):
-    '''Simple wrapper for pkg-config.'''
-
-    env[name] = False
-
-    if env['platform'] == 'windows':
-        return
-
-    if not env.Detect('pkg-config'):
-        return
-
-    if subprocess.call(["pkg-config", "--exists", ' '.join(modules)]) != 0:
-        return
-
-    # Put -I and -L flags directly into the environment, as these don't affect
-    # the compilation of targets that do not use them
-    try:
-        env.ParseConfig('pkg-config --cflags-only-I --libs-only-L ' + ' '.join(modules))
-    except OSError:
-        return
-
-    # Other flags may affect the compilation of unrelated targets, so store
-    # them with a prefix, (e.g., XXX_CFLAGS, XXX_LIBS, etc)
-    try:
-        flags = env.ParseFlags('!pkg-config --cflags-only-other --libs-only-l --libs-only-other ' + ' '.join(modules))
-    except OSError:
-        return
-    prefix = name.upper() + '_'
-    for flag_name, flag_value in flags.iteritems():
-        env[prefix + flag_name] = flag_value
-
-    env[name] = True
-
-
-
 def generate(env):
     """Common environment generation code"""
 
@@ -247,6 +212,8 @@ def generate(env):
     # configuration. See also http://www.scons.org/wiki/AdvancedBuildExample
     build_topdir = 'build'
     build_subdir = env['platform']
+    if env['embedded']:
+        build_subdir =  'embedded-' + build_subdir
     if env['machine'] != 'generic':
         build_subdir += '-' + env['machine']
     if env['build'] != 'release':
@@ -277,6 +244,31 @@ def generate(env):
         cppdefines += ['NDEBUG']
     if env['build'] == 'profile':
         cppdefines += ['PROFILE']
+    if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
+        cppdefines += [
+            '_POSIX_SOURCE',
+            ('_POSIX_C_SOURCE', '199309L'),
+            '_SVID_SOURCE',
+            '_BSD_SOURCE',
+            '_GNU_SOURCE',
+            'PTHREADS',
+            'HAVE_POSIX_MEMALIGN',
+        ]
+        if env['platform'] == 'darwin':
+            cppdefines += [
+                '_DARWIN_C_SOURCE',
+                'GLX_USE_APPLEGL',
+                'GLX_DIRECT_RENDERING',
+            ]
+        else:
+            cppdefines += [
+                'GLX_DIRECT_RENDERING',
+                'GLX_INDIRECT_RENDERING',
+            ]
+        if env['platform'] in ('linux', 'freebsd'):
+            cppdefines += ['HAVE_ALIAS']
+        else:
+            cppdefines += ['GLX_ALIAS_UNSUPPORTED']
     if platform == 'windows':
         cppdefines += [
             'WIN32',
@@ -349,8 +341,8 @@ def generate(env):
     if platform == 'wince':
         cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE']
         cppdefines += ['PIPE_SUBSYSTEM_WINDOWS_CE_OGL']
-    if platform == 'embedded':
-        cppdefines += ['PIPE_OS_EMBEDDED']
+    if env['embedded']:
+        cppdefines += ['PIPE_SUBSYSTEM_EMBEDDED']
     env.Append(CPPDEFINES = cppdefines)
 
     # C compiler options
@@ -367,6 +359,8 @@ def generate(env):
             ccflags += ['-O0']
         else:
             ccflags += ['-O3']
+        # Work around aliasing bugs - developers should comment this out
+        ccflags += ['-fno-strict-aliasing']
         ccflags += ['-g3']
         if env['build'] in ('checked', 'profile'):
             # See http://code.google.com/p/jrfonseca/wiki/Gprof2Dot#Which_options_should_I_pass_to_gcc_when_compiling_for_profiling?
@@ -403,6 +397,8 @@ def generate(env):
             ccflags += ['-m64']
             if platform == 'darwin':
                 ccflags += ['-fno-common']
+        if env['platform'] != 'windows':
+            ccflags += ['-fvisibility=hidden']
         # See also:
         # - http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
         ccflags += [
@@ -421,10 +417,10 @@ def generate(env):
             ]
         if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2'):
             ccflags += [
-                '-Werror=pointer-arith',
+                '-Wpointer-arith',
             ]
             cflags += [
-                '-Werror=declaration-after-statement',
+                '-Wdeclaration-after-statement',
             ]
     if msvc:
         # See also:
@@ -595,7 +591,10 @@ def generate(env):
         env['LINK'] = env['CXX']
 
     # Default libs
-    env.Append(LIBS = [])
+    libs = []
+    if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
+        libs += ['m', 'pthread', 'dl']
+    env.Append(LIBS = libs)
 
     # Load tools
     env.Tool('lex')
@@ -603,19 +602,21 @@ def generate(env):
     if env['llvm']:
         env.Tool('llvm')
     
-    pkg_config_modules(env, 'x11', ['x11', 'xext'])
-    pkg_config_modules(env, 'drm', ['libdrm'])
-    pkg_config_modules(env, 'drm_intel', ['libdrm_intel'])
-    pkg_config_modules(env, 'drm_radeon', ['libdrm_radeon'])
-    pkg_config_modules(env, 'xorg', ['xorg-server'])
-    pkg_config_modules(env, 'kms', ['libkms'])
-
-    env['dri'] = env['x11'] and env['drm']
-
     # Custom builders and methods
     env.Tool('custom')
     createInstallMethods(env)
 
+    env.PkgCheckModules('X11', ['x11', 'xext', 'xdamage', 'xfixes'])
+    env.PkgCheckModules('XF86VIDMODE', ['xxf86vm'])
+    env.PkgCheckModules('DRM', ['libdrm'])
+    env.PkgCheckModules('DRM_INTEL', ['libdrm_intel'])
+    env.PkgCheckModules('DRM_RADEON', ['libdrm_radeon'])
+    env.PkgCheckModules('XORG', ['xorg-server'])
+    env.PkgCheckModules('KMS', ['libkms'])
+    env.PkgCheckModules('UDEV', ['libudev'])
+
+    env['dri'] = env['x11'] and env['drm']
+
     # for debugging
     #print env.Dump()
 
index 7b614daeea1cf18f0b28e43628d901fb8893108a..6d7bd6cd6ece9be89fc48983fc4a66223bb22f65 100644 (file)
@@ -22,6 +22,7 @@ SConscript('mesa/SConscript')
 SConscript('mapi/vgapi/SConscript')
 
 if env['platform'] != 'embedded':
+    SConscript('glx/SConscript')
     SConscript('egl/main/SConscript')
     SConscript('glu/sgi/SConscript')
     SConscript('glut/glx/SConscript')
diff --git a/src/driclient/include/driclient.h b/src/driclient/include/driclient.h
deleted file mode 100644 (file)
index d391525..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#ifndef driclient_h
-#define driclient_h
-
-#include <stdint.h>
-#include <X11/Xlib.h>
-#include <drm_sarea.h>
-#include "xf86dri.h"
-
-/* TODO: Bring in DRI XML options */
-
-typedef struct dri_version
-{
-       int major;
-       int minor;
-       int patch;
-} dri_version_t;
-
-typedef struct dri_screen
-{
-       Display                 *display;
-       unsigned int            num;
-       dri_version_t           ddx, dri, drm;
-       int                     draw_lock_id;
-       int                     fd;
-       drm_sarea_t             *sarea;
-       void                    *drawable_hash;
-       void                    *private;
-} dri_screen_t;
-
-struct dri_context;
-
-typedef struct dri_drawable
-{
-       drm_drawable_t          drm_drawable;
-       Drawable                x_drawable;
-       unsigned int            sarea_index;
-       unsigned int            *sarea_stamp;
-       unsigned int            last_sarea_stamp;
-       int                     x, y, w, h;
-       int                     back_x, back_y;
-       int                     num_cliprects, num_back_cliprects;
-       drm_clip_rect_t         *cliprects, *back_cliprects;
-       dri_screen_t            *dri_screen;
-       unsigned int            refcount;
-       void                    *private;
-} dri_drawable_t;
-
-typedef struct dri_context
-{
-       XID                     id;
-       drm_context_t           drm_context;
-       dri_screen_t            *dri_screen;
-       void                    *private;
-} dri_context_t;
-
-typedef struct dri_framebuffer
-{
-       drm_handle_t            drm_handle;
-       int                     base, size, stride;
-       int                     private_size;
-       void                    *private;
-} dri_framebuffer_t;
-
-int driCreateScreen(Display *display, int screen, dri_screen_t **dri_screen, dri_framebuffer_t *dri_framebuf);
-int driDestroyScreen(dri_screen_t *dri_screen);
-int driCreateDrawable(dri_screen_t *dri_screen, Drawable drawable, dri_drawable_t **dri_drawable);
-int driUpdateDrawableInfo(dri_drawable_t *dri_drawable);
-int driDestroyDrawable(dri_drawable_t *dri_drawable);
-int driCreateContext(dri_screen_t *dri_screen, Visual *visual, dri_context_t **dri_context);
-int driDestroyContext(dri_context_t *dri_context);
-
-#define DRI_VALIDATE_DRAWABLE_INFO_ONCE(dri_drawable)                                  \
-do                                                                                     \
-{                                                                                      \
-       if (*(dri_drawable->sarea_stamp) != dri_drawable->last_sarea_stamp)             \
-               driUpdateDrawableInfo(dri_drawable);                                    \
-} while (0)
-
-#define DRI_VALIDATE_DRAWABLE_INFO(dri_screen, dri_drawable)                                   \
-do                                                                                             \
-{                                                                                              \
-       while (*(dri_drawable->sarea_stamp) != dri_drawable->last_sarea_stamp)                  \
-       {                                                                                       \
-               register unsigned int hwContext = dri_screen->sarea->lock.lock &                \
-               ~(DRM_LOCK_HELD | DRM_LOCK_CONT);                                               \
-               DRM_UNLOCK(dri_screen->fd, &dri_screen->sarea->lock, hwContext);                \
-                                                                                               \
-               DRM_SPINLOCK(&dri_screen->sarea->drawable_lock, dri_screen->draw_lock_id);      \
-               DRI_VALIDATE_DRAWABLE_INFO_ONCE(dri_drawable);                                  \
-               DRM_SPINUNLOCK(&dri_screen->sarea->drawable_lock, dri_screen->draw_lock_id);    \
-                                                                                               \
-               DRM_LIGHT_LOCK(dri_screen->fd, &dri_screen->sarea->lock, hwContext);            \
-       }                                                                                       \
-} while (0)
-
-#endif
-
diff --git a/src/driclient/include/xf86dri.h b/src/driclient/include/xf86dri.h
deleted file mode 100644 (file)
index baf80a7..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-Copyright 2000 VA Linux Systems, Inc.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/**
- * \file xf86dri.h
- * Protocol numbers and function prototypes for DRI X protocol.
- *
- * \author Kevin E. Martin <martin@valinux.com>
- * \author Jens Owen <jens@tungstengraphics.com>
- * \author Rickard E. (Rik) Faith <faith@valinux.com>
- */
-
-#ifndef _XF86DRI_H_
-#define _XF86DRI_H_
-
-#include <X11/Xfuncproto.h>
-#include <xf86drm.h>
-
-#define X_XF86DRIQueryVersion                  0
-#define X_XF86DRIQueryDirectRenderingCapable   1
-#define X_XF86DRIOpenConnection                        2
-#define X_XF86DRICloseConnection               3
-#define X_XF86DRIGetClientDriverName           4
-#define X_XF86DRICreateContext                 5
-#define X_XF86DRIDestroyContext                        6
-#define X_XF86DRICreateDrawable                        7
-#define X_XF86DRIDestroyDrawable               8
-#define X_XF86DRIGetDrawableInfo               9
-#define X_XF86DRIGetDeviceInfo                 10
-#define X_XF86DRIAuthConnection                 11
-#define X_XF86DRIOpenFullScreen                 12   /* Deprecated */
-#define X_XF86DRICloseFullScreen                13   /* Deprecated */
-
-#define XF86DRINumberEvents            0
-
-#define XF86DRIClientNotLocal          0
-#define XF86DRIOperationNotSupported   1
-#define XF86DRINumberErrors            (XF86DRIOperationNotSupported + 1)
-
-#ifndef _XF86DRI_SERVER_
-
-_XFUNCPROTOBEGIN
-
-Bool XF86DRIQueryExtension( Display *dpy, int *event_base, int *error_base );
-
-Bool XF86DRIQueryVersion( Display *dpy, int *majorVersion, int *minorVersion,
-    int *patchVersion );
-
-Bool XF86DRIQueryDirectRenderingCapable( Display *dpy, int screen,
-    Bool *isCapable );
-
-Bool XF86DRIOpenConnection( Display *dpy, int screen, drm_handle_t *hSAREA,
-    char **busIDString );
-
-Bool XF86DRIAuthConnection( Display *dpy, int screen, drm_magic_t magic );
-
-Bool XF86DRICloseConnection( Display *dpy, int screen );
-
-Bool XF86DRIGetClientDriverName( Display *dpy, int screen,
-    int *ddxDriverMajorVersion, int *ddxDriverMinorVersion,
-    int *ddxDriverPatchVersion, char **clientDriverName );
-
-Bool XF86DRICreateContext( Display *dpy, int screen, Visual *visual,
-    XID *ptr_to_returned_context_id, drm_context_t *hHWContext );
-
-Bool XF86DRICreateContextWithConfig( Display *dpy, int screen, int configID,
-    XID *ptr_to_returned_context_id, drm_context_t *hHWContext );
-
-Bool XF86DRIDestroyContext( Display *dpy, int screen,
-    XID context_id );
-
-Bool XF86DRICreateDrawable( Display *dpy, int screen,
-    Drawable drawable, drm_drawable_t *hHWDrawable );
-
-Bool XF86DRIDestroyDrawable( Display *dpy, int screen, 
-    Drawable drawable);
-
-Bool XF86DRIGetDrawableInfo( Display *dpy, int screen, Drawable drawable,
-    unsigned int *index, unsigned int *stamp, 
-    int *X, int *Y, int *W, int *H,
-    int *numClipRects, drm_clip_rect_t ** pClipRects,
-    int *backX, int *backY,
-    int *numBackClipRects, drm_clip_rect_t **pBackClipRects );
-
-Bool XF86DRIGetDeviceInfo( Display *dpy, int screen,
-    drm_handle_t *hFrameBuffer, int *fbOrigin, int *fbSize,
-    int *fbStride, int *devPrivateSize, void **pDevPrivate );
-
-_XFUNCPROTOEND
-
-#endif /* _XF86DRI_SERVER_ */
-
-#endif /* _XF86DRI_H_ */
-
diff --git a/src/driclient/src/Makefile b/src/driclient/src/Makefile
deleted file mode 100644 (file)
index 34435a2..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-TARGET         = libdriclient.a
-OBJECTS                = driclient.o XF86dri.o
-DRMDIR         ?= /usr
-
-CFLAGS         += -g -Wall -fPIC -I../include -I${DRMDIR}/include -I${DRMDIR}/include/drm
-
-#############################################
-
-.PHONY = all clean
-
-all: ${TARGET}
-
-${TARGET}: ${OBJECTS}
-       ar rcs $@ $^
-       if ! test -d ../lib; then mkdir ../lib; fi
-       cp ${TARGET} ../lib
-
-clean:
-       rm -rf ${OBJECTS} ${TARGET} ../lib/${TARGET}
diff --git a/src/driclient/src/XF86dri.c b/src/driclient/src/XF86dri.c
deleted file mode 100644 (file)
index 831a760..0000000
+++ /dev/null
@@ -1,618 +0,0 @@
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-Copyright 2000 VA Linux Systems, Inc.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- *   Kevin E. Martin <martin@valinux.com>
- *   Jens Owen <jens@tungstengraphics.com>
- *   Rickard E. (Rik) Faith <faith@valinux.com>
- *
- */
-
-/* THIS IS NOT AN X CONSORTIUM STANDARD */
-
-#include <X11/Xlibint.h>
-#include <X11/extensions/Xext.h>
-#include <X11/extensions/extutil.h>
-#include "xf86dristr.h"
-
-static XExtensionInfo _xf86dri_info_data;
-static XExtensionInfo *xf86dri_info = &_xf86dri_info_data;
-static char xf86dri_extension_name[] = XF86DRINAME;
-
-#define XF86DRICheckExtension(dpy,i,val) \
-  XextCheckExtension (dpy, i, xf86dri_extension_name, val)
-
-/*****************************************************************************
- *                                                                           *
- *                        private utility routines                          *
- *                                                                           *
- *****************************************************************************/
-
-static int close_display(Display *dpy, XExtCodes *extCodes);
-static /* const */ XExtensionHooks xf86dri_extension_hooks = {
-    NULL,                              /* create_gc */
-    NULL,                              /* copy_gc */
-    NULL,                              /* flush_gc */
-    NULL,                              /* free_gc */
-    NULL,                              /* create_font */
-    NULL,                              /* free_font */
-    close_display,                     /* close_display */
-    NULL,                              /* wire_to_event */
-    NULL,                              /* event_to_wire */
-    NULL,                              /* error */
-    NULL,                              /* error_string */
-};
-
-static XEXT_GENERATE_FIND_DISPLAY (find_display, xf86dri_info, 
-                                  xf86dri_extension_name, 
-                                  &xf86dri_extension_hooks, 
-                                  0, NULL)
-
-static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xf86dri_info)
-
-
-/*****************************************************************************
- *                                                                           *
- *                 public XFree86-DRI Extension routines                    *
- *                                                                           *
- *****************************************************************************/
-
-#if 0
-#include <stdio.h>
-#define TRACE(msg)  fprintf(stderr,"XF86DRI%s\n", msg);
-#else
-#define TRACE(msg)
-#endif
-
-#define PUBLIC
-
-PUBLIC Bool XF86DRIQueryExtension (dpy, event_basep, error_basep)
-    Display *dpy;
-    int *event_basep, *error_basep;
-{
-    XExtDisplayInfo *info = find_display (dpy);
-
-    TRACE("QueryExtension...");
-    if (XextHasExtension(info)) {
-       *event_basep = info->codes->first_event;
-       *error_basep = info->codes->first_error;
-        TRACE("QueryExtension... return True");
-       return True;
-    } else {
-        TRACE("QueryExtension... return False");
-       return False;
-    }
-}
-
-PUBLIC Bool XF86DRIQueryVersion(dpy, majorVersion, minorVersion, patchVersion)
-    Display* dpy;
-    int* majorVersion; 
-    int* minorVersion;
-    int* patchVersion;
-{
-    XExtDisplayInfo *info = find_display (dpy);
-    xXF86DRIQueryVersionReply rep;
-    xXF86DRIQueryVersionReq *req;
-
-    TRACE("QueryVersion...");
-    XF86DRICheckExtension (dpy, info, False);
-
-    LockDisplay(dpy);
-    GetReq(XF86DRIQueryVersion, req);
-    req->reqType = info->codes->major_opcode;
-    req->driReqType = X_XF86DRIQueryVersion;
-    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
-       UnlockDisplay(dpy);
-       SyncHandle();
-        TRACE("QueryVersion... return False");
-       return False;
-    }
-    *majorVersion = rep.majorVersion;
-    *minorVersion = rep.minorVersion;
-    *patchVersion = rep.patchVersion;
-    UnlockDisplay(dpy);
-    SyncHandle();
-    TRACE("QueryVersion... return True");
-    return True;
-}
-
-PUBLIC Bool XF86DRIQueryDirectRenderingCapable(dpy, screen, isCapable)
-    Display* dpy;
-    int screen;
-    Bool* isCapable;
-{
-    XExtDisplayInfo *info = find_display (dpy);
-    xXF86DRIQueryDirectRenderingCapableReply rep;
-    xXF86DRIQueryDirectRenderingCapableReq *req;
-
-    TRACE("QueryDirectRenderingCapable...");
-    XF86DRICheckExtension (dpy, info, False);
-
-    LockDisplay(dpy);
-    GetReq(XF86DRIQueryDirectRenderingCapable, req);
-    req->reqType = info->codes->major_opcode;
-    req->driReqType = X_XF86DRIQueryDirectRenderingCapable;
-    req->screen = screen;
-    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
-       UnlockDisplay(dpy);
-       SyncHandle();
-        TRACE("QueryDirectRenderingCapable... return False");
-       return False;
-    }
-    *isCapable = rep.isCapable;
-    UnlockDisplay(dpy);
-    SyncHandle();
-    TRACE("QueryDirectRenderingCapable... return True");
-    return True;
-}
-
-PUBLIC Bool XF86DRIOpenConnection(dpy, screen, hSAREA, busIdString)
-    Display* dpy;
-    int screen;
-    drm_handle_t * hSAREA;
-    char **busIdString;
-{
-    XExtDisplayInfo *info = find_display (dpy);
-    xXF86DRIOpenConnectionReply rep;
-    xXF86DRIOpenConnectionReq *req;
-
-    TRACE("OpenConnection...");
-    XF86DRICheckExtension (dpy, info, False);
-
-    LockDisplay(dpy);
-    GetReq(XF86DRIOpenConnection, req);
-    req->reqType = info->codes->major_opcode;
-    req->driReqType = X_XF86DRIOpenConnection;
-    req->screen = screen;
-    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
-       UnlockDisplay(dpy);
-       SyncHandle();
-        TRACE("OpenConnection... return False");
-       return False;
-    }
-
-    *hSAREA = rep.hSAREALow;
-    if (sizeof(drm_handle_t) == 8) {
-       int shift = 32; /* var to prevent warning on next line */
-       *hSAREA |= ((drm_handle_t) rep.hSAREAHigh) << shift;
-    }
-
-    if (rep.length) {
-        if (!(*busIdString = (char *)Xcalloc(rep.busIdStringLength + 1, 1))) {
-            _XEatData(dpy, ((rep.busIdStringLength+3) & ~3));
-            UnlockDisplay(dpy);
-            SyncHandle();
-            TRACE("OpenConnection... return False");
-            return False;
-        }
-       _XReadPad(dpy, *busIdString, rep.busIdStringLength);
-    } else {
-        *busIdString = NULL;
-    }
-    UnlockDisplay(dpy);
-    SyncHandle();
-    TRACE("OpenConnection... return True");
-    return True;
-}
-
-PUBLIC Bool XF86DRIAuthConnection(dpy, screen, magic)
-    Display* dpy;
-    int screen;
-    drm_magic_t magic;
-{
-    XExtDisplayInfo *info = find_display (dpy);
-    xXF86DRIAuthConnectionReq *req;
-    xXF86DRIAuthConnectionReply rep;
-
-    TRACE("AuthConnection...");
-    XF86DRICheckExtension (dpy, info, False);
-
-    LockDisplay(dpy);
-    GetReq(XF86DRIAuthConnection, req);
-    req->reqType = info->codes->major_opcode;
-    req->driReqType = X_XF86DRIAuthConnection;
-    req->screen = screen;
-    req->magic = magic;
-    rep.authenticated = 0;
-    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse) || !rep.authenticated) {
-       UnlockDisplay(dpy);
-       SyncHandle();
-        TRACE("AuthConnection... return False");
-       return False;
-    }
-    UnlockDisplay(dpy);
-    SyncHandle();
-    TRACE("AuthConnection... return True");
-    return True;
-}
-
-PUBLIC Bool XF86DRICloseConnection(dpy, screen)
-    Display* dpy;
-    int screen;
-{
-    XExtDisplayInfo *info = find_display (dpy);
-    xXF86DRICloseConnectionReq *req;
-
-    TRACE("CloseConnection...");
-
-    XF86DRICheckExtension (dpy, info, False);
-
-    LockDisplay(dpy);
-    GetReq(XF86DRICloseConnection, req);
-    req->reqType = info->codes->major_opcode;
-    req->driReqType = X_XF86DRICloseConnection;
-    req->screen = screen;
-    UnlockDisplay(dpy);
-    SyncHandle();
-    TRACE("CloseConnection... return True");
-    return True;
-}
-
-PUBLIC Bool XF86DRIGetClientDriverName(dpy, screen, ddxDriverMajorVersion, 
-       ddxDriverMinorVersion, ddxDriverPatchVersion, clientDriverName)
-    Display* dpy;
-    int screen;
-    int* ddxDriverMajorVersion;
-    int* ddxDriverMinorVersion;
-    int* ddxDriverPatchVersion;
-    char** clientDriverName;
-{
-    XExtDisplayInfo *info = find_display (dpy);
-    xXF86DRIGetClientDriverNameReply rep;
-    xXF86DRIGetClientDriverNameReq *req;
-
-    TRACE("GetClientDriverName...");
-    XF86DRICheckExtension (dpy, info, False);
-
-    LockDisplay(dpy);
-    GetReq(XF86DRIGetClientDriverName, req);
-    req->reqType = info->codes->major_opcode;
-    req->driReqType = X_XF86DRIGetClientDriverName;
-    req->screen = screen;
-    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
-       UnlockDisplay(dpy);
-       SyncHandle();
-        TRACE("GetClientDriverName... return False");
-       return False;
-    }
-
-    *ddxDriverMajorVersion = rep.ddxDriverMajorVersion;
-    *ddxDriverMinorVersion = rep.ddxDriverMinorVersion;
-    *ddxDriverPatchVersion = rep.ddxDriverPatchVersion;
-
-    if (rep.length) {
-        if (!(*clientDriverName = (char *)Xcalloc(rep.clientDriverNameLength + 1, 1))) {
-            _XEatData(dpy, ((rep.clientDriverNameLength+3) & ~3));
-            UnlockDisplay(dpy);
-            SyncHandle();
-            TRACE("GetClientDriverName... return False");
-            return False;
-        }
-       _XReadPad(dpy, *clientDriverName, rep.clientDriverNameLength);
-    } else {
-        *clientDriverName = NULL;
-    }
-    UnlockDisplay(dpy);
-    SyncHandle();
-    TRACE("GetClientDriverName... return True");
-    return True;
-}
-
-PUBLIC Bool XF86DRICreateContextWithConfig(dpy, screen, configID, context,
-       hHWContext)
-    Display* dpy;
-    int screen;
-    int configID;
-    XID* context;
-    drm_context_t * hHWContext;
-{
-    XExtDisplayInfo *info = find_display (dpy);
-    xXF86DRICreateContextReply rep;
-    xXF86DRICreateContextReq *req;
-
-    TRACE("CreateContext...");
-    XF86DRICheckExtension (dpy, info, False);
-
-    LockDisplay(dpy);
-    GetReq(XF86DRICreateContext, req);
-    req->reqType = info->codes->major_opcode;
-    req->driReqType = X_XF86DRICreateContext;
-    req->visual = configID;
-    req->screen = screen;
-    *context = XAllocID(dpy);
-    req->context = *context;
-    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
-       UnlockDisplay(dpy);
-       SyncHandle();
-        TRACE("CreateContext... return False");
-       return False;
-    }
-    *hHWContext = rep.hHWContext;
-    UnlockDisplay(dpy);
-    SyncHandle();
-    TRACE("CreateContext... return True");
-    return True;
-}
-
-PUBLIC Bool XF86DRICreateContext(dpy, screen, visual, context, hHWContext)
-    Display* dpy;
-    int screen;
-    Visual* visual;
-    XID* context;
-    drm_context_t * hHWContext;
-{
-    return XF86DRICreateContextWithConfig( dpy, screen, visual->visualid,
-                                          context, hHWContext );
-}
-
-PUBLIC Bool XF86DRIDestroyContext( Display * ndpy, int screen, 
-    XID context )
-{
-    Display * const dpy = (Display *) ndpy;
-    XExtDisplayInfo *info = find_display (dpy);
-    xXF86DRIDestroyContextReq *req;
-
-    TRACE("DestroyContext...");
-    XF86DRICheckExtension (dpy, info, False);
-
-    LockDisplay(dpy);
-    GetReq(XF86DRIDestroyContext, req);
-    req->reqType = info->codes->major_opcode;
-    req->driReqType = X_XF86DRIDestroyContext;
-    req->screen = screen;
-    req->context = context;
-    UnlockDisplay(dpy);
-    SyncHandle();
-    TRACE("DestroyContext... return True");
-    return True;
-}
-
-PUBLIC Bool XF86DRICreateDrawable( Display * ndpy, int screen, 
-    Drawable drawable, drm_drawable_t * hHWDrawable )
-{
-    Display * const dpy = (Display *) ndpy;
-    XExtDisplayInfo *info = find_display (dpy);
-    xXF86DRICreateDrawableReply rep;
-    xXF86DRICreateDrawableReq *req;
-
-    TRACE("CreateDrawable...");
-    XF86DRICheckExtension (dpy, info, False);
-
-    LockDisplay(dpy);
-    GetReq(XF86DRICreateDrawable, req);
-    req->reqType = info->codes->major_opcode;
-    req->driReqType = X_XF86DRICreateDrawable;
-    req->screen = screen;
-    req->drawable = drawable;
-    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
-       UnlockDisplay(dpy);
-       SyncHandle();
-        TRACE("CreateDrawable... return False");
-       return False;
-    }
-    *hHWDrawable = rep.hHWDrawable;
-    UnlockDisplay(dpy);
-    SyncHandle();
-    TRACE("CreateDrawable... return True");
-    return True;
-}
-
-PUBLIC Bool XF86DRIDestroyDrawable( Display * ndpy, int screen,
-    Drawable drawable )
-{
-    Display * const dpy = (Display *) ndpy;
-    XExtDisplayInfo *info = find_display (dpy);
-    xXF86DRIDestroyDrawableReq *req;
-
-    TRACE("DestroyDrawable...");
-    XF86DRICheckExtension (dpy, info, False);
-
-    LockDisplay(dpy);
-    GetReq(XF86DRIDestroyDrawable, req);
-    req->reqType = info->codes->major_opcode;
-    req->driReqType = X_XF86DRIDestroyDrawable;
-    req->screen = screen;
-    req->drawable = drawable;
-    UnlockDisplay(dpy);
-    SyncHandle();
-    TRACE("DestroyDrawable... return True");
-    return True;
-}
-
-PUBLIC Bool XF86DRIGetDrawableInfo(Display* dpy, int screen, Drawable drawable,
-    unsigned int* index, unsigned int* stamp,
-    int* X, int* Y, int* W, int* H,
-    int* numClipRects, drm_clip_rect_t ** pClipRects,
-    int* backX, int* backY,
-    int* numBackClipRects, drm_clip_rect_t ** pBackClipRects )
-{
-    XExtDisplayInfo *info = find_display (dpy);
-    xXF86DRIGetDrawableInfoReply rep;
-    xXF86DRIGetDrawableInfoReq *req;
-    int total_rects;
-
-    TRACE("GetDrawableInfo...");
-    XF86DRICheckExtension (dpy, info, False);
-
-    LockDisplay(dpy);
-    GetReq(XF86DRIGetDrawableInfo, req);
-    req->reqType = info->codes->major_opcode;
-    req->driReqType = X_XF86DRIGetDrawableInfo;
-    req->screen = screen;
-    req->drawable = drawable;
-
-    if (!_XReply(dpy, (xReply *)&rep, 1, xFalse)) 
-    {
-       UnlockDisplay(dpy);
-       SyncHandle();
-        TRACE("GetDrawableInfo... return False");
-       return False;
-    }
-    *index = rep.drawableTableIndex;
-    *stamp = rep.drawableTableStamp;
-    *X = (int)rep.drawableX;
-    *Y = (int)rep.drawableY;
-    *W = (int)rep.drawableWidth;
-    *H = (int)rep.drawableHeight;
-    *numClipRects = rep.numClipRects;
-    total_rects = *numClipRects;
-
-    *backX = rep.backX;
-    *backY = rep.backY;
-    *numBackClipRects = rep.numBackClipRects;
-    total_rects += *numBackClipRects;
-
-#if 0
-    /* Because of the fix in Xserver/GL/dri/xf86dri.c, this check breaks
-     * backwards compatibility (Because of the >> 2 shift) but the fix
-     * enables multi-threaded apps to work.
-     */
-    if (rep.length !=  ((((SIZEOF(xXF86DRIGetDrawableInfoReply) - 
-                      SIZEOF(xGenericReply) + 
-                      total_rects * sizeof(drm_clip_rect_t)) + 3) & ~3) >> 2)) {
-        _XEatData(dpy, rep.length);
-       UnlockDisplay(dpy);
-       SyncHandle();
-        TRACE("GetDrawableInfo... return False");
-        return False;
-    }
-#endif
-
-    if (*numClipRects) {
-       int len = sizeof(drm_clip_rect_t) * (*numClipRects);
-
-       *pClipRects = (drm_clip_rect_t *)Xcalloc(len, 1);
-       if (*pClipRects) 
-         _XRead(dpy, (char*)*pClipRects, len);
-    } else {
-        *pClipRects = NULL;
-    }
-
-    if (*numBackClipRects) {
-       int len = sizeof(drm_clip_rect_t) * (*numBackClipRects);
-
-       *pBackClipRects = (drm_clip_rect_t *)Xcalloc(len, 1);
-       if (*pBackClipRects) 
-         _XRead(dpy, (char*)*pBackClipRects, len);
-    } else {
-        *pBackClipRects = NULL;
-    }
-
-    UnlockDisplay(dpy);
-    SyncHandle();
-    TRACE("GetDrawableInfo... return True");
-    return True;
-}
-
-PUBLIC Bool XF86DRIGetDeviceInfo(dpy, screen, hFrameBuffer, 
-       fbOrigin, fbSize, fbStride, devPrivateSize, pDevPrivate)
-    Display* dpy;
-    int screen;
-    drm_handle_t * hFrameBuffer;
-    int* fbOrigin;
-    int* fbSize;
-    int* fbStride;
-    int* devPrivateSize;
-    void** pDevPrivate;
-{
-    XExtDisplayInfo *info = find_display (dpy);
-    xXF86DRIGetDeviceInfoReply rep;
-    xXF86DRIGetDeviceInfoReq *req;
-
-    TRACE("GetDeviceInfo...");
-    XF86DRICheckExtension (dpy, info, False);
-
-    LockDisplay(dpy);
-    GetReq(XF86DRIGetDeviceInfo, req);
-    req->reqType = info->codes->major_opcode;
-    req->driReqType = X_XF86DRIGetDeviceInfo;
-    req->screen = screen;
-    if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
-       UnlockDisplay(dpy);
-       SyncHandle();
-        TRACE("GetDeviceInfo... return False");
-       return False;
-    }
-
-    *hFrameBuffer = rep.hFrameBufferLow;
-    if (sizeof(drm_handle_t) == 8) {
-       int shift = 32; /* var to prevent warning on next line */
-       *hFrameBuffer |= ((drm_handle_t) rep.hFrameBufferHigh) << shift;
-    }
-
-    *fbOrigin = rep.framebufferOrigin;
-    *fbSize = rep.framebufferSize;
-    *fbStride = rep.framebufferStride;
-    *devPrivateSize = rep.devPrivateSize;
-
-    if (rep.length) {
-        if (!(*pDevPrivate = (void *)Xcalloc(rep.devPrivateSize, 1))) {
-            _XEatData(dpy, ((rep.devPrivateSize+3) & ~3));
-            UnlockDisplay(dpy);
-            SyncHandle();
-            TRACE("GetDeviceInfo... return False");
-            return False;
-        }
-       _XRead(dpy, (char*)*pDevPrivate, rep.devPrivateSize);
-    } else {
-        *pDevPrivate = NULL;
-    }
-
-    UnlockDisplay(dpy);
-    SyncHandle();
-    TRACE("GetDeviceInfo... return True");
-    return True;
-}
-
-PUBLIC Bool XF86DRIOpenFullScreen(dpy, screen, drawable)
-    Display* dpy;
-    int screen;
-    Drawable drawable;
-{
-    /* This function and the underlying X protocol are deprecated.
-     */
-    (void) dpy;
-    (void) screen;
-    (void) drawable;
-    return False;
-}
-
-PUBLIC Bool XF86DRICloseFullScreen(dpy, screen, drawable)
-    Display* dpy;
-    int screen;
-    Drawable drawable;
-{
-    /* This function and the underlying X protocol are deprecated.
-     */
-    (void) dpy;
-    (void) screen;
-    (void) drawable;
-    return True;
-}
-
diff --git a/src/driclient/src/driclient.c b/src/driclient/src/driclient.c
deleted file mode 100644 (file)
index dc2189a..0000000
+++ /dev/null
@@ -1,310 +0,0 @@
-#include "driclient.h"
-#include <assert.h>
-#include <stdlib.h>
-
-int driCreateScreen(Display *display, int screen, dri_screen_t **dri_screen, dri_framebuffer_t *dri_framebuf)
-{
-       int             evbase, errbase;
-       char            *driver_name;
-       int             newly_opened;
-       drm_magic_t     magic;
-       drmVersionPtr   drm_version;
-       drm_handle_t    sarea_handle;
-       char            *bus_id;
-       dri_screen_t    *dri_scrn;
-
-       assert(display);
-       assert(dri_screen);
-
-       if (!XF86DRIQueryExtension(display, &evbase, &errbase))
-               return 1;
-
-       dri_scrn = calloc(1, sizeof(dri_screen_t));
-
-       if (!dri_scrn)
-               return 1;
-
-       if (!XF86DRIQueryVersion(display, &dri_scrn->dri.major, &dri_scrn->dri.minor, &dri_scrn->dri.patch))
-               goto free_screen;
-
-       dri_scrn->display = display;
-       dri_scrn->num = screen;
-       dri_scrn->draw_lock_id = 1;
-
-       if (!XF86DRIOpenConnection(display, screen, &sarea_handle, &bus_id))
-               goto free_screen;
-
-       dri_scrn->fd = -1;
-       dri_scrn->fd = drmOpenOnce(NULL, bus_id, &newly_opened);
-       XFree(bus_id);
-
-       if (dri_scrn->fd < 0)
-               goto close_connection;
-
-       if (drmGetMagic(dri_scrn->fd, &magic))
-               goto close_drm;
-
-       drm_version = drmGetVersion(dri_scrn->fd);
-
-       if (!drm_version)
-               goto close_drm;
-
-       dri_scrn->drm.major = drm_version->version_major;
-       dri_scrn->drm.minor = drm_version->version_minor;
-       dri_scrn->drm.patch = drm_version->version_patchlevel;
-       drmFreeVersion(drm_version);
-
-       if (!XF86DRIAuthConnection(display, screen, magic))
-               goto close_drm;
-
-       if (!XF86DRIGetClientDriverName
-       (
-               display,
-               screen,
-               &dri_scrn->ddx.major,
-               &dri_scrn->ddx.minor,
-               &dri_scrn->ddx.patch,
-               &driver_name
-       ))
-               goto close_drm;
-
-       if (drmMap(dri_scrn->fd, sarea_handle, SAREA_MAX, (drmAddress)&dri_scrn->sarea))
-               goto close_drm;
-
-       dri_scrn->drawable_hash = drmHashCreate();
-
-       if (!dri_scrn->drawable_hash)
-               goto unmap_sarea;
-
-       if (dri_framebuf)
-       {
-               if (!XF86DRIGetDeviceInfo
-               (
-                       display,
-                       screen, &dri_framebuf->drm_handle,
-                       &dri_framebuf->base,
-                       &dri_framebuf->size,
-                       &dri_framebuf->stride,
-                       &dri_framebuf->private_size,
-                       &dri_framebuf->private
-               ))
-                       goto destroy_hash;
-       }
-
-       *dri_screen = dri_scrn;
-
-       return 0;
-
-destroy_hash:
-       drmHashDestroy(dri_scrn->drawable_hash);
-unmap_sarea:
-       drmUnmap(dri_scrn->sarea, SAREA_MAX);
-close_drm:
-       drmCloseOnce(dri_scrn->fd);
-close_connection:
-       XF86DRICloseConnection(display, screen);
-free_screen:
-       free(dri_scrn);
-
-       return 1;
-}
-
-int driDestroyScreen(dri_screen_t *dri_screen)
-{
-       Drawable        draw;
-       dri_drawable_t  *dri_draw;
-
-       assert(dri_screen);
-
-       if (drmHashFirst(dri_screen->drawable_hash, &draw, (void**)&dri_draw))
-       {
-               dri_draw->refcount = 1;
-               driDestroyDrawable(dri_draw);
-
-               while (drmHashNext(dri_screen->drawable_hash, &draw, (void**)&dri_draw))
-               {
-                       dri_draw->refcount = 1;
-                       driDestroyDrawable(dri_draw);
-               }
-       }
-
-       drmHashDestroy(dri_screen->drawable_hash);
-       drmUnmap(dri_screen->sarea, SAREA_MAX);
-       drmCloseOnce(dri_screen->fd);
-       XF86DRICloseConnection(dri_screen->display, dri_screen->num);
-       free(dri_screen);
-
-       return 0;
-}
-
-int driCreateDrawable(dri_screen_t *dri_screen, Drawable drawable, dri_drawable_t **dri_drawable)
-{
-       int             evbase, errbase;
-       dri_drawable_t  *dri_draw;
-
-       assert(dri_screen);
-       assert(dri_drawable);
-
-       if (!XF86DRIQueryExtension(dri_screen->display, &evbase, &errbase))
-               return 1;
-
-       if (!drmHashLookup(dri_screen->drawable_hash, drawable, (void**)dri_drawable))
-       {
-               /* Found */
-               (*dri_drawable)->refcount++;
-               return 0;
-       }
-
-       dri_draw = calloc(1, sizeof(dri_drawable_t));
-
-       if (!dri_draw)
-               return 1;
-
-       if (!XF86DRICreateDrawable(dri_screen->display, 0, drawable, &dri_draw->drm_drawable))
-       {
-               free(dri_draw);
-               return 1;
-       }
-
-       dri_draw->x_drawable = drawable;
-       dri_draw->sarea_index = 0;
-       dri_draw->sarea_stamp = NULL;
-       dri_draw->last_sarea_stamp = 0;
-       dri_draw->dri_screen = dri_screen;
-       dri_draw->refcount = 1;
-
-       if (drmHashInsert(dri_screen->drawable_hash, drawable, dri_draw))
-       {
-               XF86DRIDestroyDrawable(dri_screen->display, dri_screen->num, drawable);
-               free(dri_draw);
-               return 1;
-       }
-
-       if (!dri_draw->sarea_stamp || *dri_draw->sarea_stamp != dri_draw->last_sarea_stamp)
-       {
-               DRM_SPINLOCK(&dri_screen->sarea->drawable_lock, dri_screen->draw_lock_id);
-
-               if (driUpdateDrawableInfo(dri_draw))
-               {
-                       XF86DRIDestroyDrawable(dri_screen->display, dri_screen->num, drawable);
-                       free(dri_draw);
-                       DRM_SPINUNLOCK(&dri_screen->sarea->drawable_lock, dri_screen->draw_lock_id);
-                       return 1;
-               }
-
-               DRM_SPINUNLOCK(&dri_screen->sarea->drawable_lock, dri_screen->draw_lock_id);
-       }
-
-       *dri_drawable = dri_draw;
-
-       return 0;
-}
-
-int driUpdateDrawableInfo(dri_drawable_t *dri_drawable)
-{
-       assert(dri_drawable);
-
-       if (dri_drawable->cliprects)
-       {
-               XFree(dri_drawable->cliprects);
-               dri_drawable->cliprects = NULL;
-       }
-       if (dri_drawable->back_cliprects)
-       {
-               XFree(dri_drawable->back_cliprects);
-               dri_drawable->back_cliprects = NULL;
-       }
-
-       DRM_SPINUNLOCK(&dri_drawable->dri_screen->sarea->drawable_lock, dri_drawable->dri_screen->draw_lock_id);
-
-       if (!XF86DRIGetDrawableInfo
-       (
-               dri_drawable->dri_screen->display,
-               dri_drawable->dri_screen->num,
-               dri_drawable->x_drawable,
-               &dri_drawable->sarea_index,
-               &dri_drawable->last_sarea_stamp,
-               &dri_drawable->x,
-               &dri_drawable->y,
-               &dri_drawable->w,
-               &dri_drawable->h,
-               &dri_drawable->num_cliprects,
-               &dri_drawable->cliprects,
-               &dri_drawable->back_x,
-               &dri_drawable->back_y,
-               &dri_drawable->num_back_cliprects,
-               &dri_drawable->back_cliprects
-       ))
-       {
-               dri_drawable->sarea_stamp = &dri_drawable->last_sarea_stamp;
-               dri_drawable->num_cliprects = 0;
-               dri_drawable->cliprects = NULL;
-               dri_drawable->num_back_cliprects = 0;
-               dri_drawable->back_cliprects = 0;
-
-               return 1;
-       }
-       else
-               dri_drawable->sarea_stamp = &dri_drawable->dri_screen->sarea->drawableTable[dri_drawable->sarea_index].stamp;
-
-       DRM_SPINLOCK(&dri_drawable->dri_screen->sarea->drawable_lock, dri_drawable->dri_screen->draw_lock_id);
-
-       return 0;
-}
-
-int driDestroyDrawable(dri_drawable_t *dri_drawable)
-{
-       assert(dri_drawable);
-
-       if (--dri_drawable->refcount == 0)
-       {
-               if (dri_drawable->cliprects)
-                       XFree(dri_drawable->cliprects);
-               if (dri_drawable->back_cliprects)
-                       XFree(dri_drawable->back_cliprects);
-               drmHashDelete(dri_drawable->dri_screen->drawable_hash, dri_drawable->x_drawable);
-               XF86DRIDestroyDrawable(dri_drawable->dri_screen->display, dri_drawable->dri_screen->num, dri_drawable->x_drawable);
-               free(dri_drawable);
-       }
-
-       return 0;
-}
-
-int driCreateContext(dri_screen_t *dri_screen, Visual *visual, dri_context_t **dri_context)
-{
-       int             evbase, errbase;
-       dri_context_t   *dri_ctx;
-
-       assert(dri_screen);
-       assert(visual);
-       assert(dri_context);
-
-       if (!XF86DRIQueryExtension(dri_screen->display, &evbase, &errbase))
-               return 1;
-
-       dri_ctx = calloc(1, sizeof(dri_context_t));
-
-       if (!dri_ctx)
-               return 1;
-
-       if (!XF86DRICreateContext(dri_screen->display, dri_screen->num, visual, &dri_ctx->id, &dri_ctx->drm_context))
-       {
-               free(dri_ctx);
-               return 1;
-       }
-
-       dri_ctx->dri_screen = dri_screen;
-       *dri_context = dri_ctx;
-
-       return 0;
-}
-
-int driDestroyContext(dri_context_t *dri_context)
-{
-       assert(dri_context);
-
-       XF86DRIDestroyContext(dri_context->dri_screen->display, dri_context->dri_screen->num, dri_context->id);
-       free(dri_context);
-
-       return 0;
-}
diff --git a/src/driclient/src/xf86dristr.h b/src/driclient/src/xf86dristr.h
deleted file mode 100644 (file)
index b834bd1..0000000
+++ /dev/null
@@ -1,342 +0,0 @@
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-Copyright 2000 VA Linux Systems, Inc.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- *   Kevin E. Martin <martin@valinux.com>
- *   Jens Owen <jens@tungstengraphics.com>
- *   Rickard E. (Rik) Fiath <faith@valinux.com>
- *
- */
-
-#ifndef _XF86DRISTR_H_
-#define _XF86DRISTR_H_
-
-#include "xf86dri.h"
-
-#define XF86DRINAME "XFree86-DRI"
-
-/* The DRI version number.  This was originally set to be the same of the
- * XFree86 version number.  However, this version is really indepedent of
- * the XFree86 version.
- *
- * Version History:
- *    4.0.0: Original
- *    4.0.1: Patch to bump clipstamp when windows are destroyed, 28 May 02
- *    4.1.0: Add transition from single to multi in DRMInfo rec, 24 Jun 02
- */
-#define XF86DRI_MAJOR_VERSION  4
-#define XF86DRI_MINOR_VERSION  1
-#define XF86DRI_PATCH_VERSION  0
-
-typedef struct _XF86DRIQueryVersion {
-    CARD8      reqType;                /* always DRIReqCode */
-    CARD8      driReqType;             /* always X_DRIQueryVersion */
-    CARD16     length B16;
-} xXF86DRIQueryVersionReq;
-#define sz_xXF86DRIQueryVersionReq     4
-
-typedef struct {
-    BYTE       type;                   /* X_Reply */
-    BOOL       pad1;
-    CARD16     sequenceNumber B16;
-    CARD32     length B32;
-    CARD16     majorVersion B16;       /* major version of DRI protocol */
-    CARD16     minorVersion B16;       /* minor version of DRI protocol */
-    CARD32     patchVersion B32;       /* patch version of DRI protocol */
-    CARD32     pad3 B32;
-    CARD32     pad4 B32;
-    CARD32     pad5 B32;
-    CARD32     pad6 B32;
-} xXF86DRIQueryVersionReply;
-#define sz_xXF86DRIQueryVersionReply   32
-
-typedef struct _XF86DRIQueryDirectRenderingCapable {
-    CARD8      reqType;                /* always DRIReqCode */
-    CARD8      driReqType;             /* X_DRIQueryDirectRenderingCapable */
-    CARD16     length B16;
-    CARD32     screen B32;
-} xXF86DRIQueryDirectRenderingCapableReq;
-#define sz_xXF86DRIQueryDirectRenderingCapableReq      8
-
-typedef struct {
-    BYTE       type;                   /* X_Reply */
-    BOOL       pad1;
-    CARD16     sequenceNumber B16;
-    CARD32     length B32;
-    BOOL       isCapable;
-    BOOL       pad2;
-    BOOL       pad3;
-    BOOL       pad4;
-    CARD32     pad5 B32;
-    CARD32     pad6 B32;
-    CARD32     pad7 B32;
-    CARD32     pad8 B32;
-    CARD32     pad9 B32;
-} xXF86DRIQueryDirectRenderingCapableReply;
-#define sz_xXF86DRIQueryDirectRenderingCapableReply    32
-
-typedef struct _XF86DRIOpenConnection {
-    CARD8      reqType;                /* always DRIReqCode */
-    CARD8      driReqType;             /* always X_DRIOpenConnection */
-    CARD16     length B16;
-    CARD32     screen B32;
-} xXF86DRIOpenConnectionReq;
-#define sz_xXF86DRIOpenConnectionReq   8
-
-typedef struct {
-    BYTE       type;                   /* X_Reply */
-    BOOL       pad1;
-    CARD16     sequenceNumber B16;
-    CARD32     length B32;
-    CARD32     hSAREALow B32;
-    CARD32     hSAREAHigh B32;
-    CARD32     busIdStringLength B32;
-    CARD32     pad6 B32;
-    CARD32     pad7 B32;
-    CARD32     pad8 B32;
-} xXF86DRIOpenConnectionReply;
-#define sz_xXF86DRIOpenConnectionReply 32
-
-typedef struct _XF86DRIAuthConnection {
-    CARD8      reqType;                /* always DRIReqCode */
-    CARD8      driReqType;             /* always X_DRICloseConnection */
-    CARD16     length B16;
-    CARD32     screen B32;
-    CARD32      magic B32;
-} xXF86DRIAuthConnectionReq;
-#define sz_xXF86DRIAuthConnectionReq   12
-
-typedef struct {
-    BYTE        type;
-    BOOL        pad1;
-    CARD16      sequenceNumber B16;
-    CARD32      length B32;
-    CARD32      authenticated B32;
-    CARD32      pad2 B32;
-    CARD32      pad3 B32;
-    CARD32      pad4 B32;
-    CARD32      pad5 B32;
-    CARD32      pad6 B32;
-} xXF86DRIAuthConnectionReply;
-#define zx_xXF86DRIAuthConnectionReply  32
-
-typedef struct _XF86DRICloseConnection {
-    CARD8      reqType;                /* always DRIReqCode */
-    CARD8      driReqType;             /* always X_DRICloseConnection */
-    CARD16     length B16;
-    CARD32     screen B32;
-} xXF86DRICloseConnectionReq;
-#define sz_xXF86DRICloseConnectionReq  8
-
-typedef struct _XF86DRIGetClientDriverName {
-    CARD8      reqType;                /* always DRIReqCode */
-    CARD8      driReqType;             /* always X_DRIGetClientDriverName */
-    CARD16     length B16;
-    CARD32     screen B32;
-} xXF86DRIGetClientDriverNameReq;
-#define sz_xXF86DRIGetClientDriverNameReq      8
-
-typedef struct {
-    BYTE       type;                   /* X_Reply */
-    BOOL       pad1;
-    CARD16     sequenceNumber B16;
-    CARD32     length B32;
-    CARD32     ddxDriverMajorVersion B32;
-    CARD32     ddxDriverMinorVersion B32;
-    CARD32     ddxDriverPatchVersion B32;
-    CARD32     clientDriverNameLength B32;
-    CARD32     pad5 B32;
-    CARD32     pad6 B32;
-} xXF86DRIGetClientDriverNameReply;
-#define sz_xXF86DRIGetClientDriverNameReply    32
-
-typedef struct _XF86DRICreateContext {
-    CARD8      reqType;                /* always DRIReqCode */
-    CARD8      driReqType;             /* always X_DRICreateContext */
-    CARD16     length B16;
-    CARD32     screen B32;
-    CARD32     visual B32;
-    CARD32     context B32;
-} xXF86DRICreateContextReq;
-#define sz_xXF86DRICreateContextReq    16
-
-typedef struct {
-    BYTE       type;                   /* X_Reply */
-    BOOL       pad1;
-    CARD16     sequenceNumber B16;
-    CARD32     length B32;
-    CARD32     hHWContext B32;
-    CARD32     pad2 B32;
-    CARD32     pad3 B32;
-    CARD32     pad4 B32;
-    CARD32     pad5 B32;
-    CARD32     pad6 B32;
-} xXF86DRICreateContextReply;
-#define sz_xXF86DRICreateContextReply  32
-
-typedef struct _XF86DRIDestroyContext {
-    CARD8      reqType;                /* always DRIReqCode */
-    CARD8      driReqType;             /* always X_DRIDestroyContext */
-    CARD16     length B16;
-    CARD32     screen B32;
-    CARD32     context B32;
-} xXF86DRIDestroyContextReq;
-#define sz_xXF86DRIDestroyContextReq   12
-
-typedef struct _XF86DRICreateDrawable {
-    CARD8      reqType;                /* always DRIReqCode */
-    CARD8      driReqType;             /* always X_DRICreateDrawable */
-    CARD16     length B16;
-    CARD32     screen B32;
-    CARD32     drawable B32;
-} xXF86DRICreateDrawableReq;
-#define sz_xXF86DRICreateDrawableReq   12
-
-typedef struct {
-    BYTE       type;                   /* X_Reply */
-    BOOL       pad1;
-    CARD16     sequenceNumber B16;
-    CARD32     length B32;
-    CARD32     hHWDrawable B32;
-    CARD32     pad2 B32;
-    CARD32     pad3 B32;
-    CARD32     pad4 B32;
-    CARD32     pad5 B32;
-    CARD32     pad6 B32;
-} xXF86DRICreateDrawableReply;
-#define sz_xXF86DRICreateDrawableReply 32
-
-typedef struct _XF86DRIDestroyDrawable {
-    CARD8      reqType;                /* always DRIReqCode */
-    CARD8      driReqType;             /* always X_DRIDestroyDrawable */
-    CARD16     length B16;
-    CARD32     screen B32;
-    CARD32     drawable B32;
-} xXF86DRIDestroyDrawableReq;
-#define sz_xXF86DRIDestroyDrawableReq  12
-
-typedef struct _XF86DRIGetDrawableInfo {
-    CARD8      reqType;                /* always DRIReqCode */
-    CARD8      driReqType;             /* always X_DRIGetDrawableInfo */
-    CARD16     length B16;
-    CARD32     screen B32;
-    CARD32     drawable B32;
-} xXF86DRIGetDrawableInfoReq;
-#define sz_xXF86DRIGetDrawableInfoReq  12
-
-typedef struct {
-    BYTE       type;                   /* X_Reply */
-    BOOL       pad1;
-    CARD16     sequenceNumber B16;
-    CARD32     length B32;
-    CARD32     drawableTableIndex B32;
-    CARD32     drawableTableStamp B32;
-    INT16      drawableX B16;
-    INT16      drawableY B16;
-    INT16      drawableWidth B16;
-    INT16      drawableHeight B16;
-    CARD32     numClipRects B32;
-    INT16       backX B16;
-    INT16       backY B16;
-    CARD32      numBackClipRects B32;
-} xXF86DRIGetDrawableInfoReply;
-
-#define sz_xXF86DRIGetDrawableInfoReply        36
-
-
-typedef struct _XF86DRIGetDeviceInfo {
-    CARD8      reqType;                /* always DRIReqCode */
-    CARD8      driReqType;             /* always X_DRIGetDeviceInfo */
-    CARD16     length B16;
-    CARD32     screen B32;
-} xXF86DRIGetDeviceInfoReq;
-#define sz_xXF86DRIGetDeviceInfoReq    8
-
-typedef struct {
-    BYTE       type;                   /* X_Reply */
-    BOOL       pad1;
-    CARD16     sequenceNumber B16;
-    CARD32     length B32;
-    CARD32     hFrameBufferLow B32;
-    CARD32     hFrameBufferHigh B32;
-    CARD32     framebufferOrigin B32;
-    CARD32     framebufferSize B32;
-    CARD32     framebufferStride B32;
-    CARD32     devPrivateSize B32;
-} xXF86DRIGetDeviceInfoReply;
-#define sz_xXF86DRIGetDeviceInfoReply  32
-
-typedef struct _XF86DRIOpenFullScreen {
-    CARD8       reqType;       /* always DRIReqCode */
-    CARD8       driReqType;    /* always X_DRIOpenFullScreen */
-    CARD16      length B16;
-    CARD32      screen B32;
-    CARD32      drawable B32;
-} xXF86DRIOpenFullScreenReq;
-#define sz_xXF86DRIOpenFullScreenReq    12
-
-typedef struct {
-    BYTE        type;
-    BOOL        pad1;
-    CARD16      sequenceNumber B16;
-    CARD32      length B32;
-    CARD32      isFullScreen B32;
-    CARD32      pad2 B32;
-    CARD32      pad3 B32;
-    CARD32      pad4 B32;
-    CARD32      pad5 B32;
-    CARD32      pad6 B32;
-} xXF86DRIOpenFullScreenReply;
-#define sz_xXF86DRIOpenFullScreenReply  32
-
-typedef struct _XF86DRICloseFullScreen {
-    CARD8       reqType;       /* always DRIReqCode */
-    CARD8       driReqType;    /* always X_DRICloseFullScreen */
-    CARD16      length B16;
-    CARD32      screen B32;
-    CARD32      drawable B32;
-} xXF86DRICloseFullScreenReq;
-#define sz_xXF86DRICloseFullScreenReq   12
-
-typedef struct {
-    BYTE        type;
-    BOOL        pad1;
-    CARD16      sequenceNumber B16;
-    CARD32      length B32;
-    CARD32      pad2 B32;
-    CARD32      pad3 B32;
-    CARD32      pad4 B32;
-    CARD32      pad5 B32;
-    CARD32      pad6 B32;
-    CARD32      pad7 B32;
-} xXF86DRICloseFullScreenReply;
-#define sz_xXF86DRICloseFullScreenReply  32
-
-
-#endif /* _XF86DRISTR_H_ */
index f8ff82b49c27ff5f4c140d772e219e58345addbc..d2b1f4f077a546aab657e147aaff5bf2a632d0cb 100644 (file)
@@ -4,12 +4,14 @@ TOP = ../../../..
 include $(TOP)/configs/current
 
 EGL_DRIVER = egl_dri2
-EGL_SOURCES = egl_dri2.c platform_drm.c common.c
+EGL_SOURCES = egl_dri2.c common.c
 
 EGL_INCLUDES = \
        -I$(TOP)/include \
        -I$(TOP)/src/egl/main \
        -I$(TOP)/src/mapi \
+       -I$(TOP)/src/gbm/main \
+       -I$(TOP)/src/gbm/backends/dri \
        -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \
        $(LIBUDEV_CFLAGS) \
        $(LIBDRM_CFLAGS)
@@ -29,6 +31,11 @@ EGL_INCLUDES += -DHAVE_X11_PLATFORM $(XCB_DRI2_CFLAGS)
 EGL_LIBS +=  $(XCB_DRI2_LIBS)
 endif
 
+ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
+EGL_SOURCES += platform_drm.c
+EGL_INCLUDES += -DHAVE_DRM_PLATFORM
+endif
+
 ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
 EGL_SOURCES += platform_wayland.c
 EGL_INCLUDES += -DHAVE_WAYLAND_PLATFORM $(WAYLAND_CFLAGS) \
index d430145d09c4b232672b8f4656bdaf9d1400f320..5680c360f1d3c20110526002befa3b2b17cfafba 100644 (file)
@@ -244,7 +244,7 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
    return conf;
 }
 
-static __DRIimage *
+__DRIimage *
 dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data)
 {
    _EGLDisplay *disp = data;
@@ -433,42 +433,12 @@ dri2_load_driver_swrast(_EGLDisplay *disp)
    return EGL_TRUE;
 }
 
-EGLBoolean
-dri2_create_screen(_EGLDisplay *disp)
+void
+dri2_setup_screen(_EGLDisplay *disp)
 {
-   const __DRIextension **extensions;
-   struct dri2_egl_display *dri2_dpy;
+   struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
    unsigned int api_mask;
 
-   dri2_dpy = disp->DriverData;
-
-   if (dri2_dpy->dri2) {
-      dri2_dpy->dri_screen =
-         dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd, dri2_dpy->extensions,
-                                        &dri2_dpy->driver_configs, disp);
-   } else {
-      assert(dri2_dpy->swrast);
-      dri2_dpy->dri_screen =
-         dri2_dpy->swrast->createNewScreen(0, dri2_dpy->extensions,
-                                           &dri2_dpy->driver_configs, disp);
-   }
-
-   if (dri2_dpy->dri_screen == NULL) {
-      _eglLog(_EGL_WARNING, "DRI2: failed to create dri screen");
-      return EGL_FALSE;
-   }
-
-   extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen);
-   
-   if (dri2_dpy->dri2) {
-      if (!dri2_bind_extensions(dri2_dpy, dri2_core_extensions, extensions))
-         goto cleanup_dri_screen;
-   } else {
-      assert(dri2_dpy->swrast);
-      if (!dri2_bind_extensions(dri2_dpy, swrast_core_extensions, extensions))
-         goto cleanup_dri_screen;
-   }
-
    if (dri2_dpy->dri2) {
       if (dri2_dpy->dri2->base.version >= 2)
          api_mask = dri2_dpy->dri2->getAPIMask(dri2_dpy->dri_screen);
@@ -510,6 +480,46 @@ dri2_create_screen(_EGLDisplay *disp)
       disp->Extensions.KHR_image_base = EGL_TRUE;
       disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE;
    }
+}
+
+EGLBoolean
+dri2_create_screen(_EGLDisplay *disp)
+{
+   const __DRIextension **extensions;
+   struct dri2_egl_display *dri2_dpy;
+
+   dri2_dpy = disp->DriverData;
+
+   if (dri2_dpy->dri2) {
+      dri2_dpy->dri_screen =
+         dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd, dri2_dpy->extensions,
+                                        &dri2_dpy->driver_configs, disp);
+   } else {
+      assert(dri2_dpy->swrast);
+      dri2_dpy->dri_screen =
+         dri2_dpy->swrast->createNewScreen(0, dri2_dpy->extensions,
+                                           &dri2_dpy->driver_configs, disp);
+   }
+
+   if (dri2_dpy->dri_screen == NULL) {
+      _eglLog(_EGL_WARNING, "DRI2: failed to create dri screen");
+      return EGL_FALSE;
+   }
+
+   dri2_dpy->own_dri_screen = 1;
+
+   extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen);
+   
+   if (dri2_dpy->dri2) {
+      if (!dri2_bind_extensions(dri2_dpy, dri2_core_extensions, extensions))
+         goto cleanup_dri_screen;
+   } else {
+      assert(dri2_dpy->swrast);
+      if (!dri2_bind_extensions(dri2_dpy, swrast_core_extensions, extensions))
+         goto cleanup_dri_screen;
+   }
+
+   dri2_setup_screen(disp);
 
    return EGL_TRUE;
 
@@ -538,10 +548,12 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp)
 #endif
 
 #ifdef HAVE_LIBUDEV
+#ifdef HAVE_DRM_PLATFORM
    case _EGL_PLATFORM_DRM:
       if (disp->Options.TestOnly)
          return EGL_TRUE;
       return dri2_initialize_drm(drv, disp);
+#endif
 #ifdef HAVE_WAYLAND_PLATFORM
    case _EGL_PLATFORM_WAYLAND:
       if (disp->Options.TestOnly)
@@ -566,10 +578,12 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
    _eglReleaseDisplayResources(drv, disp);
    _eglCleanupDisplay(disp);
 
-   dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
+   if (dri2_dpy->own_dri_screen)
+      dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
    if (dri2_dpy->fd)
       close(dri2_dpy->fd);
-   dlclose(dri2_dpy->driver);
+   if (dri2_dpy->driver)
+      dlclose(dri2_dpy->driver);
 
    if (disp->PlatformDisplay == NULL) {
       switch (disp->Platform) {
index dd9eb94cf7a93eff6c50ad5c3b1857d6f89acf70..3854200bc694642ffd18e21a016214d1e0099626 100644 (file)
 #include <GL/gl.h>
 #include <GL/internal/dri_interface.h>
 
+#ifdef HAVE_DRM_PLATFORM
+#include <gbm_driint.h>
+#endif
+
 #include "eglconfig.h"
 #include "eglcontext.h"
 #include "egldisplay.h"
@@ -69,6 +73,7 @@ struct dri2_egl_display
    int                       dri2_major;
    int                       dri2_minor;
    __DRIscreen              *dri_screen;
+   int                       own_dri_screen;
    const __DRIconfig       **driver_configs;
    void                     *driver;
    __DRIcoreExtension       *core;
@@ -79,12 +84,16 @@ struct dri2_egl_display
    __DRIimageExtension      *image;
    int                       fd;
 
+#ifdef HAVE_DRM_PLATFORM
+   struct gbm_dri_device    *gbm_dri;
+#endif
+
    char                     *device_name;
    char                     *driver_name;
 
    __DRIdri2LoaderExtension    dri2_loader_extension;
    __DRIswrastLoaderExtension  swrast_loader_extension;
-   const __DRIextension     *extensions[3];
+   const __DRIextension     *extensions[4];
 
 #ifdef HAVE_X11_PLATFORM
    xcb_connection_t         *conn;
@@ -110,6 +119,7 @@ struct dri2_egl_context
 enum wayland_buffer_type {
    WL_BUFFER_FRONT,
    WL_BUFFER_BACK,
+   WL_BUFFER_THIRD,
    WL_BUFFER_COUNT
 };
 
@@ -145,9 +155,11 @@ struct dri2_egl_surface
    struct wl_egl_window  *wl_win;
    struct wl_egl_pixmap  *wl_pix;
    struct wl_buffer      *wl_drm_buffer[WL_BUFFER_COUNT];
+   int                    wl_buffer_lock[WL_BUFFER_COUNT];
    int                    dx;
    int                    dy;
    __DRIbuffer           *dri_buffers[__DRI_BUFFER_COUNT];
+   __DRIbuffer           *third_buffer;
    __DRIbuffer           *pending_buffer;
    EGLBoolean             block_swap_buffers;
 #endif
@@ -182,12 +194,19 @@ extern const __DRIuseInvalidateExtension use_invalidate;
 EGLBoolean
 dri2_load_driver(_EGLDisplay *disp);
 
+/* Helper for platforms not using dri2_create_screen */
+void
+dri2_setup_screen(_EGLDisplay *disp);
+
 EGLBoolean
 dri2_load_driver_swrast(_EGLDisplay *disp);
 
 EGLBoolean
 dri2_create_screen(_EGLDisplay *disp);
 
+__DRIimage *
+dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data);
+
 struct dri2_egl_config *
 dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
                int depth, EGLint surface_type, const EGLint *attr_list);
index 27846de39d28f0fb5be1258007837a67f922aace..579baf9f9d26239f7c69156ee637aedc5dd215fc 100644 (file)
 
 #include "egl_dri2.h"
 
+static _EGLImage *
+dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
+                            EGLClientBuffer buffer, const EGLint *attr_list)
+{
+   struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+   struct gbm_dri_bo *dri_bo = gbm_dri_bo((struct gbm_bo *) buffer);
+   struct dri2_egl_image *dri2_img;
+
+   dri2_img = malloc(sizeof *dri2_img);
+   if (!dri2_img) {
+      _eglError(EGL_BAD_ALLOC, "dri2_create_image_khr_pixmap");
+      return NULL;
+   }
+
+   if (!_eglInitImage(&dri2_img->base, disp)) {
+      free(dri2_img);
+      return NULL;
+   }
+
+   dri2_img->dri_image = dri2_dpy->image->dupImage(dri_bo->image, dri2_img);
+   if (dri2_img->dri_image == NULL) {
+      free(dri2_img);
+      _eglError(EGL_BAD_ALLOC, "dri2_create_image_khr_pixmap");
+      return NULL;
+   }
+
+   return &dri2_img->base;
+}
+
+static _EGLImage *
+dri2_drm_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
+                          _EGLContext *ctx, EGLenum target,
+                          EGLClientBuffer buffer, const EGLint *attr_list)
+{
+   (void) drv;
+
+   switch (target) {
+   case EGL_NATIVE_PIXMAP_KHR:
+      return dri2_create_image_khr_pixmap(disp, ctx, buffer, attr_list);
+   default:
+      return dri2_create_image_khr(drv, disp, ctx, target, buffer, attr_list);
+   }
+}
+
 static int
 dri2_drm_authenticate(_EGLDisplay *disp, uint32_t id)
 {
@@ -45,57 +89,58 @@ EGLBoolean
 dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
 {
    struct dri2_egl_display *dri2_dpy;
+   struct gbm_device *gbm;
    int i;
 
    dri2_dpy = malloc(sizeof *dri2_dpy);
    if (!dri2_dpy)
       return _eglError(EGL_BAD_ALLOC, "eglInitialize");
-   
+
    memset(dri2_dpy, 0, sizeof *dri2_dpy);
 
    disp->DriverData = (void *) dri2_dpy;
-   dri2_dpy->fd = (int) (intptr_t) disp->PlatformDisplay;
 
-   dri2_dpy->driver_name = dri2_get_driver_for_fd(dri2_dpy->fd);
-   if (dri2_dpy->driver_name == NULL)
-      return _eglError(EGL_BAD_ALLOC, "DRI2: failed to get driver name");
+   gbm = (struct gbm_device *) disp->PlatformDisplay;
+   if (strcmp(gbm_device_get_backend_name(gbm), "drm") != 0) {
+      free(dri2_dpy);
+      return EGL_FALSE;
+   }
 
-   dri2_dpy->device_name = dri2_get_device_name_for_fd(dri2_dpy->fd);
-   if (dri2_dpy->device_name == NULL) {
-      _eglError(EGL_BAD_ALLOC, "DRI2: failed to get device name");
-      goto cleanup_driver_name;
+   dri2_dpy->gbm_dri = gbm_dri_device(gbm);
+   if (dri2_dpy->gbm_dri->base.type != GBM_DRM_DRIVER_TYPE_DRI) {
+      free(dri2_dpy);
+      return EGL_FALSE;
    }
 
-   if (!dri2_load_driver(disp))
-      goto cleanup_device_name;
+   dri2_dpy->fd = gbm_device_get_fd(gbm);
+   dri2_dpy->device_name = dri2_get_device_name_for_fd(dri2_dpy->fd);
+   dri2_dpy->driver_name = dri2_dpy->gbm_dri->base.driver_name;
+
+   dri2_dpy->dri_screen = dri2_dpy->gbm_dri->screen;
+   dri2_dpy->core = dri2_dpy->gbm_dri->core;
+   dri2_dpy->dri2 = dri2_dpy->gbm_dri->dri2;
+   dri2_dpy->image = dri2_dpy->gbm_dri->image;
+   dri2_dpy->driver_configs = dri2_dpy->gbm_dri->driver_configs;
 
-   dri2_dpy->extensions[0] = &image_lookup_extension.base;
-   dri2_dpy->extensions[1] = &use_invalidate.base;
-   dri2_dpy->extensions[2] = NULL;
+   dri2_dpy->gbm_dri->lookup_image = dri2_lookup_egl_image;
+   dri2_dpy->gbm_dri->lookup_user_data = disp;
 
-   if (!dri2_create_screen(disp))
-      goto cleanup_driver;
+   dri2_setup_screen(disp);
 
    for (i = 0; dri2_dpy->driver_configs[i]; i++)
-      dri2_add_config(disp, dri2_dpy->driver_configs[i], i + 1, 0, 0, NULL);
+      dri2_add_config(disp, dri2_dpy->driver_configs[i],
+                      i + 1, 0, 0, NULL);
+
+   drv->API.CreateImageKHR = dri2_drm_create_image_khr;
 
 #ifdef HAVE_WAYLAND_PLATFORM
    disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
 #endif
    dri2_dpy->authenticate = dri2_drm_authenticate;
-   
+
    /* we're supporting EGL 1.4 */
    disp->VersionMajor = 1;
    disp->VersionMinor = 4;
 
    return EGL_TRUE;
-
- cleanup_driver:
-   dlclose(dri2_dpy->driver);
- cleanup_device_name:
-   free(dri2_dpy->device_name);
- cleanup_driver_name:
-   free(dri2_dpy->driver_name);
-
-   return EGL_FALSE;
 }
index e786780d3fb962d9a40efa0adce6ae7dc5dd6c04..c4fa126951bca89f44e080e34d3dcf0db20e5804 100644 (file)
@@ -59,6 +59,29 @@ force_roundtrip(struct wl_display *display)
       wl_display_iterate(display, WL_DISPLAY_READABLE);
 }
 
+static void
+wl_buffer_release(void *data, struct wl_buffer *buffer)
+{
+   struct dri2_egl_surface *dri2_surf = data;
+   int i;
+
+   for (i = 0; i < WL_BUFFER_COUNT; ++i)
+      if (dri2_surf->wl_drm_buffer[i] == buffer)
+         break;
+
+   assert(i <= WL_BUFFER_COUNT);
+
+   /* not found? */
+   if (i == WL_BUFFER_COUNT)
+      return;
+
+   dri2_surf->wl_buffer_lock[i] = 0;
+
+}
+
+static struct wl_buffer_listener wl_buffer_listener = {
+   wl_buffer_release
+};
 
 /**
  * Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
@@ -85,13 +108,16 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
    if (!_eglInitSurface(&dri2_surf->base, disp, type, conf, attrib_list))
       goto cleanup_surf;
 
-   for (i = 0; i < WL_BUFFER_COUNT; ++i)
+   for (i = 0; i < WL_BUFFER_COUNT; ++i) {
       dri2_surf->wl_drm_buffer[i] = NULL;
+      dri2_surf->wl_buffer_lock[i] = 0;
+   }
 
    for (i = 0; i < __DRI_BUFFER_COUNT; ++i)
       dri2_surf->dri_buffers[i] = NULL;
 
    dri2_surf->pending_buffer = NULL;
+   dri2_surf->third_buffer = NULL;
    dri2_surf->block_swap_buffers = EGL_FALSE;
 
    switch (type) {
@@ -187,6 +213,11 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
          dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
                                        dri2_surf->dri_buffers[i]);
 
+   if (dri2_surf->third_buffer) {
+      dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
+                                    dri2_surf->third_buffer);
+   }
+
    free(surf);
 
    return EGL_TRUE;
@@ -215,10 +246,14 @@ wayland_create_buffer(struct dri2_egl_surface *dri2_surf,
 {
    struct dri2_egl_display *dri2_dpy =
       dri2_egl_display(dri2_surf->base.Resource.Display);
+   struct wl_buffer *buf;
 
-   return wl_drm_create_buffer(dri2_dpy->wl_drm, buffer->name,
-                               dri2_surf->base.Width, dri2_surf->base.Height,
-                               buffer->pitch, visual);
+   buf = wl_drm_create_buffer(dri2_dpy->wl_drm, buffer->name,
+                              dri2_surf->base.Width, dri2_surf->base.Height,
+                              buffer->pitch, visual);
+   wl_buffer_add_listener(buf, &wl_buffer_listener, dri2_surf);
+
+   return buf;
 }
 
 static void
@@ -232,6 +267,8 @@ dri2_process_back_buffer(struct dri2_egl_surface *dri2_surf, unsigned format)
    switch (dri2_surf->type) {
    case DRI2_WINDOW_SURFACE:
       /* allocate a front buffer for our double-buffered window*/
+      if (dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] != NULL)
+         break;
       dri2_surf->dri_buffers[__DRI_BUFFER_FRONT_LEFT] = 
          dri2_dpy->dri2->allocateBuffer(dri2_dpy->dri_screen,
                __DRI_BUFFER_FRONT_LEFT, format,
@@ -289,6 +326,12 @@ dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
       dri2_egl_display(dri2_surf->base.Resource.Display);
    int i;
 
+   if (dri2_surf->third_buffer) {
+      dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
+                                    dri2_surf->third_buffer);
+      dri2_surf->third_buffer = NULL;
+   }
+
    for (i = 0; i < __DRI_BUFFER_COUNT; ++i) {
       if (dri2_surf->dri_buffers[i]) {
          switch (i) {
@@ -309,6 +352,76 @@ dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
    }
 }
 
+static inline void
+pointer_swap(const void **p1, const void **p2)
+{
+   const void *tmp = *p1;
+   *p1 = *p2;
+   *p2 = tmp;
+}
+
+static void
+destroy_third_buffer(struct dri2_egl_surface *dri2_surf)
+{
+   struct dri2_egl_display *dri2_dpy =
+      dri2_egl_display(dri2_surf->base.Resource.Display);
+
+   if (dri2_surf->third_buffer == NULL)
+      return;
+
+   dri2_dpy->dri2->releaseBuffer(dri2_dpy->dri_screen,
+                                 dri2_surf->third_buffer);
+   dri2_surf->third_buffer = NULL;
+
+   if (dri2_surf->wl_drm_buffer[WL_BUFFER_THIRD])
+      wl_buffer_destroy(dri2_surf->wl_drm_buffer[WL_BUFFER_THIRD]);
+   dri2_surf->wl_drm_buffer[WL_BUFFER_THIRD] = NULL;
+   dri2_surf->wl_buffer_lock[WL_BUFFER_THIRD] = 0;
+}
+
+static void
+swap_wl_buffers(struct dri2_egl_surface *dri2_surf,
+                enum wayland_buffer_type a, enum wayland_buffer_type b)
+{
+   int tmp;
+
+   tmp = dri2_surf->wl_buffer_lock[a];
+   dri2_surf->wl_buffer_lock[a] = dri2_surf->wl_buffer_lock[b];
+   dri2_surf->wl_buffer_lock[b] = tmp;
+      
+   pointer_swap((const void **) &dri2_surf->wl_drm_buffer[a],
+                (const void **) &dri2_surf->wl_drm_buffer[b]);
+}
+
+static void
+swap_back_and_third(struct dri2_egl_surface *dri2_surf)
+{
+   if (dri2_surf->wl_buffer_lock[WL_BUFFER_THIRD])
+      destroy_third_buffer(dri2_surf);
+
+   pointer_swap((const void **) &dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT],
+                (const void **) &dri2_surf->third_buffer);
+
+   swap_wl_buffers(dri2_surf, WL_BUFFER_BACK, WL_BUFFER_THIRD);
+}
+
+static void
+dri2_prior_buffer_creation(struct dri2_egl_surface *dri2_surf,
+                           unsigned int type)
+{
+   switch (type) {
+   case __DRI_BUFFER_BACK_LEFT:
+         if (dri2_surf->wl_buffer_lock[WL_BUFFER_BACK])
+            swap_back_and_third(dri2_surf);
+         else if (dri2_surf->third_buffer)
+            destroy_third_buffer(dri2_surf);
+         break;
+   default:
+         break;
+
+   }
+}
+
 static __DRIbuffer *
 dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
                             int *width, int *height,
@@ -335,6 +448,7 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
          if (dri2_surf->wl_drm_buffer[i])
             wl_buffer_destroy(dri2_surf->wl_drm_buffer[i]);
          dri2_surf->wl_drm_buffer[i]  = NULL;
+         dri2_surf->wl_buffer_lock[i] = 0;
       }
    }
 
@@ -343,6 +457,8 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
       assert(attachments[i] < __DRI_BUFFER_COUNT);
       assert(dri2_surf->buffer_count < 5);
 
+      dri2_prior_buffer_creation(dri2_surf, attachments[i]);
+
       if (dri2_surf->dri_buffers[attachments[i]] == NULL) {
 
          dri2_surf->dri_buffers[attachments[i]] =
@@ -443,14 +559,6 @@ wayland_frame_callback(struct wl_surface *surface, void *data, uint32_t time)
    dri2_surf->block_swap_buffers = EGL_FALSE;
 }
 
-static inline void
-pointer_swap(const void **p1, const void **p2)
-{
-   const void *tmp = *p1;
-   *p1 = *p2;
-   *p2 = tmp;
-}
-
 /**
  * Called via eglSwapBuffers(), drv->API.SwapBuffers().
  */
@@ -466,8 +574,8 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
 
    dri2_surf->block_swap_buffers = EGL_TRUE;
    wl_display_frame_callback(dri2_dpy->wl_dpy,
-                            dri2_surf->wl_win->surface,
-                            wayland_frame_callback, dri2_surf);
+                             dri2_surf->wl_win->surface,
+                             wayland_frame_callback, dri2_surf);
 
    if (dri2_surf->type == DRI2_WINDOW_SURFACE) {
       pointer_swap(
@@ -479,8 +587,7 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
       dri2_surf->dri_buffers[__DRI_BUFFER_BACK_LEFT]->attachment = 
         __DRI_BUFFER_BACK_LEFT;
 
-      pointer_swap((const void **) &dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT],
-                  (const void **) &dri2_surf->wl_drm_buffer[WL_BUFFER_BACK]);
+      swap_wl_buffers(dri2_surf, WL_BUFFER_FRONT, WL_BUFFER_BACK);
 
       if (!dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT])
         dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT] =
@@ -493,6 +600,7 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
       wl_surface_attach(dri2_surf->wl_win->surface,
            dri2_surf->wl_drm_buffer[WL_BUFFER_FRONT],
            dri2_surf->dx, dri2_surf->dy);
+      dri2_surf->wl_buffer_lock[WL_BUFFER_FRONT] = 1;
 
       dri2_surf->wl_win->attached_width  = dri2_surf->base.Width;
       dri2_surf->wl_win->attached_height = dri2_surf->base.Height;
@@ -720,7 +828,8 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
       
    dri2_dpy->extensions[0] = &dri2_dpy->dri2_loader_extension.base;
    dri2_dpy->extensions[1] = &image_lookup_extension.base;
-   dri2_dpy->extensions[2] = NULL;
+   dri2_dpy->extensions[2] = &use_invalidate.base;
+   dri2_dpy->extensions[3] = NULL;
 
    if (!dri2_create_screen(disp))
       goto cleanup_driver;
index 8bff294c9e67ab05f4c8f099ecee0c279e1b6a79..4e00c958cbdf727e88fc2095608067efe418c778 100644 (file)
@@ -479,10 +479,19 @@ dri2_connect(struct dri2_egl_display *dri2_dpy)
    xcb_generic_error_t *error;
    xcb_screen_iterator_t s;
    char *driver_name, *device_name;
+   const xcb_query_extension_reply_t *extension;
 
    xcb_prefetch_extension_data (dri2_dpy->conn, &xcb_xfixes_id);
    xcb_prefetch_extension_data (dri2_dpy->conn, &xcb_dri2_id);
 
+   extension = xcb_get_extension_data(dri2_dpy->conn, &xcb_xfixes_id);
+   if (!(extension && extension->present))
+      return EGL_FALSE;
+
+   extension = xcb_get_extension_data(dri2_dpy->conn, &xcb_dri2_id);
+   if (!(extension && extension->present))
+      return EGL_FALSE;
+
    xfixes_query_cookie = xcb_xfixes_query_version(dri2_dpy->conn,
                                                  XCB_XFIXES_MAJOR_VERSION,
                                                  XCB_XFIXES_MINOR_VERSION);
index c3c11c7b6eb1531ba59056e0b102fd0605254009..7cf8f4d55143c7f1a68f9fa40863c45bf4249b65 100644 (file)
@@ -1,8 +1,10 @@
 /**************************************************************************
- * 
+ *
  * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
  * All Rights Reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the
  * "Software"), to deal in the Software without restriction, including
  * distribute, sub license, and/or sell copies of the Software, and to
  * permit persons to whom the Software is furnished to do so, subject to
  * the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice (including the
  * next paragraph) shall be included in all copies or substantial portions
  * of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- * 
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
  **************************************************************************/
 
 
index 6c4a392760ffad605cecd6b18f92c85f86433b60..775fbbe178b670a4f9cc8e86a50d9ac8a4dbd118 100644 (file)
@@ -61,9 +61,13 @@ LOCAL_LIBS += $(TOP)/src/egl/drivers/dri2/libegl_dri2.a
 ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
 EGL_LIB_DEPS += $(XCB_DRI2_LIBS)
 endif
+ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
+EGL_LIB_DEPS += -lgbm
+endif
 EGL_LIB_DEPS += $(LIBUDEV_LIBS) $(DLOPEN_LIBS) $(LIBDRM_LIB) $(WAYLAND_LIBS)
 endif
 
+
 ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
 LOCAL_LIBS += $(TOP)/src/egl/wayland/wayland-drm/libwayland-drm.a
 endif
index bdfdcb3817d42b339f54c92726cc9540888d0778..0ba7794e2c920d8f5142eed918ff1ff0270eba1b 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 /**
  * Public EGL API entrypoints
  *
index c9913f10a10e79934484083e3b7590fc24a75943..4fcbe40cd4c8961f0d526fd1245ea45c7066cdd3 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #ifndef EGLAPI_INCLUDED
 #define EGLAPI_INCLUDED
 
index fe2f1a7f32fcd4988896d1dbf62b5f451f3d013d..3ccc8a649f0e545bacb53ddbe4f5b63eb9c98401 100644 (file)
@@ -1,3 +1,31 @@
+/**************************************************************************
+ *
+ * Copyright 2010 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #include <stdlib.h>
 #include <string.h>
 
index a88189a62524e921e0020ed4a36c8d66baf33aaa..d07f301f242347400b1c9292e1465e56b68a4b7e 100644 (file)
@@ -1,3 +1,31 @@
+/**************************************************************************
+ *
+ * Copyright 2010 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #ifndef EGLARRAY_INCLUDED
 #define EGLARRAY_INCLUDED
 
index 90c75e84b29ef23167a39377372f83ee6b38ce57..1bc8cc89fa49b6f9a26fb146a1d6b28272b84b94 100644 (file)
@@ -1,3 +1,32 @@
+/**************************************************************************
+ *
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #ifndef EGLCOMPILER_INCLUDED
 #define EGLCOMPILER_INCLUDED
 
index 5b377b7f610d68be9a70654414a178079a47cb44..483d9807cf09537f20577b25ef4e6ca28ff48585 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 /**
  * EGL Configuration (pixel format) functions.
  */
@@ -305,6 +335,7 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching)
             break;
          default:
             assert(0);
+            mask = 0;
             break;
          }
          if (val & ~mask)
@@ -456,8 +487,6 @@ _eglIsConfigAttribValid(_EGLConfig *conf, EGLint attr)
       return EGL_FALSE;
 
    switch (attr) {
-   case EGL_MATCH_NATIVE_PIXMAP:
-      return EGL_FALSE;
    case EGL_Y_INVERTED_NOK:
       return conf->Display->Extensions.NOK_texture_from_pixmap;
    default:
@@ -634,7 +663,7 @@ void _eglSwapConfigs(const _EGLConfig **conf1, const _EGLConfig **conf2)
  * qsort() in that the compare function accepts an additional
  * argument.
  */
-void
+static void
 _eglSortConfigs(const _EGLConfig **configs, EGLint count,
                 EGLint (*compare)(const _EGLConfig *, const _EGLConfig *,
                                   void *),
@@ -672,34 +701,27 @@ _eglSortConfigs(const _EGLConfig **configs, EGLint count,
 }
 
 
-static int
-_eglFallbackCompare(const _EGLConfig *conf1, const _EGLConfig *conf2,
-                   void *priv_data)
-{
-   const _EGLConfig *criteria = (const _EGLConfig *) priv_data;
-   return _eglCompareConfigs(conf1, conf2, criteria, EGL_TRUE);
-}
-
-
 /**
- * Typical fallback routine for eglChooseConfig
+ * A helper function for implementing eglChooseConfig.  See _eglFilterArray and
+ * _eglSortConfigs for the meanings of match and compare.
  */
 EGLBoolean
-_eglChooseConfig(_EGLDriver *drv, _EGLDisplay *disp, const EGLint *attrib_list,
-                 EGLConfig *configs, EGLint config_size, EGLint *num_configs)
+_eglFilterConfigArray(_EGLArray *array, EGLConfig *configs,
+                      EGLint config_size, EGLint *num_configs,
+                      EGLBoolean (*match)(const _EGLConfig *, void *),
+                      EGLint (*compare)(const _EGLConfig *, const _EGLConfig *,
+                                        void *),
+                      void *priv_data)
 {
-   _EGLConfig **configList, criteria;
+   _EGLConfig **configList;
    EGLint i, count;
 
    if (!num_configs)
       return _eglError(EGL_BAD_PARAMETER, "eglChooseConfigs");
 
-   if (!_eglParseConfigAttribList(&criteria, disp, attrib_list))
-      return _eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
-
    /* get the number of matched configs */
-   count = _eglFilterArray(disp->Configs, NULL, 0,
-         (_EGLArrayForEach) _eglMatchConfig, (void *) &criteria);
+   count = _eglFilterArray(array, NULL, 0,
+         (_EGLArrayForEach) match, priv_data);
    if (!count) {
       *num_configs = count;
       return EGL_TRUE;
@@ -710,13 +732,13 @@ _eglChooseConfig(_EGLDriver *drv, _EGLDisplay *disp, const EGLint *attrib_list,
       return _eglError(EGL_BAD_ALLOC, "eglChooseConfig(out of memory)");
 
    /* get the matched configs */
-   _eglFilterArray(disp->Configs, (void **) configList, count,
-         (_EGLArrayForEach) _eglMatchConfig, (void *) &criteria);
+   _eglFilterArray(array, (void **) configList, count,
+         (_EGLArrayForEach) match, priv_data);
 
    /* perform sorting of configs */
    if (configs && count) {
       _eglSortConfigs((const _EGLConfig **) configList, count,
-                      _eglFallbackCompare, (void *) &criteria);
+                      compare, priv_data);
       count = MIN2(count, config_size);
       for (i = 0; i < count; i++)
          configs[i] = _eglGetConfigHandle(configList[i]);
@@ -730,6 +752,41 @@ _eglChooseConfig(_EGLDriver *drv, _EGLDisplay *disp, const EGLint *attrib_list,
 }
 
 
+static EGLBoolean
+_eglFallbackMatch(const _EGLConfig *conf, void *priv_data)
+{
+   return _eglMatchConfig(conf, (const _EGLConfig *) priv_data);
+}
+
+
+static EGLint
+_eglFallbackCompare(const _EGLConfig *conf1, const _EGLConfig *conf2,
+                    void *priv_data)
+{
+   return _eglCompareConfigs(conf1, conf2,
+         (const _EGLConfig *) priv_data, EGL_TRUE);
+}
+
+
+/**
+ * Typical fallback routine for eglChooseConfig
+ */
+EGLBoolean
+_eglChooseConfig(_EGLDriver *drv, _EGLDisplay *disp, const EGLint *attrib_list,
+                 EGLConfig *configs, EGLint config_size, EGLint *num_configs)
+{
+   _EGLConfig criteria;
+
+   if (!_eglParseConfigAttribList(&criteria, disp, attrib_list))
+      return _eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
+
+   return _eglFilterConfigArray(disp->Configs,
+         configs, config_size, num_configs,
+         _eglFallbackMatch, _eglFallbackCompare,
+         (void *) &criteria);
+}
+
+
 /**
  * Fallback for eglGetConfigAttrib.
  */
@@ -739,6 +796,16 @@ _eglGetConfigAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf,
 {
    if (!_eglIsConfigAttribValid(conf, attribute))
       return _eglError(EGL_BAD_ATTRIBUTE, "eglGetConfigAttrib");
+
+   /* nonqueryable attributes */
+   switch (attribute) {
+   case EGL_MATCH_NATIVE_PIXMAP:
+      return _eglError(EGL_BAD_ATTRIBUTE, "eglGetConfigAttrib");
+      break;
+   default:
+      break;
+   }
+
    if (!value)
       return _eglError(EGL_BAD_PARAMETER, "eglGetConfigAttrib");
 
index 2169960fd1df478849ed92ed6e64066189fc64d2..adab95cd6a3a14c3001ab834600b4f005a193144 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #ifndef EGLCONFIG_INCLUDED
 #define EGLCONFIG_INCLUDED
 
@@ -172,11 +202,13 @@ _eglCompareConfigs(const _EGLConfig *conf1, const _EGLConfig *conf2,
                    const _EGLConfig *criteria, EGLBoolean compare_id);
 
 
-PUBLIC void
-_eglSortConfigs(const _EGLConfig **configs, EGLint count,
-                EGLint (*compare)(const _EGLConfig *, const _EGLConfig *,
-                                  void *),
-                void *priv_data);
+PUBLIC EGLBoolean
+_eglFilterConfigArray(_EGLArray *array, EGLConfig *configs,
+                      EGLint config_size, EGLint *num_configs,
+                      EGLBoolean (*match)(const _EGLConfig *, void *),
+                      EGLint (*compare)(const _EGLConfig *, const _EGLConfig *,
+                                        void *),
+                      void *filter_data);
 
 
 extern EGLBoolean
index 33dcfa68756b770555ae169e2ca97a262e5af5e8..38e195f0446444175edcfd357fc47284ef1b394b 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #include <assert.h>
 #include <stdlib.h>
 #include <string.h>
index 8cd0df173135bd69079541114619bf5dc13ad021..0ac846219a7b2e41a1fc9b1c2e092baaa3dca610 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #ifndef EGLCONTEXT_INCLUDED
 #define EGLCONTEXT_INCLUDED
 
index 4221a9be3e1307d95027b040e12f154b686e4dff..54fc4f742e507bf5c6285f8591fbfb60e2c35a8c 100644 (file)
@@ -1,3 +1,31 @@
+/**************************************************************************
+ *
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #include <stdlib.h>
 #include <string.h>
 #include "egllog.h"
index e5c94ce60ab8723a68c68ae7d8b76bd90c22b4cf..a64821eb125f3f03e5c50dcd29b924a210773c67 100644 (file)
@@ -1,3 +1,31 @@
+/**************************************************************************
+ *
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #ifndef EGLCURRENT_INCLUDED
 #define EGLCURRENT_INCLUDED
 
index 4ecd4c1420c060e1fe08cb7c9e0f9b60ccf3e1c9..d468d7b76cc637b86dff97ea01e519024170848d 100644 (file)
@@ -1,8 +1,8 @@
 /**************************************************************************
- * 
+ *
  * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
  * All Rights Reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the
  * "Software"), to deal in the Software without restriction, including
  * distribute, sub license, and/or sell copies of the Software, and to
  * permit persons to whom the Software is furnished to do so, subject to
  * the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice (including the
  * next paragraph) shall be included in all copies or substantial portions
  * of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- * 
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
  **************************************************************************/
 
 
-
 /**
  * Internal EGL defines
  */
index 305929472975b25de2abb6e766a73a6245e2388b..60f317772728e86b5e80f6d38a6d4c659276b9cc 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 /**
  * Functions related to EGLDisplay.
  */
index 97ae2b01ba01b2ebe9112909b67de1773aa47f41..9cd4dbfcc8a229e336f6075e96e9113610bd39ad 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #ifndef EGLDISPLAY_INCLUDED
 #define EGLDISPLAY_INCLUDED
 
index b75e8b6a2cb32e145c85c337677c7ed59385965e..ffdd146284640df3cf080855e58d210f69fb2748 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 /**
  * Functions for choosing and opening/loading device drivers.
  */
index 3cde102d12d0392c836f7b2078606c5fa2ce7334..4bb9612765bb7f910a2644c144d743664e89f8eb 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #ifndef EGLDRIVER_INCLUDED
 #define EGLDRIVER_INCLUDED
 
index 7c93adb76aa0ac5cb1758e57ea1fe4fd934e77a1..b4f35d742aee77c538edaa410e0f9eccd92da849 100644 (file)
@@ -1,3 +1,31 @@
+/**************************************************************************
+ *
+ * Copyright 2010 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #include <string.h>
 #include "egltypedefs.h"
 #include "egldriver.h"
index 52eebb07f6c4e3959c45929f659fcabe079ef613..f53f078d7109828cc2aa207b8ebdb3a006d37050 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #include <stdlib.h>
 #include <assert.h>
 #include "eglglobals.h"
index c3771a8ef10bebe7feb55968d39aeaf185a4de22..b40e30e22515f2f18480e7f23618cf5ba4e5a400 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #ifndef EGLGLOBALS_INCLUDED
 #define EGLGLOBALS_INCLUDED
 
index 6d4ee4e08b92bb4e9dfff30469b6b905f2341494..458a2e424d305c5777f0977a28678368980ccb8b 100644 (file)
@@ -1,3 +1,32 @@
+/**************************************************************************
+ *
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #include <assert.h>
 #include <string.h>
 
index adb939a9e02332944f8601d9a232d70fdc333217..acb36aaeb18892698c26188f0976205ea242310a 100644 (file)
@@ -1,3 +1,32 @@
+/**************************************************************************
+ *
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #ifndef EGLIMAGE_INCLUDED
 #define EGLIMAGE_INCLUDED
 
index 12c55f901a576cc0706f797df68fc8dfa8d03e93..43eed64c2992b2897d4a2fff34590587a425ff8f 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 /**
  * Logging facility for debug/info messages.
  * _EGL_FATAL messages are printed to stderr
index 03bef2670f1ed287cf99356cfade29b76e71d02e..10a418447bdc24bc57663a619108c558272da5c2 100644 (file)
@@ -1,3 +1,32 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #ifndef EGLLOG_INCLUDED
 #define EGLLOG_INCLUDED
 
index 6bb2498eef468071f890f66531fb1081501210cd..da189b689a316534ec760b9f1197cfc3be67eb64 100644 (file)
@@ -1,8 +1,10 @@
 /**************************************************************************
- * 
+ *
  * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
  * All Rights Reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the
  * "Software"), to deal in the Software without restriction, including
  * distribute, sub license, and/or sell copies of the Software, and to
  * permit persons to whom the Software is furnished to do so, subject to
  * the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice (including the
  * next paragraph) shall be included in all copies or substantial portions
  * of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- * 
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
  **************************************************************************/
 
 
index a753307a14b79b4a311f1d81ad4bc207e3842291..da0adbd0ee2adc5f38ce5a49be896d5a825e8908 100644 (file)
@@ -1,8 +1,10 @@
 /**************************************************************************
- * 
+ *
  * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
  * All Rights Reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the
  * "Software"), to deal in the Software without restriction, including
  * distribute, sub license, and/or sell copies of the Software, and to
  * permit persons to whom the Software is furnished to do so, subject to
  * the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice (including the
  * next paragraph) shall be included in all copies or substantial portions
  * of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- * 
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
  **************************************************************************/
 
 
index a9653496c3270a5036a0b4d7932ea9d34b8adeff..617d4c2d60aca6a6aff2d968410ffdd1a9f61ba5 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #include <assert.h>
 #include <stdlib.h>
 #include <string.h>
index ed4eb2c34af429a6f56baa516615d9c70307ea0c..a423f026483c5b1d430422dc14053dfb41ed7afb 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #ifndef EGLMODE_INCLUDED
 #define EGLMODE_INCLUDED
 
index 29faba0f241fd82458e532c13b108b7c4396b46a..852e25195c4b3c8ee714e2db4d83d324a9842f84 100644 (file)
@@ -1,3 +1,31 @@
+/**************************************************************************
+ *
+ * Copyright 2009 Chia-I Wu <olvaffe@gmail.com>
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #ifndef EGLMUTEX_INCLUDED
 #define EGLMUTEX_INCLUDED
 
index 3abe85ff22f1ab0210a71429c99f824409955e2b..e21952094a224c6c477a3d6f2170eb437922a54c 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 /*
  * Ideas for screen management extension to EGL.
  *
index 2a99f23c50a24952e0c3d1b05ebd85c41e503a3b..5e2f6579e625c670c49f1396e75d51ff52879143 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #ifndef EGLSCREEN_INCLUDED
 #define EGLSCREEN_INCLUDED
 
index e4ab19136fb77d056d4155156c43e9e9c36c6a9b..e3568cb3c2071757257a1a0f7284b60627ab7f0e 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 /**
  * String utils.
  */
index d4c89541362b359b66ba41dc5bf6d319d9a59f11..d3ab435ab7f142b9abfdd2a76cd2eeeef1c24c63 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010-2011 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #ifndef EGLSTRING_INCLUDED
 #define EGLSTRING_INCLUDED
 
index cc505045e12967a19faeacf2310638cdbdd0dda6..c9cfb01388e60ff4a82fabb53a6f51c8648bdca0 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 /**
  * Surface-related functions.
  */
index ef01b32ede3d1892ed54a86d08d80757e0bc6a46..0541ff4e2f145dd1c7ec26c6d5c1e2beb465c157 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #ifndef EGLSURFACE_INCLUDED
 #define EGLSURFACE_INCLUDED
 
index 95e97c735424a0fb07b93227b86cea845e709bf5..d8e3ee0c3bfa08eaf041b2660f36e054a2362d8e 100644 (file)
@@ -1,3 +1,31 @@
+/**************************************************************************
+ *
+ * Copyright 2010 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #include <string.h>
 
 #include "eglsync.h"
index a0025237e7aaa1e499f6c8b3ec2495c9f8316bd6..1a56889642e236ba6699af7566505a28c8c70338 100644 (file)
@@ -1,3 +1,31 @@
+/**************************************************************************
+ *
+ * Copyright 2010 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #ifndef EGLSYNC_INCLUDED
 #define EGLSYNC_INCLUDED
 
index 20b67b28bc694c0ce90e8d489eeca8c08af0508f..120a277b5fb2d9b932f9de4e79a8e88637daa59c 100644 (file)
@@ -1,3 +1,33 @@
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
+ * Copyright 2010 LunarG, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
 #ifndef EGLTYPEDEFS_INCLUDED
 #define EGLTYPEDEFS_INCLUDED
 
index 6cc442b9d53043a5c69db3ba84108d44a3116ba9..3023cd02b07dd61ddeb18b2e4bfb20970ceecae0 100644 (file)
@@ -88,17 +88,17 @@ drm_create_buffer(struct wl_client *client, struct wl_drm *drm,
 {
        struct wl_drm_buffer *buffer;
 
-       buffer = malloc(sizeof *buffer);
+       buffer = calloc(1, sizeof *buffer);
        if (buffer == NULL) {
                wl_client_post_no_memory(client);
                return;
        }
 
        buffer->drm = drm;
-       buffer->buffer.compositor = NULL;
        buffer->buffer.width = width;
        buffer->buffer.height = height;
        buffer->buffer.visual = visual;
+       buffer->buffer.client = client;
 
        if (!visual || visual->object.interface != &wl_visual_interface) {
                wl_client_post_error(client, &drm->object,
index 428bc31f86b626b5d21a703a88fbad8f065c8d6f..3072ee936f2793a834f55bacec6875485cba1d2b 100644 (file)
@@ -53,7 +53,7 @@ if env['drm']:
 # Needed by some state trackers
 SConscript('winsys/sw/null/SConscript')
 
-if env['platform'] != 'embedded':
+if not env['embedded']:
     SConscript('state_trackers/vega/SConscript')
     SConscript('state_trackers/egl/SConscript')
 
@@ -66,8 +66,8 @@ if env['platform'] != 'embedded':
     if env['dri'] and env['xorg']:
         SConscript('state_trackers/xorg/SConscript')
 
-if env['platform'] == 'windows':
-    SConscript('state_trackers/wgl/SConscript')
+    if env['platform'] == 'windows':
+        SConscript('state_trackers/wgl/SConscript')
 
 #
 # Winsys
@@ -83,55 +83,55 @@ SConscript([
     'targets/graw-null/SConscript',
 ])
 
-if env['platform'] != 'embedded':
+if not env['embedded']:
     SConscript([
         'targets/egl-static/SConscript'
     ])
 
-if env['x11']:
-    SConscript([
-        'targets/graw-xlib/SConscript',
-        'targets/libgl-xlib/SConscript',
-    ])
+    if env['x11']:
+        SConscript([
+            'targets/graw-xlib/SConscript',
+            'targets/libgl-xlib/SConscript',
+        ])
 
-if env['platform'] == 'windows':
-    SConscript([
-        'targets/graw-gdi/SConscript',
-        'targets/libgl-gdi/SConscript',
-    ])
+    if env['platform'] == 'windows':
+        SConscript([
+            'targets/graw-gdi/SConscript',
+            'targets/libgl-gdi/SConscript',
+        ])
 
-if env['dri']:
-    SConscript([
-        'targets/SConscript.dri',
-        'targets/dri-swrast/SConscript',
-        'targets/dri-vmwgfx/SConscript',
-        #'targets/dri-nouveau/SConscript',
-    ])
-    if env['drm_intel']:
+    if env['dri']:
         SConscript([
-            'targets/dri-i915/SConscript',
-            'targets/dri-i965/SConscript',
+            'targets/SConscript.dri',
+            'targets/dri-swrast/SConscript',
+            'targets/dri-vmwgfx/SConscript',
+            #'targets/dri-nouveau/SConscript',
         ])
-    if env['drm_radeon']:
+        if env['drm_intel']:
+            SConscript([
+                'targets/dri-i915/SConscript',
+                'targets/dri-i965/SConscript',
+            ])
+        if env['drm_radeon']:
+            SConscript([
+                'targets/dri-r300/SConscript',
+                'targets/dri-r600/SConscript',
+            ])
+
+    if env['xorg'] and env['drm']:
         SConscript([
-            'targets/dri-r300/SConscript',
-            'targets/dri-r600/SConscript',
+            #'targets/xorg-i915/SConscript',
+            #'targets/xorg-i965/SConscript',
+            #'targets/xorg-nouveau/SConscript',
+            #'targets/xorg-radeon/SConscript',
+            'targets/xorg-vmwgfx/SConscript',
         ])
 
-if env['xorg'] and env['drm']:
-    SConscript([
-        #'targets/xorg-i915/SConscript',
-        #'targets/xorg-i965/SConscript',
-        #'targets/xorg-nouveau/SConscript',
-        #'targets/xorg-radeon/SConscript',
-        'targets/xorg-vmwgfx/SConscript',
-    ])
-
 
 #
 # Unit tests & tools
 #
 
-if env['platform'] != 'embedded':
+if not env['embedded']:
     SConscript('tests/unit/SConscript')
     SConscript('tests/graw/SConscript')
index 56c26f57ccedeb392d2d73b3ac7d08c7226eb8ba..f33c9078c9c7ded93ca8cfac2926f01c8120e6e7 100644 (file)
@@ -1163,6 +1163,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
    struct lp_build_loop_state lp_loop;
    const int max_vertices = 4;
    LLVMValueRef outputs[PIPE_MAX_SHADER_OUTPUTS][NUM_CHANNELS];
+   LLVMValueRef fetch_max;
    void *code;
    struct lp_build_sampler_soa *sampler = 0;
    LLVMValueRef ret, ret_ptr;
@@ -1234,6 +1235,10 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
       draw_llvm_variant_key_samplers(&variant->key),
       context_ptr);
 
+   fetch_max = LLVMBuildSub(builder, count,
+                            lp_build_const_int32(gallivm, 1),
+                            "fetch_max");
+
 #if DEBUG_STORE
    lp_build_printf(builder, "start = %d, end = %d, step = %d\n",
                    start, end, step);
@@ -1257,6 +1262,12 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
             builder,
             lp_loop.counter,
             lp_build_const_int32(gallivm, i), "");
+
+         /* make sure we're not out of bounds which can happen
+          * if fetch_count % 4 != 0, because on the last iteration
+          * a few of the 4 vertex fetches will be out of bounds */
+         true_index = lp_build_min(&bld, true_index, fetch_max);
+
          for (j = 0; j < draw->pt.nr_vertex_elements; ++j) {
             struct pipe_vertex_element *velem = &draw->pt.vertex_element[j];
             LLVMValueRef vb_index = lp_build_const_int32(gallivm, velem->vertex_buffer_index);
index 32af29ae1444f7dffabe509c213274a083c71601..458f85def2cb8674d18f487c084cd07350e8eab1 100644 (file)
@@ -784,6 +784,14 @@ aaline_destroy(struct draw_stage *stage)
 
    draw_free_temp_verts( stage );
 
+   /* restore the old entry points */
+   pipe->create_fs_state = aaline->driver_create_fs_state;
+   pipe->bind_fs_state = aaline->driver_bind_fs_state;
+   pipe->delete_fs_state = aaline->driver_delete_fs_state;
+
+   pipe->bind_fragment_sampler_states = aaline->driver_bind_sampler_states;
+   pipe->set_fragment_sampler_views = aaline->driver_set_sampler_views;
+
    FREE( stage );
 }
 
index 60f6380c503c795dae612fec0af74e0e1c449393..9265c379de88622be55dd30aba16a4607b998c2c 100644 (file)
@@ -768,7 +768,16 @@ aapoint_reset_stipple_counter(struct draw_stage *stage)
 static void
 aapoint_destroy(struct draw_stage *stage)
 {
+   struct aapoint_stage* aapoint = aapoint_stage(stage);
+   struct pipe_context *pipe = stage->draw->pipe;
+
    draw_free_temp_verts( stage );
+
+   /* restore the old entry points */
+   pipe->create_fs_state = aapoint->driver_create_fs_state;
+   pipe->bind_fs_state = aapoint->driver_bind_fs_state;
+   pipe->delete_fs_state = aapoint->driver_delete_fs_state;
+
    FREE( stage );
 }
 
index 0b724a34948768be5ccb406b8c0375a5c098d3ea..01e660ef7d9bcc91944b0c42b5d6642067245ff8 100644 (file)
@@ -207,7 +207,11 @@ lp_disassemble(const void* func)
    }
 
    raw_debug_ostream Out;
+#if HAVE_LLVM >= 0x0300
+   TargetMachine *TM = T->createTargetMachine(Triple, sys::getHostCPUName(), "");
+#else
    TargetMachine *TM = T->createTargetMachine(Triple, "");
+#endif
 
 #if HAVE_LLVM >= 0x0300
    unsigned int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
@@ -287,7 +291,11 @@ lp_disassemble(const void* func)
 
       pc += Size;
 
+#if HAVE_LLVM >= 0x0300
+      const MCInstrDesc &TID = TII->get(Inst.getOpcode());
+#else
       const TargetInstrDesc &TID = TII->get(Inst.getOpcode());
+#endif
 
       /*
        * Keep track of forward jumps to a nearby address.
index d2d7eccd92fc845e7d9b7d61f2b6acb76f64ccaf..85fabc574b22be88ce0303ef860e6e94e7997724 100644 (file)
@@ -83,8 +83,12 @@ lp_set_target_options(void)
     * to only assume a 4 bytes alignment for backwards compatibility.
     */
 #if defined(PIPE_ARCH_X86)
+#if HAVE_LLVM >= 0x0300
+   llvm::StackAlignmentOverride = 4;
+#else
    llvm::StackAlignment = 4;
 #endif
+#endif
 
 #if defined(DEBUG) || defined(PROFILE)
    llvm::NoFramePointerElim = true;
index 36896ce605de62ceecc14be50d78c1dfd88892e2..085c47a114ac87eef4e668c187b1aac81d381633 100644 (file)
@@ -167,8 +167,8 @@ def trifan(intype, outtype):
 
 def polygon(intype, outtype):
     preamble(intype, outtype, prim='polygon')
-    print '  for (j = i = 0; j < nr; j+=6, i++) { '
-    do_tri( intype, outtype, 'out+j',  '0', 'i+1', 'i+2' );
+    print '  for (j = i = 0; j < nr; j+=2, i++) { '
+    line( intype, outtype, 'out+j', 'i', '(i+1)%(nr/2)' )
     print '   }'
     postamble()
 
index 26c5d4d4c72cad1fc664658973dab87a7f2a4563..c353717d65644b7ff5f94b266cd32124e8b6e7d8 100644 (file)
@@ -71,6 +71,11 @@ static void generate_linear_uint( unsigned nr,
 }
 
 
+/**
+ * Given a primitive type and number of vertices, return the number of vertices
+ * needed to draw the primitive with fill mode = PIPE_POLYGON_MODE_LINE using
+ * separate lines (PIPE_PRIM_LINES).
+ */
 static unsigned nr_lines( unsigned prim,
                           unsigned nr )
 {
@@ -86,7 +91,7 @@ static unsigned nr_lines( unsigned prim,
    case PIPE_PRIM_QUAD_STRIP:
       return (nr - 2) / 2 * 8;
    case PIPE_PRIM_POLYGON:
-      return (nr - 2) * 6;
+      return 2 * nr; /* a line (two verts) for each polygon edge */
    default:
       assert(0);
       return 0;
index 556662d35e1f88161a383bc0d8ff6613d1d38b90..91a84a24bc80ea1d727d58e8afa4e6bfb8c26e7f 100644 (file)
@@ -39,7 +39,7 @@
 #include "pipe/p_compiler.h"
 
 
-#if defined(PIPE_OS_EMBEDDED)
+#if defined(PIPE_SUBSYSTEM_EMBEDDED)
 
 #ifdef __cplusplus
 extern "C" {
index d59f9819feca69f144610a07cc0c7225232b14d3..48522dac4d72795c903012945ae68d198b67bbed 100644 (file)
@@ -58,8 +58,6 @@ extern "C" {
 #  define os_break()  __debugbreak()
 #elif defined(PIPE_OS_UNIX)
 #  define os_break() kill(getpid(), SIGTRAP)
-#elif defined(PIPE_OS_EMBEDDED)
-void os_break(void);
 #else
 #  define os_break() abort(