[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-video-vmware: Changes to 'upstream-unstable'



 Makefile.am                  |    4 
 configure.ac                 |   33 
 man/vmware.man               |   63 +
 saa/Makefile.am              |   15 
 saa/saa.c                    |  748 +++++++++++++++++
 saa/saa.h                    |  209 ++++
 saa/saa_accel.c              |  153 +++
 saa/saa_pixmap.c             |  222 +++++
 saa/saa_priv.h               |  279 ++++++
 saa/saa_render.c             |  424 ++++++++++
 saa/saa_unaccel.c            | 1036 ++++++++++++++++++++++++
 src/Makefile.am              |   30 
 src/svga_reg.h               | 1434 +++++++++++++++++++++++++---------
 src/vmware.c                 |  596 +-------------
 src/vmware.h                 |   22 
 src/vmware_bootstrap.c       |  502 +++++++++++
 src/vmware_bootstrap.h       |   71 +
 src/vmware_common.c          |  163 +++
 src/vmware_common.h          |   41 
 src/vmwarectrl.c             |   40 
 src/vmwaremodule.c           |  256 ------
 src/vmwarexinerama.c         |   66 -
 vmwgfx/Makefile.am           |   29 
 vmwgfx/svga3d_reg.h          | 1801 +++++++++++++++++++++++++++++++++++++++++++
 vmwgfx/vmwgfx_crtc.c         |  455 ++++++++++
 vmwgfx/vmwgfx_ctrl.c         |  523 ++++++++++++
 vmwgfx/vmwgfx_ctrl.h         |   48 +
 vmwgfx/vmwgfx_dri2.c         |  426 ++++++++++
 vmwgfx/vmwgfx_driver.c       | 1192 ++++++++++++++++++++++++++++
 vmwgfx/vmwgfx_driver.h       |  195 ++++
 vmwgfx/vmwgfx_drm.h          |  792 ++++++++++++++++++
 vmwgfx/vmwgfx_drmi.c         |  502 +++++++++++
 vmwgfx/vmwgfx_drmi.h         |   87 ++
 vmwgfx/vmwgfx_output.c       |  393 +++++++++
 vmwgfx/vmwgfx_overlay.c      |  893 +++++++++++++++++++++
 vmwgfx/vmwgfx_saa.c          | 1512 ++++++++++++++++++++++++++++++++++++
 vmwgfx/vmwgfx_saa.h          |  110 ++
 vmwgfx/vmwgfx_saa_priv.h     |  125 ++
 vmwgfx/vmwgfx_tex_video.c    |  851 ++++++++++++++++++++
 vmwgfx/vmwgfx_xa_composite.c |  277 ++++++
 vmwgfx/vmwgfx_xa_surface.c   |  368 ++++++++
 vmwgfx/wsbm_util.h           |   79 +
 42 files changed, 15824 insertions(+), 1241 deletions(-)

New commits:
commit b70116b907aa8545f0275589a52275235083bb40
Author: Zack Rusin <zackr@vmware.com>
Date:   Thu Mar 15 11:37:26 2012 -0400

    Fix a memory corruption due to a redundant free.
    
    We use the empty rect purely as a placeholder and never
    initialize it with its own memory so lets not try to free
    it.
    Spotted by Dave Airlie.
    
    Signed-off-by: Zack Rusin <zackr@vmware.com>
    Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>

diff --git a/vmwgfx/vmwgfx_saa.c b/vmwgfx/vmwgfx_saa.c
index 0a6b98f..469598a 100644
--- a/vmwgfx/vmwgfx_saa.c
+++ b/vmwgfx/vmwgfx_saa.c
@@ -1151,11 +1151,9 @@ vmwgfx_composite_prepare(struct saa_driver *driver, CARD8 op,
     if (xa_composite_prepare(vsaa->xa_ctx, xa_comp))
 	goto out_err;
 
-    REGION_UNINIT(pScreen, &empty);
     return TRUE;
 
   out_err:
-    REGION_UNINIT(pScreen, &empty);
     return FALSE;
 }
 

commit 57f1204292a116b35d5930752bc06f9065332879
Author: Jakob Bornecrantz <jakob@vmware.com>
Date:   Tue Mar 13 21:41:11 2012 +0100

    Bump version number for the release
    
    Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>

diff --git a/configure.ac b/configure.ac
index eccca75..77ec7d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-vmware],
-        [12.0.0],
+        [12.0.1],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-vmware])
 AC_CONFIG_SRCDIR([Makefile.am])

commit e585f9ea04bbd17398d2fa804be38a4e75bc60e4
Author: Gaetan Nadon <memsize@videotron.ca>
Date:   Tue Mar 13 09:44:46 2012 -0400

    config: move AC_SYS_LARGEFILE in autoconf init section
    
    There is no need for this statement to be conditionally included.
    It adds support for large files without taking anything away.
    
    http://www.gnu.org/software/autoconf/manual/autoconf.html
    
    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
    Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>

diff --git a/configure.ac b/configure.ac
index af2737a..eccca75 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,6 +29,7 @@ AC_INIT([xf86-video-vmware],
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_AUX_DIR(.)
+AC_SYS_LARGEFILE
 
 # Initialize Automake
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
@@ -122,7 +123,6 @@ AC_SUBST([DRIVER_NAME])
 AC_MSG_CHECKING([whether to build Kernel Mode Setting and 3D])
 if test x$BUILD_VMWGFX = xyes; then
 	AC_MSG_RESULT([yes])
-	AC_SYS_LARGEFILE
         AC_DEFINE([BUILD_VMWGFX], 1, [Building the vmwgfx driver path])
 else
 	AC_MSG_RESULT([no])

commit 04169f3860e4a7d03485631bee40c05fc45b72c6
Author: Gaetan Nadon <memsize@videotron.ca>
Date:   Mon Mar 12 14:51:38 2012 -0400

    config: include saa and vmwgfx subdirs in the tarball
    
    Use AM_CONDITIONAL. Automake knows what to distribute.
    It needs to be able to navigate down the subdirs to find what
    needs to be included in the tarball.
    
    To test reliably, create a tarball and expand it into a separate
    directory and build with xatracker. Distcheck will not detect
    missing code when such code is configured not to build.
    
    The content of a tarball *must* always be identical, regardless
    of the configuration options used or on which platform it was configured.
    
    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
    Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>

diff --git a/Makefile.am b/Makefile.am
index 1203715..64c019e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,9 @@
 #  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.
 
-SUBDIRS = @VMWGFX_DIRS@ src man vmwarectrl
+# Order: vmwgfx before src
+SUBDIRS = man saa vmwgfx src vmwarectrl
+
 MAINTAINERCLEANFILES = ChangeLog INSTALL
 .PHONY: ChangeLog INSTALL
 
diff --git a/configure.ac b/configure.ac
index cf1491f..af2737a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -120,29 +120,23 @@ DRIVER_NAME=vmware
 AC_SUBST([DRIVER_NAME])
 
 AC_MSG_CHECKING([whether to build Kernel Mode Setting and 3D])
-VMWGFX_DIRS=
 if test x$BUILD_VMWGFX = xyes; then
 	AC_MSG_RESULT([yes])
 	AC_SYS_LARGEFILE
-	VMWGFX_DIRS="saa vmwgfx"
-	VMWGFX_LIBADD='$(top_builddir)/vmwgfx/libvmwgfx.la'
-	AC_CONFIG_FILES([
-			saa/Makefile
-			vmwgfx/Makefile
-	])
-        AC_DEFINE([BUILD_VMWGFX], 1,
-                 [Building the vmwgfx driver path])
+        AC_DEFINE([BUILD_VMWGFX], 1, [Building the vmwgfx driver path])
 else
 	AC_MSG_RESULT([no])
 fi
 
-AC_SUBST([VMWGFX_DIRS])
-AC_SUBST([VMWGFX_LIBADD])
+AM_CONDITIONAL(BUILD_VMWGFX, test "x$BUILD_VMWGFX" = xyes)
+
 AC_CONFIG_FILES([
                 Makefile
+                man/Makefile
+                saa/Makefile
+                vmwgfx/Makefile
                 src/Makefile
                 vmwarectrl/Makefile
-                man/Makefile
 ])
 
 AC_OUTPUT
diff --git a/saa/Makefile.am b/saa/Makefile.am
index 849ced9..48c9734 100644
--- a/saa/Makefile.am
+++ b/saa/Makefile.am
@@ -1,3 +1,5 @@
+
+if BUILD_VMWGFX
 noinst_LTLIBRARIES = libsaa.la
 
 libsaa_la_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS)
@@ -10,4 +12,4 @@ libsaa_la_SOURCES = \
 	saa_render.c \
 	saa_accel.c \
 	saa.h
-
+endif
diff --git a/src/Makefile.am b/src/Makefile.am
index 1f54168..04c9e0d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,8 +28,11 @@ vmware_drv_la_LTLIBRARIES = vmware_drv.la
 vmware_drv_la_LDFLAGS = -module -avoid-version
 vmware_drv_la_CFLAGS = $(CWARNFLAGS) @XORG_CFLAGS@
 vmware_drv_ladir = @moduledir@/drivers
-vmware_drv_la_LIBADD = @VMWGFX_LIBADD@
-vmware_drv_la_DEPENDENCIES = @VMWGFX_LIBADD@
+
+if BUILD_VMWGFX
+vmware_drv_la_LIBADD = $(top_builddir)/vmwgfx/libvmwgfx.la
+vmware_drv_la_DEPENDENCIES = $(top_builddir)/vmwgfx/libvmwgfx.la
+endif
 
 vmware_drv_la_SOURCES = \
 	bits2pixels.c \
diff --git a/vmwgfx/Makefile.am b/vmwgfx/Makefile.am
index 813f1a2..269d870 100644
--- a/vmwgfx/Makefile.am
+++ b/vmwgfx/Makefile.am
@@ -1,3 +1,5 @@
+
+if BUILD_VMWGFX
 noinst_LTLIBRARIES = libvmwgfx.la
 libvmwgfx_la_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS) @LIBDRM_CFLAGS@ @XATRACKER_CFLAGS@ -I$(top_srcdir)/src -I$(top_srcdir)/saa
 libvmwgfx_la_LIBADD = @LIBDRM_LIBS@ $(top_builddir)/saa/libsaa.la\
@@ -24,6 +26,4 @@ libvmwgfx_la_SOURCES = \
 	vmwgfx_xa_composite.c \
 	vmwgfx_xa_surface.c \
 	wsbm_util.h
-
-
-
+endif

commit e6836ff099e5565dea58a53bba9b2df377241ef7
Author: Zack Rusin <zackr@vmware.com>
Date:   Thu Mar 8 09:55:07 2012 -0500

    Bump version number for the release
    
    Signed-off-by: Zack Rusin <zackr@vmware.com>

diff --git a/configure.ac b/configure.ac
index fb207f6..cf1491f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-vmware],
-        [11.99.901],
+        [12.0.0],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-vmware])
 AC_CONFIG_SRCDIR([Makefile.am])

commit c5c38bab8c493985349356be5fadc14d3aee8040
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date:   Wed Feb 8 15:00:20 2012 +0100

    vmware/legacy: Fix initial mode size v2
    
    Commit "vmwlegacy: Make the default be a minium of 800x600..."
    read the dimensions from the incorrect register pair.
    
    v2: Also treat initial widths and heights larger than the maximum
    values as an error and revert back to the minimum.
    
    Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
    Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>

diff --git a/src/vmware.c b/src/vmware.c
index e29822f..f20ddb9 100644
--- a/src/vmware.c
+++ b/src/vmware.c
@@ -607,12 +607,19 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
         from = X_CONFIG;
     }
 
-    width = vmwareReadReg(pVMWARE, SVGA_REG_MAX_WIDTH);
-    height = vmwareReadReg(pVMWARE, SVGA_REG_MAX_HEIGHT);
+    width = vmwareReadReg(pVMWARE, SVGA_REG_WIDTH);
+    height = vmwareReadReg(pVMWARE, SVGA_REG_HEIGHT);
     width = MAX(width, VMW_MIN_INITIAL_WIDTH);
     height = MAX(height, VMW_MIN_INITIAL_HEIGHT);
-    width = MIN(width, pVMWARE->maxWidth);
-    height = MIN(height, pVMWARE->maxHeight);
+
+    if (width > pVMWARE->maxWidth || height > pVMWARE->maxHeight) {
+	/*
+	 * This is an error condition and shouldn't happen.
+	 * revert to MIN_INITIAL_ values
+	 */
+	width = VMW_MIN_INITIAL_WIDTH;
+	height = VMW_MIN_INITIAL_HEIGHT;
+    }
 
     xf86DrvMsg(pScrn->scrnIndex, from,
 	       "Will %sset up a driver mode with dimensions %dx%d.\n",

commit 49b4cbc5100ce9a4cc40132c2839f9401a58b92e
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date:   Mon Feb 6 19:48:57 2012 +0100

    saa: Try to avoid readbacks during polyFillRect
    
    This significantly improves performance of shaped windows on top of 3D
    contents
    
    Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
    Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
    Reviewed-by: Zack Rusin <zackr@vmware.com>

diff --git a/saa/saa_unaccel.c b/saa/saa_unaccel.c
index 0a6751e..e2bf3ac 100644
--- a/saa/saa_unaccel.c
+++ b/saa/saa_unaccel.c
@@ -378,6 +378,105 @@ saa_check_poly_arc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * pArcs)
     sscreen->fallback_count--;
 }
 
+
+/**
+ * saa_check_poly_fill_rect_noreadback - PolyFillRect avoiding unnecessary readbacks.
+ *
+ * @pDrawable: The drawable on which to fill.
+ * @pGC: Pointer to the GC to use.
+ * @nrect: Number of rectangles to fill.
+ * @xRectangle: Pointer to rectangles to fill.
+ *
+ * During a standard saa polyFillRect, the damage region is usually the bounding
+ * box of all rectangles. Since we mark the software pixmap dirty based on that
+ * damage region, we need to read all of it back first, even if the fill operation
+ * itself doesn't read anything. This version of polyFillRect improves on that by
+ * only damaging the area we actually fill. If it's a non-reading fill we thus don't
+ * need to read back anything, but this may come at the cost of increased dirty
+ * region fragmentation. In any case, this greatly improves on the performance of
+ * shaped windows on top of accelerated contents, for example unscaled OSD in xine.
+ */
+static Bool
+saa_check_poly_fill_rect_noreadback(DrawablePtr pDrawable, GCPtr pGC,
+				    int nrect, xRectangle *prect)
+{
+    struct saa_gc_priv *sgc = saa_gc(pGC);
+    struct saa_screen_priv *sscreen = saa_screen(pGC->pScreen);
+    RegionPtr region;
+    saa_access_t access;
+    Bool ret;
+    PixmapPtr pPixmap;
+    xRectangle *prect_save = prect;
+    int xoff, yoff;
+    struct saa_pixmap *spix;
+
+    if (!nrect)
+	return TRUE;
+
+    sscreen->fallback_count++;
+
+    pPixmap = saa_get_pixmap(pDrawable, &xoff, &yoff);
+    spix = saa_get_saa_pixmap(pPixmap);
+    region = RECTS_TO_REGION(pGC->pScreen, nrect, prect, CT_UNSORTED);
+    if (!region)
+	goto out_no_region;
+
+    REGION_TRANSLATE(pGC->pScreen, region, xoff + pDrawable->x,
+		     yoff + pDrawable->y);
+
+
+    access = SAA_ACCESS_W;
+    if (saa_gc_reads_destination(pDrawable, pGC)) {
+	/*
+	 * We need to do a readback anyway. In case of more than an
+	 * ad hoc number of say 10 rectangles, we might as well do a
+	 * readback of the whole damage area to avoid fragmentation.
+	 */
+	access |= SAA_ACCESS_R;
+	ret = saa_prepare_access_pixmap(pPixmap, access, region);
+    } else
+	ret = saa_prepare_access_pixmap(pPixmap, access, NULL);
+
+    if (!ret)
+	goto out_no_access;
+
+    if (!saa_prepare_access_gc(pGC))
+	goto out_no_gc;
+
+    saa_swap(sgc, pGC, ops);
+    pGC->ops->PolyFillRect(pDrawable, pGC, nrect, prect_save);
+    saa_swap(sgc, pGC, ops);
+
+    saa_finish_access_gc(pGC);
+    saa_finish_access_pixmap(pPixmap, access);
+
+    if (spix->damage) {
+	/*
+	 * Not sure why the region can be larger than the pending damage region
+	 * at this point, (happens on clipped-away drawables). To avoid potential
+	 * rendering problems, we clip to the pending damage region.
+	 */
+	REGION_INTERSECT(pGC->pScreen, region, region, saa_pix_damage_pending(spix));
+
+	saa_pixmap_dirty(pPixmap, FALSE, region);
+    }
+
+    REGION_DESTROY(pGC->pScreen, region);
+
+    sscreen->fallback_count--;
+
+    return TRUE;
+
+  out_no_gc:
+    saa_finish_access_pixmap(pPixmap, access);
+  out_no_access:
+    REGION_DESTROY(pGC->pScreen, region);
+  out_no_region:
+    sscreen->fallback_count--;
+
+    return FALSE;
+}
+
 void
 saa_check_poly_fill_rect(DrawablePtr pDrawable, GCPtr pGC,
 			 int nrect, xRectangle * prect)
@@ -388,6 +487,9 @@ saa_check_poly_fill_rect(DrawablePtr pDrawable, GCPtr pGC,
 
     SAA_FALLBACK(("to %p (%c)\n", pDrawable, saa_drawable_loc(pDrawable)));
 
+    if (saa_check_poly_fill_rect_noreadback(pDrawable, pGC, nrect, prect))
+	return;
+
     sscreen->fallback_count++;
 
     /*

commit ecf6c5b1081e70ec64132a8188c8cc15945c2290
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date:   Thu Feb 2 10:24:26 2012 +0100

    vmware: Kill warnings on Xserver 1.12
    
    Compile-tested on servers 1.0 through 1.12.
    
    Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>

diff --git a/src/Makefile.am b/src/Makefile.am
index 64a9069..1f54168 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -26,7 +26,7 @@
 
 vmware_drv_la_LTLIBRARIES = vmware_drv.la
 vmware_drv_la_LDFLAGS = -module -avoid-version
-vmware_drv_la_CFLAGS = @XORG_CFLAGS@
+vmware_drv_la_CFLAGS = $(CWARNFLAGS) @XORG_CFLAGS@
 vmware_drv_ladir = @moduledir@/drivers
 vmware_drv_la_LIBADD = @VMWGFX_LIBADD@
 vmware_drv_la_DEPENDENCIES = @VMWGFX_LIBADD@
diff --git a/src/vmware.c b/src/vmware.c
index 5eb2bf9..e29822f 100644
--- a/src/vmware.c
+++ b/src/vmware.c
@@ -20,7 +20,6 @@ char rcsId_vmware[] =
 
 #include "compiler.h"	/* inb/outb */
 
-#include "xf86PciInfo.h"	/* pci vendor id */
 #include "xf86Pci.h"		/* pci */
 
 #include "mipointer.h"		/* sw cursor */
@@ -286,7 +285,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
     uint32 id;
     int i;
     ClockRange* clockRanges;
-    IOADDRESS domainIOBase = 0;
+    unsigned long domainIOBase = 0;
     uint32 width = 0, height = 0;
     Bool defaultMode;
 
@@ -320,7 +319,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
         return FALSE;
     }
 
-    if (DEVICE_ID(pVMWARE->PciInfo) == PCI_CHIP_VMWARE0710) {
+    if (DEVICE_ID(pVMWARE->PciInfo) == PCI_DEVICE_ID_VMWARE_SVGA) {
         pVMWARE->indexReg = domainIOBase +
            SVGA_LEGACY_BASE_PORT + SVGA_INDEX_PORT*sizeof(uint32);
         pVMWARE->valueReg = domainIOBase +
diff --git a/src/vmware.h b/src/vmware.h
index 632796e..458390a 100644
--- a/src/vmware.h
+++ b/src/vmware.h
@@ -29,7 +29,6 @@
 
 #include "compiler.h"	        /* inb/outb */
 
-#include "xf86PciInfo.h"	/* pci vendor id */
 #include "xf86Pci.h"		/* pci */
 #include "xf86Cursor.h"		/* hw cursor */
 #include "cursorstr.h"          /* xhot/yhot */
@@ -43,13 +42,14 @@
 #include "svga_reg.h"
 #include "svga_struct.h"
 #include "vmware_bootstrap.h"
+#include <xf86Module.h>
 
 #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12
 #define _swapl(x, n) swapl(x,n)
 #define _swaps(x, n) swaps(x,n)
 #else
-#define _swapl(x, n) swapl(x)
-#define _swaps(x, n) swaps(x)
+#define _swapl(x, n) (void) n; swapl(x)
+#define _swaps(x, n) (void) n; swaps(x)
 #endif
 
 /*
@@ -151,7 +151,7 @@ typedef struct {
         uint32 sourcePixmap[SVGA_PIXMAP_SIZE(MAX_CURS, MAX_CURS, 32)];
     } hwcur;
 
-    IOADDRESS indexReg, valueReg;
+    unsigned long indexReg, valueReg;
 
     ScreenRec ScrnFuncs;
 
diff --git a/src/vmware_bootstrap.c b/src/vmware_bootstrap.c
index 2f21c2a..ea5be19 100644
--- a/src/vmware_bootstrap.c
+++ b/src/vmware_bootstrap.c
@@ -31,7 +31,6 @@
 
 #include "xf86.h"
 #include "compiler.h"
-#include "xf86PciInfo.h"	/* pci vendor id */
 #include "xf86Pci.h"		/* pci */
 #include "vm_device_version.h"
 #include "vmware_bootstrap.h"
@@ -70,20 +69,6 @@
 #endif
 
 /*
- * Sanity check that xf86PciInfo.h has the correct values (which come from
- * the VMware source tree in vm_device_version.h.
- */
-#if PCI_CHIP_VMWARE0405 != PCI_DEVICE_ID_VMWARE_SVGA2
-#error "PCI_CHIP_VMWARE0405 is wrong, update it from vm_device_version.h"
-#endif
-#if PCI_CHIP_VMWARE0710 != PCI_DEVICE_ID_VMWARE_SVGA
-#error "PCI_CHIP_VMWARE0710 is wrong, update it from vm_device_version.h"
-#endif
-#if PCI_VENDOR_VMWARE != PCI_VENDOR_ID_VMWARE
-#error "PCI_VENDOR_VMWARE is wrong, update it from vm_device_version.h"
-#endif
-
-/*
  * This is the only way I know to turn a #define of an integer constant into
  * a constant string.
  */
@@ -147,11 +132,11 @@ static resRange vmwareLegacyRes[] = {
 #if XSERVER_LIBPCIACCESS
 
 #define VMWARE_DEVICE_MATCH(d, i) \
-    {PCI_VENDOR_VMWARE, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) }
+    {PCI_VENDOR_ID_VMWARE, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) }
 
 static const struct pci_id_match VMwareDeviceMatch[] = {
-    VMWARE_DEVICE_MATCH (PCI_CHIP_VMWARE0405, 0 ),
-    VMWARE_DEVICE_MATCH (PCI_CHIP_VMWARE0710, 0 ),
+    VMWARE_DEVICE_MATCH (PCI_DEVICE_ID_VMWARE_SVGA2, 0 ),
+    VMWARE_DEVICE_MATCH (PCI_DEVICE_ID_VMWARE_SVGA, 0 ),
     { 0, 0, 0 },
 };
 #endif
@@ -164,14 +149,14 @@ static const struct pci_id_match VMwareDeviceMatch[] = {
  */
 
 static PciChipsets VMWAREPciChipsets[] = {
-    { PCI_CHIP_VMWARE0405, PCI_CHIP_VMWARE0405, RES_EXCLUSIVE_VGA },
-    { PCI_CHIP_VMWARE0710, PCI_CHIP_VMWARE0710, vmwareLegacyRes },
+    { PCI_DEVICE_ID_VMWARE_SVGA2, PCI_DEVICE_ID_VMWARE_SVGA2, RES_EXCLUSIVE_VGA },
+    { PCI_DEVICE_ID_VMWARE_SVGA, PCI_DEVICE_ID_VMWARE_SVGA, vmwareLegacyRes },
     { -1,		       -1,		    RES_UNDEFINED }
 };
 
 static SymTabRec VMWAREChipsets[] = {
-    { PCI_CHIP_VMWARE0405, "vmware0405" },
-    { PCI_CHIP_VMWARE0710, "vmware0710" },
+    { PCI_DEVICE_ID_VMWARE_SVGA2, "vmware0405" },
+    { PCI_DEVICE_ID_VMWARE_SVGA, "vmware0710" },
     { -1,                  NULL }
 };
 
@@ -284,8 +269,8 @@ VMwarePciProbe (DriverPtr           drv,
 
     entity = xf86GetEntityInfo(entity_num);
     switch (DEVICE_ID(device)) {
-    case PCI_CHIP_VMWARE0405:
-    case PCI_CHIP_VMWARE0710:
+    case PCI_DEVICE_ID_VMWARE_SVGA2:
+    case PCI_DEVICE_ID_VMWARE_SVGA:
         xf86MsgVerb(X_INFO, 4, "VMwarePciProbe: Valid device\n");
 
 #ifdef BUILD_VMWGFX
@@ -372,7 +357,7 @@ VMWAREProbe(DriverPtr drv, int flags)
     }
     if (xf86GetPciVideoInfo()) {
         VmwareLog(("Some PCI Video Info Exists\n"));
-        numUsed = xf86MatchPciInstances(VMWARE_NAME, PCI_VENDOR_VMWARE,
+        numUsed = xf86MatchPciInstances(VMWARE_NAME, PCI_VENDOR_ID_VMWARE,
                                         VMWAREChipsets, VMWAREPciChipsets, devSections,
                                         numDevSections, drv, &usedChips);
         free(devSections);

commit 3e18d43c7f8ab5dcb94ac285a687eaaa1a578250
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date:   Wed Feb 1 17:30:52 2012 +0100

    vmwgfx: Kill a deprecation warning on server 1.12
    
    Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>

diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c
index c5487e2..ed1eb8c 100644
--- a/vmwgfx/vmwgfx_driver.c
+++ b/vmwgfx/vmwgfx_driver.c
@@ -35,7 +35,6 @@
 #include "xf86.h"
 #include "xf86_OSproc.h"
 #include "compiler.h"
-#include "xf86PciInfo.h"
 #include "xf86Pci.h"
 #include "mipointer.h"
 #include "micmap.h"

commit bfb286bea967c26426aebda2a581f35da0d86884
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date:   Wed Feb 1 17:25:19 2012 +0100

    vmwgfx: Fix up swap[sl] for server 1.12
    
    Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>

diff --git a/vmwgfx/vmwgfx_ctrl.c b/vmwgfx/vmwgfx_ctrl.c
index 3185879..156d34c 100644
--- a/vmwgfx/vmwgfx_ctrl.c
+++ b/vmwgfx/vmwgfx_ctrl.c
@@ -73,10 +73,10 @@ VMwareCtrlQueryVersion(ClientPtr client)
    rep.majorVersion = VMWARE_CTRL_MAJOR_VERSION;
    rep.minorVersion = VMWARE_CTRL_MINOR_VERSION;
    if (client->swapped) {
-      swaps(&rep.sequenceNumber, n);
-      swapl(&rep.length, n);
-      swapl(&rep.majorVersion, n);
-      swapl(&rep.minorVersion, n);
+      _swaps(&rep.sequenceNumber, n);
+      _swapl(&rep.length, n);
+      _swapl(&rep.majorVersion, n);
+      _swapl(&rep.minorVersion, n);
    }
    WriteToClient(client, sizeof(xVMwareCtrlQueryVersionReply), (char *)&rep);
 
@@ -171,11 +171,11 @@ VMwareCtrlSetRes(ClientPtr client)
    rep.x = stuff->x;
    rep.y = stuff->y;
    if (client->swapped) {
-      swaps(&rep.sequenceNumber, n);
-      swapl(&rep.length, n);
-      swapl(&rep.screen, n);
-      swapl(&rep.x, n);
-      swapl(&rep.y, n);
+      _swaps(&rep.sequenceNumber, n);
+      _swapl(&rep.length, n);
+      _swapl(&rep.screen, n);
+      _swapl(&rep.x, n);
+      _swapl(&rep.y, n);
    }
    WriteToClient(client, sizeof(xVMwareCtrlSetResReply), (char *)&rep);
 
@@ -278,9 +278,9 @@ VMwareCtrlSetTopology(ClientPtr client)
    rep.sequenceNumber = client->sequence;
    rep.screen = stuff->screen;
    if (client->swapped) {
-      swaps(&rep.sequenceNumber, n);
-      swapl(&rep.length, n);
-      swapl(&rep.screen, n);
+      _swaps(&rep.sequenceNumber, n);
+      _swapl(&rep.length, n);
+      _swapl(&rep.screen, n);
    }
    WriteToClient(client, sizeof(xVMwareCtrlSetTopologyReply), (char *)&rep);
 
@@ -347,7 +347,7 @@ SVMwareCtrlQueryVersion(ClientPtr client)
    REQUEST(xVMwareCtrlQueryVersionReq);
    REQUEST_SIZE_MATCH(xVMwareCtrlQueryVersionReq);
 
-   swaps(&stuff->length, n);
+   _swaps(&stuff->length, n);
 
    return VMwareCtrlQueryVersion(client);
 }
@@ -378,10 +378,10 @@ SVMwareCtrlSetRes(ClientPtr client)
    REQUEST(xVMwareCtrlSetResReq);
    REQUEST_SIZE_MATCH(xVMwareCtrlSetResReq);
 
-   swaps(&stuff->length, n);
-   swapl(&stuff->screen, n);
-   swapl(&stuff->x, n);
-   swapl(&stuff->y, n);
+   _swaps(&stuff->length, n);
+   _swapl(&stuff->screen, n);
+   _swapl(&stuff->x, n);
+   _swapl(&stuff->y, n);
 
    return VMwareCtrlSetRes(client);
 }
@@ -412,9 +412,9 @@ SVMwareCtrlSetTopology(ClientPtr client)
    REQUEST(xVMwareCtrlSetTopologyReq);
    REQUEST_SIZE_MATCH(xVMwareCtrlSetTopologyReq);
 
-   swaps(&stuff->length, n);
-   swapl(&stuff->screen, n);
-   swapl(&stuff->number, n);
+   _swaps(&stuff->length, n);
+   _swapl(&stuff->screen, n);
+   _swapl(&stuff->number, n);
    /* Each extent is a struct of shorts. */
    SwapRestS(stuff);
 
diff --git a/vmwgfx/vmwgfx_driver.h b/vmwgfx/vmwgfx_driver.h
index 3290f0e..4fcfed6 100644
--- a/vmwgfx/vmwgfx_driver.h
+++ b/vmwgfx/vmwgfx_driver.h
@@ -44,6 +44,7 @@
 #include <xf86Crtc.h>
 #include <xf86xv.h>
 #include <xa_tracker.h>
+#include <xf86Module.h>
 
 #ifdef DRI2
 #include <dri2.h>
@@ -52,6 +53,14 @@
 #endif
 #endif
 
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12
+#define _swapl(x, n) swapl(x,n)
+#define _swaps(x, n) swaps(x,n)
+#else
+#define _swapl(x, n) (void) n; swapl(x)
+#define _swaps(x, n) (void) n; swaps(x)
+#endif
+
 #define DRV_ERROR(msg)	xf86DrvMsg(pScrn->scrnIndex, X_ERROR, msg);
 #define debug_printf(...)
 

commit 8ff19c2b2f288d6851b444dbda39544980837b73
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date:   Wed Feb 1 16:59:13 2012 +0100

    vmwgfx: Avoid including a library header and use pixman for type conversion
    
    The PictTransform type is a typedef of a pixman type.
    
    Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>

diff --git a/vmwgfx/vmwgfx_xa_composite.c b/vmwgfx/vmwgfx_xa_composite.c
index a2e3970..32246e8 100644
--- a/vmwgfx/vmwgfx_xa_composite.c
+++ b/vmwgfx/vmwgfx_xa_composite.c
@@ -33,8 +33,8 @@
 #include "config.h"
 #endif
 
+#include <pixman.h>
 #include <picturestr.h>
-#include <X11/extensions/Xrender.h>
 #include "xa_composite.h"
 #include "vmwgfx_saa.h"
 #include "vmwgfx_saa_priv.h"
@@ -75,17 +75,17 @@ vmwgfx_matrix_from_pict_transform(PictTransform *trans, float *matrix)
    if (!trans)
       return FALSE;
 
-   matrix[0] = XFixedToDouble(trans->matrix[0][0]);
-   matrix[3] = XFixedToDouble(trans->matrix[0][1]);
-   matrix[6] = XFixedToDouble(trans->matrix[0][2]);
+   matrix[0] = pixman_fixed_to_double(trans->matrix[0][0]);
+   matrix[3] = pixman_fixed_to_double(trans->matrix[0][1]);
+   matrix[6] = pixman_fixed_to_double(trans->matrix[0][2]);
 
-   matrix[1] = XFixedToDouble(trans->matrix[1][0]);
-   matrix[4] = XFixedToDouble(trans->matrix[1][1]);
-   matrix[7] = XFixedToDouble(trans->matrix[1][2]);
+   matrix[1] = pixman_fixed_to_double(trans->matrix[1][0]);
+   matrix[4] = pixman_fixed_to_double(trans->matrix[1][1]);
+   matrix[7] = pixman_fixed_to_double(trans->matrix[1][2]);
 
-   matrix[2] = XFixedToDouble(trans->matrix[2][0]);
-   matrix[5] = XFixedToDouble(trans->matrix[2][1]);
-   matrix[8] = XFixedToDouble(trans->matrix[2][2]);
+   matrix[2] = pixman_fixed_to_double(trans->matrix[2][0]);
+   matrix[5] = pixman_fixed_to_double(trans->matrix[2][1]);
+   matrix[8] = pixman_fixed_to_double(trans->matrix[2][2]);
 
    return TRUE;
 }

commit 193b5118199028ea0180785bb3f4c8a16359b8b0
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date:   Fri Jan 13 17:01:02 2012 +0100

    Bump version number for release
    
    Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
    Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>

diff --git a/configure.ac b/configure.ac
index 0749a76..fb207f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-vmware],
-        [11.0.99.901],
+        [11.99.901],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-vmware])
 AC_CONFIG_SRCDIR([Makefile.am])

commit c5af120177949c82cbd0611da565fef9c2c829cb
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date:   Fri Jan 13 17:14:47 2012 +0100

    Make the driver build pass "make distcheck"
    
    Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
    Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>

diff --git a/configure.ac b/configure.ac
index 3aec9af..0749a76 100644
--- a/configure.ac
+++ b/configure.ac
@@ -125,7 +125,7 @@ if test x$BUILD_VMWGFX = xyes; then
 	AC_MSG_RESULT([yes])
 	AC_SYS_LARGEFILE
 	VMWGFX_DIRS="saa vmwgfx"
-	VMWGFX_LIBADD='$(top_srcdir)/vmwgfx/libvmwgfx.la'
+	VMWGFX_LIBADD='$(top_builddir)/vmwgfx/libvmwgfx.la'
 	AC_CONFIG_FILES([
 			saa/Makefile
 			vmwgfx/Makefile
diff --git a/vmwgfx/Makefile.am b/vmwgfx/Makefile.am
index 1ee6582..813f1a2 100644
--- a/vmwgfx/Makefile.am
+++ b/vmwgfx/Makefile.am
@@ -1,18 +1,21 @@
 noinst_LTLIBRARIES = libvmwgfx.la
 libvmwgfx_la_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS) @LIBDRM_CFLAGS@ @XATRACKER_CFLAGS@ -I$(top_srcdir)/src -I$(top_srcdir)/saa
-libvmwgfx_la_LIBADD = @LIBDRM_LIBS@ $(top_srcdir)/saa/libsaa.la\
+libvmwgfx_la_LIBADD = @LIBDRM_LIBS@ $(top_builddir)/saa/libsaa.la\
 	@XATRACKER_LIBS@
-libvmwgfx_la_DEPENDENCIES = $(top_srcdir)/saa/libsaa.la
+libvmwgfx_la_DEPENDENCIES = $(top_builddir)/saa/libsaa.la
 
 libvmwgfx_la_SOURCES = \
+	svga3d_reg.h \
 	vmwgfx_driver.c \
 	vmwgfx_driver.h \
+	vmwgfx_drm.h \
 	vmwgfx_crtc.c \
 	vmwgfx_output.c \
 	vmwgfx_dri2.c \
 	vmwgfx_tex_video.c \
 	vmwgfx_saa.c \
 	vmwgfx_saa.h \
+	vmwgfx_saa_priv.h \
 	vmwgfx_drmi.c \
 	vmwgfx_drmi.h \
 	vmwgfx_overlay.c \
diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c
index 9baf01c..c5487e2 100644
--- a/vmwgfx/vmwgfx_driver.c
+++ b/vmwgfx/vmwgfx_driver.c
@@ -76,7 +76,7 @@ typedef uint16_t uint16;
 
 typedef int8_t int8;
 typedef uint8_t uint8;
-#include "./src/svga_reg.h"
+#include "../src/svga_reg.h"
 
 #define XA_VERSION_MINOR_REQUIRED 0
 #define XA_VERSION_MAJOR_REQUIRED 1

commit e6d03aceb1195de0b490f39024f34a33b1a8f6fc
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date:   Thu Jan 12 14:00:41 2012 +0100

    vmwgfx: Adapt to new XA version number v2
    
    Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
    Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>

diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c
index e9e0c09..9baf01c 100644
--- a/vmwgfx/vmwgfx_driver.c
+++ b/vmwgfx/vmwgfx_driver.c
@@ -78,7 +78,10 @@ typedef int8_t int8;
 typedef uint8_t uint8;
 #include "./src/svga_reg.h"
 
-#define XA_VERSION_MINOR_REQUIRED 6
+#define XA_VERSION_MINOR_REQUIRED 0
+#define XA_VERSION_MAJOR_REQUIRED 1
+#define XA_VERSION_MAJOR_COMPAT 1
+
 #define DRM_VERSION_MAJOR_REQUIRED 2
 #define DRM_VERSION_MINOR_REQUIRED 3
 
@@ -973,25 +976,15 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 		       "Gallium3D XA version: %d.%d.%d.\n",
 		       major, minor, patch);
 
-	    if (XA_TRACKER_VERSION_MAJOR == 0) {
-		if (minor != XA_TRACKER_VERSION_MINOR) {
-		    xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-			       "Expecting XA version 0.%d.x.\n",
-			       XA_TRACKER_VERSION_MINOR);
-		    xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-			       "No render acceleration available.\n");
-		    xa_tracker_destroy(ms->xat);
-		    ms->xat = NULL;
-		    ms->from_render = X_PROBED;
-		}
-	    }
-	    if (major != XA_TRACKER_VERSION_MAJOR ||
-		minor < XA_VERSION_MINOR_REQUIRED) {
+	    if (major < XA_VERSION_MAJOR_REQUIRED ||
+		major > XA_VERSION_MAJOR_COMPAT ||
+		(major == XA_VERSION_MAJOR_REQUIRED &&
+		 minor < XA_VERSION_MINOR_REQUIRED)) {
 		xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
 			   "Expecting %d.%d.x >= XA version < %d.0.0.\n",
-			   XA_TRACKER_VERSION_MAJOR,
+			   XA_VERSION_MAJOR_REQUIRED,
 			   XA_VERSION_MINOR_REQUIRED,
-			   XA_TRACKER_VERSION_MAJOR + 1);
+			   XA_VERSION_MAJOR_COMPAT + 1);
 		xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
 			   "No render acceleration available.\n");
 		xa_tracker_destroy(ms->xat);

commit 59435d2d3af8a9f64ee40eac4f0479470ba6badf
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date:   Thu Jan 12 17:57:37 2012 +0100

    vmwgfx,saa: Fix a bunch of compilation warnings
    
    Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
    Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>

diff --git a/saa/saa_unaccel.c b/saa/saa_unaccel.c
index deaf5aa..0a6751e 100644
--- a/saa/saa_unaccel.c
+++ b/saa/saa_unaccel.c
@@ -629,7 +629,6 @@ saa_compute_composite_regions(ScreenPtr pScreen,
 			      RegionPtr *mask_reg)
 {
     struct saa_screen_priv *sscreen = saa_screen(pScreen);
-    PixmapPtr dst_pixmap;
     RegionPtr srcReg = NULL;
     RegionPtr maskReg = NULL;


Reply to: