aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libX11/src/UIThrStubs.c4
-rw-r--r--libX11/src/Xxcbint.h95
-rw-r--r--mesalib/configs/autoconf.in8
-rw-r--r--mesalib/configs/default13
-rw-r--r--mesalib/configure.ac22
-rw-r--r--mesalib/docs/vmware-guest.html197
-rw-r--r--mesalib/src/mapi/Android.mk75
-rw-r--r--mesalib/src/mesa/drivers/common/meta.c7
-rw-r--r--mesalib/src/mesa/drivers/dri/Makefile.am31
-rw-r--r--mesalib/src/mesa/drivers/dri/swrast/Makefile.am58
-rw-r--r--mesalib/src/mesa/drivers/dri/swrast/Makefile.sources11
-rw-r--r--mesalib/src/mesa/swrast/s_stencil.c6
-rw-r--r--xorg-server/dix/getevents.c17
-rw-r--r--xorg-server/dix/grabs.c3
-rw-r--r--xorg-server/include/inputstr.h2
15 files changed, 454 insertions, 95 deletions
diff --git a/libX11/src/UIThrStubs.c b/libX11/src/UIThrStubs.c
index a3bcdfc41..95873e88f 100644
--- a/libX11/src/UIThrStubs.c
+++ b/libX11/src/UIThrStubs.c
@@ -81,9 +81,7 @@ typedef thread_t xthread_t;
#pragma weak cond_broadcast = _Xthr_zero_stub_
#else /* !SVR4 */
#ifdef WIN32
- /*
- * Don't know what to do here. Is there something do be done at all?
- */
+#include <X11/Xthreads.h>
#else /* !WIN32 */
#ifdef USE_TIS_SUPPORT
#include <tis.h>
diff --git a/libX11/src/Xxcbint.h b/libX11/src/Xxcbint.h
index 15423c407..a8c9a670b 100644
--- a/libX11/src/Xxcbint.h
+++ b/libX11/src/Xxcbint.h
@@ -1,46 +1,49 @@
-/* Copyright (C) 2003-2006 Jamey Sharp, Josh Triplett
- * This file is licensed under the MIT license. See the file COPYING. */
-
-#ifndef XXCBINT_H
-#define XXCBINT_H
-
-#include <assert.h>
-#include <stdint.h>
-#include <X11/Xlibint.h>
-#include <X11/Xlib-xcb.h>
-#include "locking.h"
-
-#define XLIB_SEQUENCE_COMPARE(a,op,b) (((long) (a) - (long) (b)) op 0)
-
-typedef struct PendingRequest PendingRequest;
-struct PendingRequest {
- PendingRequest *next;
- unsigned long sequence;
- unsigned reply_waiter;
-};
-
-typedef struct _X11XCBPrivate {
- xcb_connection_t *connection;
- PendingRequest *pending_requests;
- PendingRequest *pending_requests_tail;
- xcb_generic_event_t *next_event;
- char *real_bufmax;
- char *reply_data;
- int reply_length;
- int reply_consumed;
- uint64_t last_flushed;
- enum XEventQueueOwner event_owner;
- XID next_xid;
-
- /* handle simultaneous threads waiting for responses */
- xcondition_t event_notify;
- int event_waiter;
- xcondition_t reply_notify;
-} _X11XCBPrivate;
-
-/* xcb_disp.c */
-
-int _XConnectXCB(Display *dpy, _Xconst char *display, int *screenp);
-void _XFreeX11XCBStructure(Display *dpy);
-
-#endif /* XXCBINT_H */
+/* Copyright (C) 2003-2006 Jamey Sharp, Josh Triplett
+ * This file is licensed under the MIT license. See the file COPYING. */
+
+#ifndef XXCBINT_H
+#define XXCBINT_H
+
+#include <assert.h>
+#include <stdint.h>
+#include <X11/Xlibint.h>
+#ifdef WIN32
+#include <X11/Xwindows.h>
+#endif
+#include <X11/Xlib-xcb.h>
+#include "locking.h"
+
+#define XLIB_SEQUENCE_COMPARE(a,op,b) (((long) (a) - (long) (b)) op 0)
+
+typedef struct PendingRequest PendingRequest;
+struct PendingRequest {
+ PendingRequest *next;
+ unsigned long sequence;
+ unsigned reply_waiter;
+};
+
+typedef struct _X11XCBPrivate {
+ xcb_connection_t *connection;
+ PendingRequest *pending_requests;
+ PendingRequest *pending_requests_tail;
+ xcb_generic_event_t *next_event;
+ char *real_bufmax;
+ char *reply_data;
+ int reply_length;
+ int reply_consumed;
+ uint64_t last_flushed;
+ enum XEventQueueOwner event_owner;
+ XID next_xid;
+
+ /* handle simultaneous threads waiting for responses */
+ xcondition_t event_notify;
+ int event_waiter;
+ xcondition_t reply_notify;
+} _X11XCBPrivate;
+
+/* xcb_disp.c */
+
+int _XConnectXCB(Display *dpy, _Xconst char *display, int *screenp);
+void _XFreeX11XCBStructure(Display *dpy);
+
+#endif /* XXCBINT_H */
diff --git a/mesalib/configs/autoconf.in b/mesalib/configs/autoconf.in
index 3e5da796f..55886ea88 100644
--- a/mesalib/configs/autoconf.in
+++ b/mesalib/configs/autoconf.in
@@ -75,7 +75,6 @@ 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,7 +87,6 @@ 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,7 +99,6 @@ 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@
@@ -109,7 +106,6 @@ 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 +143,6 @@ 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_LIB_PATH) @WAYLAND_EGL_LIB_DEPS@
-GBM_LIB_DEPS = $(EXTRA_LIB_PATH) @GBM_LIB_DEPS@
# DRI dependencies
MESA_MODULES = @MESA_MODULES@
@@ -209,9 +204,6 @@ 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@
diff --git a/mesalib/configs/default b/mesalib/configs/default
index 2ca6fe45d..7e1aceb6b 100644
--- a/mesalib/configs/default
+++ b/mesalib/configs/default
@@ -63,7 +63,6 @@ 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
@@ -76,7 +75,6 @@ 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)*
@@ -89,7 +87,6 @@ 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,9 +110,6 @@ 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
@@ -141,7 +135,6 @@ 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 libraries added in Makefiles
X11_LIBS = -lX11
@@ -160,9 +153,6 @@ 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
@@ -192,6 +182,3 @@ 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 =
diff --git a/mesalib/configure.ac b/mesalib/configure.ac
index 959956862..f68a54fe5 100644
--- a/mesalib/configure.ac
+++ b/mesalib/configure.ac
@@ -414,7 +414,6 @@ 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}'*'
@@ -426,7 +425,6 @@ 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])
@@ -437,7 +435,6 @@ 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])
@@ -448,7 +445,6 @@ 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
@@ -785,6 +781,8 @@ if test "x$enable_glx" = xno; then
enable_xlib_glx=no
fi
+AM_CONDITIONAL(HAVE_DRI, test x"$enable_dri" = xyes)
+
dnl
dnl Driver specific build directories
dnl
@@ -1060,7 +1058,7 @@ DRI_CXXFLAGS='$(CXXFLAGS)'
DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a'
MESA_MODULES='$(TOP)/src/mesa/libmesa.a'
-if test "x$enable_dri" = xyes ; then
+if test "x$enable_dri" = xyes && test "x$driglx_direct" = xyes ; then
DRICORE_GLSL_LIBS='$(TOP)/$(LIB_DIR)/libglsl.so'
DRICORE_LIBS='$(TOP)/$(LIB_DIR)/libdricore.so'
DRICORE_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -lglsl'
@@ -1231,8 +1229,10 @@ if test "x$enable_dri" = xyes; then
EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
])
AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
+ save_LIBS="$LIBS"
AC_CHECK_LIB([expat],[XML_ParserCreate],[],
[AC_MSG_ERROR([Expat required for DRI.])])
+ LIBS="$save_LIBS"
fi
# libdrm is required for all except swrast
@@ -1362,24 +1362,14 @@ if test "x$enable_gbm" = xauto; then
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"
- 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 configuration
@@ -1928,6 +1918,8 @@ CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
dnl Substitute the config
AC_CONFIG_FILES([configs/autoconf
+ src/gbm/Makefile
+ src/gbm/main/gbm.pc
src/mesa/drivers/dri/dri.pc
src/mesa/drivers/dri/Makefile
src/mesa/drivers/dri/i915/Makefile
diff --git a/mesalib/docs/vmware-guest.html b/mesalib/docs/vmware-guest.html
new file mode 100644
index 000000000..e19782ce2
--- /dev/null
+++ b/mesalib/docs/vmware-guest.html
@@ -0,0 +1,197 @@
+<html>
+
+<title>VMware guest GL driver</title>
+
+<link rel="stylesheet" type="text/css" href="mesa.css"></head>
+
+<body>
+
+
+<h1>VMware guest GL driver</h1>
+
+<p>
+This page describes how to build, install and use the VMware guest GL driver
+(aka the SVGA or SVGA3D driver) for Linux using the latest source code.
+This driver gives a Linux virtual machine access to the host's GPU for
+hardware-accelerated 3D.
+VMware Workstation running on Linux or Windows and VMware Fusion running on
+MacOS are all supported.
+</p>
+
+<p>
+End users shouldn't have to go through all these steps once the driver is
+included in newer Linux distributions.
+</p>
+
+<p>
+For more information about the X components see these wiki pages at x.org:
+</p>
+<ul>
+<li><a href="http://wiki.x.org/wiki/vmware" target="_parent">
+Driver Overview</a>
+<li><a href="http://wiki.x.org/wiki/vmware/vmware3D" target="_parent">
+xf86-video-vmware Details</a>
+</ul>
+
+
+<h2>Components</h2>
+
+The components involved in this include:
+<ul>
+<li>Linux kernel module: vmwgfx
+<li>X server 2D driver: xf86-video-vmware
+<li>User-space libdrm library
+<li>Mesa/gallium OpenGL driver: "svga"
+</ul>
+
+
+<h2>Prerequisites</h2>
+
+<ul>
+<li>Kernel version at least 2.6.25
+<li>Xserver version at least 1.7
+<li>Ubuntu: For ubuntu you need to install a number of build dependencies.
+ <pre>
+ sudo apt-get install git-core
+ sudo apt-get install automake libtool libpthread-stubs0-dev
+ sudo apt-get install xserver-xorg-dev x11proto-xinerama-dev libx11-xcb-dev
+ sudo apt-get install libxcb-glx0-dev libxrender-dev
+ sudo apt-get build-dep libgl1-mesa-dri libxcb-glx0-dev
+ </pre>
+<li>Fedora: For Fedora you also need to install a number of build dependencies.
+ <pre>
+ sudo yum install mesa-libGL-devel xorg-x11-server-devel xorg-x11-util-macros
+ sudo yum install libXrender-devel.i686
+ sudo yum install automake gcc libtool expat-devel kernel-devel git-core
+ sudo yum install makedepend flex bison
+ </pre>
+</ul>
+
+<p>
+Depending on your Linux distro, other packages may be needed.
+The configure scripts should tell you what's missing.
+</p>
+
+
+
+<h2>Getting the Latest Source Code</h2>
+
+Begin by saving your current directory location:
+ <pre>
+ export TOP=$PWD
+ </pre>
+
+<ul>
+<li>Mesa/Gallium master branch. This code is used to build libGL, and the direct rendering svga driver for libGL, vmwgfx_dri.so, and the X acceleration library libxatracker.so.x.x.x.
+ <pre>
+ git clone git://anongit.freedesktop.org/git/mesa/mesa
+ </pre>
+<li>VMware Linux guest kernel module. Note that this repo contains the complete DRM and TTM code. The vmware-specific driver is really only the files prefixed with vmwgfx.
+ <pre>
+ git clone git://anongit.freedesktop.org/git/mesa/vmwgfx
+ </pre>
+
+<li>libdrm, A user-space library that interfaces with drm. Most distros ship with this driver. Safest bet is really to replace the system one. Optionally you can point LIBDRM_CFLAGS and LIBDRM_LIBS to the libdrm-2.4.22 package in toolchain. But here, we replace:
+ <pre>
+ git clone git://anongit.freedesktop.org/git/mesa/drm
+ </pre>
+<li>xf86-video-vmware. The chainloading driver, vmware_drv.so, the legacy driver vmwlegacy_drv.so, and the vmwgfx driver vmwgfx_drv.so.
+ <pre>
+ git clone git://anongit.freedesktop.org/git/xorg/driver/xf86-video-vmware
+ </pre>
+</ul>
+
+
+<h2>Building the Code</h2>
+
+<ul>
+<li>Build libdrm: If you're on a 32-bit system, you should skip the --libdir configure option. Note also the comment about toolchain libdrm above.
+ <pre>
+ cd $TOP/drm
+ ./autogen.sh --prefix=/usr --enable-vmwgfx-experimental-api --libdir=/usr/lib64
+ make
+ sudo make install
+ </pre>
+<li>Build Mesa and the vmwgfx_dri.so driver, the vmwgfx_drv.so xorg driver, the X acceleration library libxatracker.
+The vmwgfx_dri.so is used by the OpenGL libraries during direct rendering,
+and by the Xorg server during accelerated indirect GL rendering.
+The libxatracker library is used exclusively by the X server to do render,
+copy and video acceleration:
+<br>
+The following configure options doesn't build the EGL system.
+<br>
+As before, if you're on a 32-bit system, you should skip the --libdir
+configure option.
+ <pre>
+ cd $TOP/mesa
+ ./autogen.sh --prefix=/usr --libdir=/usr/lib64 --with-gallium-drivers=svga --with-dri-drivers= --enable-xa
+ make
+ sudo make install
+ </pre>
+
+Note that you may have to install other packages that Mesa depends upon
+if they're not installed in your system. You should be told what's missing.
+<br>
+<br>
+
+<li>xf86-video-vmware: Now, once libxatracker is installed, we proceed with building and replacing the current Xorg driver. First check if your system is 32- or 64-bit. If you're building for a 32-bit system, you will not be needing the --libdir=/usr/lib64 option to autogen.
+ <pre>
+ cd $TOP/xf86-video-vmware
+ ./autogen.sh --prefix=/usr --libdir=/usr/lib64
+ make
+ sudo make install
+ </pre>
+<li>vmwgfx kernel module. First make sure that any old version of this kernel module is removed from the system by issuing
+ <pre>
+ sudo rm /lib/modules/`uname -r`/kernel/drivers/gpu/drm/vmwgfx.ko*
+ </pre>
+Then
+ <pre>
+ cd $TOP/vmwgfx
+ make
+ sudo make install
+ sudo cp 00-vmwgfx.rules /etc/udev/rules.d
+ sudo depmod -ae
+ </pre>
+</ul>
+
+
+Now try to load the kernel module by issuing
+ <pre>
+ sudo modprobe vmwgfx</pre>
+Then type
+ <pre>
+ dmesg</pre>
+to watch the debug output. It should contain a number of lines prefixed with "[vmwgfx]".
+
+<p>
+Then restart the Xserver (or reboot).
+The lines starting with "vmwlegacy" or "VMWARE" in the file /var/log/Xorg.0.log
+should now have been replaced with lines starting with "vmwgfx", indicating that
+the new Xorg driver is in use.
+</p>
+
+
+<h2>Running OpenGL Programs</h2>
+
+<p>
+In a shell, run 'glxinfo' and look for the following to verify that the
+driver is working:
+</p>
+
+<pre>
+OpenGL vendor string: VMware, Inc.
+OpenGL renderer string: Gallium 0.4 on SVGA3D; build: RELEASE;
+OpenGL version string: 2.1 Mesa 8.0
+</pre>
+
+If you don't see this, try setting this environment variable:
+ <pre>
+ export LIBGL_DEBUG=verbose</pre>
+then rerun glxinfo and examine the output for error messages.
+</p>
+
+
+
+</body>
+</html>
diff --git a/mesalib/src/mapi/Android.mk b/mesalib/src/mapi/Android.mk
new file mode 100644
index 000000000..fe9e40e26
--- /dev/null
+++ b/mesalib/src/mapi/Android.mk
@@ -0,0 +1,75 @@
+# Mesa 3-D graphics library
+#
+# Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
+# Copyright (C) 2010-2011 LunarG Inc.
+#
+# 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, sublicense,
+# 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 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.
+
+# Android.mk for glapi
+
+LOCAL_PATH := $(call my-dir)
+
+# get MAPI_GLAPI_SOURCES
+include $(LOCAL_PATH)/mapi/sources.mak
+
+mapi_abi_headers :=
+
+# ---------------------------------------
+# Build libglapi
+# ---------------------------------------
+
+include $(CLEAR_VARS)
+
+abi_header := shared-glapi/glapi_mapi_tmp.h
+
+LOCAL_SRC_FILES := $(addprefix mapi/, $(MAPI_GLAPI_SOURCES))
+
+LOCAL_CFLAGS := \
+ -DMAPI_MODE_GLAPI \
+ -DMAPI_ABI_HEADER=\"$(abi_header)\"
+
+LOCAL_C_INCLUDES := \
+ $(MESA_TOP)/src/mapi
+
+LOCAL_MODULE := libglapi
+
+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+intermediates := $(call local-intermediates-dir)
+abi_header := $(intermediates)/$(abi_header)
+LOCAL_GENERATED_SOURCES := $(abi_header)
+
+$(abi_header): PRIVATE_PRINTER := shared-glapi
+
+mapi_abi_headers += $(abi_header)
+
+include $(MESA_COMMON_MK)
+include $(BUILD_SHARED_LIBRARY)
+
+
+mapi_abi_deps := \
+ $(wildcard $(LOCAL_PATH)/glapi/gen/*.py) \
+ $(wildcard $(LOCAL_PATH)/glapi/gen/*.xml) \
+ $(LOCAL_PATH)/mapi/mapi_abi.py
+
+$(mapi_abi_headers): PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/mapi/mapi_abi.py
+$(mapi_abi_headers): PRIVATE_APIXML := $(LOCAL_PATH)/glapi/gen/gl_and_es_API.xml
+$(mapi_abi_headers): $(mapi_abi_deps)
+ @mkdir -p $(dir $@)
+ @echo "target $(PRIVATE_PRINTER): $(PRIVATE_MODULE) <= $(PRIVATE_APIXML)"
+ $(hide) $(PRIVATE_SCRIPT) --printer $(PRIVATE_PRINTER) --mode lib $(PRIVATE_APIXML) > $@
diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c
index dca3613a6..05cc712cf 100644
--- a/mesalib/src/mesa/drivers/common/meta.c
+++ b/mesalib/src/mesa/drivers/common/meta.c
@@ -1451,7 +1451,12 @@ _mesa_meta_BlitFramebuffer(struct gl_context *ctx,
struct vertex verts[4];
GLboolean newTex;
- if (srcW > maxTexSize || srcH > maxTexSize) {
+ /* In addition to falling back if the blit size is larger than the maximum
+ * texture size, fallback if the source is multisampled. This fallback can
+ * be removed once Mesa gets support ARB_texture_multisample.
+ */
+ if (srcW > maxTexSize || srcH > maxTexSize
+ || ctx->ReadBuffer->Visual.samples > 0) {
/* XXX avoid this fallback */
_swrast_BlitFramebuffer(ctx, srcX0, srcY0, srcX1, srcY1,
dstX0, dstY0, dstX1, dstY1, mask, filter);
diff --git a/mesalib/src/mesa/drivers/dri/Makefile.am b/mesalib/src/mesa/drivers/dri/Makefile.am
new file mode 100644
index 000000000..3722082eb
--- /dev/null
+++ b/mesalib/src/mesa/drivers/dri/Makefile.am
@@ -0,0 +1,31 @@
+SUBDIRS=
+
+if HAVE_I915_DRI
+SUBDIRS+=i915
+endif
+
+if HAVE_I965_DRI
+SUBDIRS+=i965
+endif
+
+if HAVE_NOUVEAU_DRI
+SUBDIRS+=nouveau
+endif
+
+if HAVE_R200_DRI
+SUBDIRS+=r200
+endif
+
+if HAVE_RADEON_DRI
+SUBDIRS+=radeon
+endif
+
+if HAVE_SWRAST_DRI
+SUBDIRS+=swrast
+endif
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = dri.pc
+
+driincludedir = $(includedir)/GL/internal
+driinclude_HEADERS = $(top_srcdir)/include/GL/internal/dri_interface.h
diff --git a/mesalib/src/mesa/drivers/dri/swrast/Makefile.am b/mesalib/src/mesa/drivers/dri/swrast/Makefile.am
new file mode 100644
index 000000000..0a2800440
--- /dev/null
+++ b/mesalib/src/mesa/drivers/dri/swrast/Makefile.am
@@ -0,0 +1,58 @@
+
+
+# Copyright © 2012 Matt Turner <mattst88@gmail.com>
+#
+# 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, sublicense,
+# 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 Makefile.sources
+
+# Hack to make some of the non-automake variables work.
+TOP=$(top_builddir)
+
+AM_CFLAGS = \
+ -D__NOT_HAVE_DRM_H \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src/ \
+ -I$(top_srcdir)/src/mapi \
+ -I$(top_srcdir)/src/mesa/ \
+ -I$(top_srcdir)/src/mesa/drivers/dri/common \
+ $(DEFINES) \
+ $(ASM_FLAGS) \
+ $(API_DEFINES)
+
+dridir = $(DRI_DRIVER_INSTALL_DIR)
+
+if HAVE_SWRAST_DRI
+dri_LTLIBRARIES = swrast_dri.la
+endif
+
+swrast_dri_la_SOURCES = \
+ $(SWRAST_C_FILES)
+
+swrast_dri_la_LDFLAGS = -module -avoid-version -shared
+swrast_dri_la_LIBADD = \
+ $(DRI_LIB_DEPS) \
+ $(DRICORE_LIB_DEPS)
+
+# Provide compatibility with scripts for the old Mesa build system for
+# a while by putting a link to the driver into /lib of the build tree.
+all-local: swrast_dri.la
+ $(MKDIR_P) $(top_builddir)/$(LIB_DIR);
+ ln -f .libs/swrast_dri.so $(top_builddir)/$(LIB_DIR)/swrast_dri.so;
diff --git a/mesalib/src/mesa/drivers/dri/swrast/Makefile.sources b/mesalib/src/mesa/drivers/dri/swrast/Makefile.sources
new file mode 100644
index 000000000..9de5cb823
--- /dev/null
+++ b/mesalib/src/mesa/drivers/dri/swrast/Makefile.sources
@@ -0,0 +1,11 @@
+SWRAST_DRIVER_FILES = \
+ swrast.c \
+ swrast_span.c
+
+SWRAST_COMMON_FILES = \
+ ../common/utils.c \
+ ../common/drisw_util.c
+
+SWRAST_C_FILES = \
+ $(SWRAST_COMMON_FILES) \
+ $(SWRAST_DRIVER_FILES)
diff --git a/mesalib/src/mesa/swrast/s_stencil.c b/mesalib/src/mesa/swrast/s_stencil.c
index dbcbd2be0..fb95ef14d 100644
--- a/mesalib/src/mesa/swrast/s_stencil.c
+++ b/mesalib/src/mesa/swrast/s_stencil.c
@@ -297,7 +297,7 @@ get_s8_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint i;
if (rb->Format == MESA_FORMAT_S8) {
- const GLuint rowStride = rb->RowStride;
+ const GLint rowStride = rb->RowStride;
for (i = 0; i < count; i++) {
if (x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) {
stencil[i] = *(map + y[i] * rowStride + x[i]);
@@ -305,8 +305,8 @@ get_s8_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
}
}
else {
- const GLuint bpp = _mesa_get_format_bytes(rb->Format);
- const GLuint rowStride = rb->RowStride * bpp;
+ const GLint bpp = _mesa_get_format_bytes(rb->Format);
+ const GLint rowStride = rb->RowStride * bpp;
for (i = 0; i < count; i++) {
if (x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) {
const GLubyte *src = map + y[i] * rowStride + x[i] * bpp;
diff --git a/xorg-server/dix/getevents.c b/xorg-server/dix/getevents.c
index d0014e617..7678aa1f2 100644
--- a/xorg-server/dix/getevents.c
+++ b/xorg-server/dix/getevents.c
@@ -1836,7 +1836,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
default:
return 0;
}
- if (!(flags & TOUCH_CLIENT_ID))
+ if (t->mode == XIDirectTouch && !(flags & TOUCH_CLIENT_ID))
{
if (!valuator_mask_isset(&mask, 0))
valuator_mask_set_double(&mask, 0, valuator_mask_get_double(touchpoint.ti->valuators, 0));
@@ -1867,15 +1867,24 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
if (need_rawevent)
set_raw_valuators(raw, &mask, raw->valuators.data);
- scr = scale_to_desktop(dev, &mask, &devx, &devy, &screenx, &screeny);
+ /* Indirect device touch coordinates are not used for cursor positioning.
+ * They are merely informational, and are provided in device coordinates.
+ * The device sprite is used for positioning instead, and it is already
+ * scaled. */
+ if (t->mode == XIDirectTouch)
+ scr = scale_to_desktop(dev, &mask, &devx, &devy, &screenx, &screeny);
if (emulate_pointer)
scr = positionSprite(dev, Absolute, &mask,
&devx, &devy, &screenx, &screeny);
/* see fill_pointer_events for coordinate systems */
- updateHistory(dev, &mask, ms);
+ if (emulate_pointer)
+ updateHistory(dev, &mask, ms);
+
clipValuators(dev, &mask);
- storeLastValuators(dev, &mask, 0, 1, devx, devy);
+
+ if (emulate_pointer)
+ storeLastValuators(dev, &mask, 0, 1, devx, devy);
event->root = scr->root->drawable.id;
diff --git a/xorg-server/dix/grabs.c b/xorg-server/dix/grabs.c
index 701470c83..cc2c946d0 100644
--- a/xorg-server/dix/grabs.c
+++ b/xorg-server/dix/grabs.c
@@ -195,7 +195,8 @@ UngrabAllDevices(Bool kill_client)
client = clients[CLIENT_ID(dev->deviceGrab.grab->resource)];
if (!client || client->clientGone)
dev->deviceGrab.DeactivateGrab(dev);
- CloseDownClient(client);
+ if (kill_client)
+ CloseDownClient(client);
}
ErrorF("End list of ungrabbed devices\n");
diff --git a/xorg-server/include/inputstr.h b/xorg-server/include/inputstr.h
index 518e2f4f7..c3297db64 100644
--- a/xorg-server/include/inputstr.h
+++ b/xorg-server/include/inputstr.h
@@ -544,7 +544,7 @@ typedef struct _DeviceIntRec {
DeviceRec public;
DeviceIntPtr next;
Bool startup; /* true if needs to be turned on at
- server intialization time */
+ server initialization time */
DeviceProc deviceProc; /* proc(DevicePtr, DEVICE_xx). It is
used to initialize, turn on, or
turn off the device */