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

xserver-xorg-video-vmware: Changes to 'ubuntu'



 debian/changelog         |   14 +++++++++++
 debian/rules             |    7 +++--
 saa/saa_unaccel.c        |   12 ++++++++-
 src/vmware.c             |    3 --
 src/vmware_bootstrap.c   |   59 ++++++++++++++++++++++++++++++++++++++++++++---
 src/vmwarevideo.c        |    7 ++++-
 vmwgfx/vmwgfx_crtc.c     |   13 +++++++++-
 vmwgfx/vmwgfx_driver.c   |   35 +++++++++++++++++++++++----
 vmwgfx/vmwgfx_driver.h   |    2 +
 vmwgfx/vmwgfx_overlay.c  |   28 ++++++++++++++--------
 vmwgfx/vmwgfx_saa.c      |    3 +-
 vmwgfx/vmwgfx_xmir.c     |    6 ++++
 vmwgfx/vmwgfx_xwayland.c |    2 -
 13 files changed, 162 insertions(+), 29 deletions(-)

New commits:
commit 3249f38d2f91207266d9e5e6113106bbf9db2eab
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed Sep 10 16:33:11 2014 +0200

    release to utopic

diff --git a/debian/changelog b/debian/changelog
index 8c088e2..6f1cc69 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,9 @@
-xserver-xorg-video-vmware (1:13.0.2-3ubuntu1) UNRELEASED; urgency=low
+xserver-xorg-video-vmware (1:13.0.2-3ubuntu1) utopic; urgency=medium
 
   * Merge from released debian-unstable.
   * Cherry pick some more fixes from master.
 
- -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Wed, 06 Aug 2014 15:50:06 +0200
+ -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Wed, 10 Sep 2014 16:32:01 +0200
 
 xserver-xorg-video-vmware (1:13.0.2-3) unstable; urgency=medium
 

commit 378d7adf092513ef8fcd3851bc4f512e51ea2437
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed Aug 6 15:50:51 2014 +0200

    Add changelog entries.

diff --git a/debian/changelog b/debian/changelog
index 431efbf..8c088e2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+xserver-xorg-video-vmware (1:13.0.2-3ubuntu1) UNRELEASED; urgency=low
+
+  * Merge from released debian-unstable.
+  * Cherry pick some more fixes from master.
+
+ -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Wed, 06 Aug 2014 15:50:06 +0200
+
 xserver-xorg-video-vmware (1:13.0.2-3) unstable; urgency=medium
 
   * rules: avoid mixing implicit and normal rules; make 4 doesn't like that

commit 0a596fd0c92fdcf73071869a59029263a2596018
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date:   Wed Jul 2 14:21:45 2014 +0200

    vmware/vmwgfx: Fix an error path segfault
    
    Part of freedesktop.org bugzilla bug #80645
    If taking a scanout reference on a pixmap fails, the
    struct vmwgfx_screen_entry::pixmap pointer must be set to NULL, otherwise
    the driver will incorrectly attempt to remove the scanout reference in the
    error path, causing a segfault.
    
    This problem is seen in the above-mentioned bug, but it is not the root
    cause of the problem. With this patch applied, the server will terminate
    cleanly instead of segfaulting.
    
    Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
    Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>

diff --git a/vmwgfx/vmwgfx_crtc.c b/vmwgfx/vmwgfx_crtc.c
index 5fce5f7..4f9cdda 100644
--- a/vmwgfx/vmwgfx_crtc.c
+++ b/vmwgfx/vmwgfx_crtc.c
@@ -193,6 +193,7 @@ crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 	crtcp->entry.pixmap = pixmap;
 	crtcp->scanout_id = vmwgfx_scanout_ref(&crtcp->entry);
 	if (crtcp->scanout_id == -1) {
+	    crtcp->entry.pixmap = NULL;
 	    LogMessage(X_ERROR, "Failed to convert pixmap to scanout.\n");
 	    return FALSE;
 	}

commit e2d4e0cb5870f51e8a27cedc74565efb124b75e9
Author: Julien Cristau <jcristau@debian.org>
Date:   Mon Jun 2 22:29:16 2014 +0200

    Upload to unstable

diff --git a/debian/changelog b/debian/changelog
index 5cf4dd4..62a7de6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,9 @@
-xserver-xorg-video-vmware (1:13.0.2-3) UNRELEASED; urgency=medium
+xserver-xorg-video-vmware (1:13.0.2-3) unstable; urgency=medium
 
-  * rules: avoid mixing implicit and normal rules; make 4 doesn't like that.
+  * rules: avoid mixing implicit and normal rules; make 4 doesn't like that
+    (closes: #750265)
 
- -- Julien Cristau <jcristau@debian.org>  Tue, 29 Apr 2014 18:34:12 +0200
+ -- Julien Cristau <jcristau@debian.org>  Mon, 02 Jun 2014 22:28:59 +0200
 
 xserver-xorg-video-vmware (1:13.0.2-2) unstable; urgency=medium
 

commit 4e378a730d2d2deffc915af2a3d013d2a994a1b0
Author: Jakob Bornecrantz <jakob@vmware.com>
Date:   Wed May 21 11:52:29 2014 +0200

    vmware/legacy: Apply same fix to auto colorkey fill
    
    Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
    Reviewed-by: Thomas Hellström <thellstrom@vmware.com>

diff --git a/src/vmwarevideo.c b/src/vmwarevideo.c
index 745c71f..a82110d 100644
--- a/src/vmwarevideo.c
+++ b/src/vmwarevideo.c
@@ -687,7 +687,12 @@ vmwareVideoInitStream(ScrnInfoPtr pScrn, VMWAREVideoPtr pVid,
 	int nBoxes = REGION_NUM_RECTS(&pVid->clipBoxes);
 
 #if HAVE_FILLKEYHELPERDRAWABLE
-	xf86XVFillKeyHelperDrawable(draw, pVid->colorKey, clipBoxes);
+	if (draw->type == DRAWABLE_WINDOW) {
+	    xf86XVFillKeyHelperDrawable(draw, pVid->colorKey, clipBoxes);
+	    DamageDamageRegion(draw, clipBoxes);
+	} else {
+	    xf86XVFillKeyHelper(pScrn->pScreen, pVid->colorKey, clipBoxes);
+        }
 #else
         xf86XVFillKeyHelper(pScrn->pScreen, pVid->colorKey, clipBoxes);
 #endif

commit 82c9b0c1d34459c568d004521e3f35a69f5d7ae3
Author: Jakob Bornecrantz <jakob@vmware.com>
Date:   Wed May 21 11:51:46 2014 +0200

    vmware/vmwgfx: Fix auto colorkey fill usage
    
    Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
    Reviewed-by: Thomas Hellström <thellstrom@vmware.com>

diff --git a/vmwgfx/vmwgfx_overlay.c b/vmwgfx/vmwgfx_overlay.c
index 2c0d7fa..ef1d541 100644
--- a/vmwgfx/vmwgfx_overlay.c
+++ b/vmwgfx/vmwgfx_overlay.c
@@ -162,7 +162,7 @@ struct vmwgfx_overlay_port
     int (*play)(ScrnInfoPtr, struct vmwgfx_overlay_port *,
                 short, short, short, short, short,
                 short, short, short, int, unsigned char*,
-                short, short, RegionPtr);
+                short, short, RegionPtr, DrawablePtr);
 
     /* values to go into the SVGAOverlayUnit */
     uint32 streamId;
@@ -217,13 +217,15 @@ static int vmw_video_port_init(ScrnInfoPtr pScrn,
                                short drw_y, short src_w, short src_h,
                                short drw_w, short drw_h, int format,
                                unsigned char *buf, short width,
-                               short height, RegionPtr clipBoxes);
+                               short height, RegionPtr clipBoxes,
+                               DrawablePtr pDraw);
 static int vmw_video_port_play(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
                                short src_x, short src_y, short drw_x,
                                short drw_y, short src_w, short src_h,
                                short drw_w, short drw_h, int format,
                                unsigned char *buf, short width,
-                               short height, RegionPtr clipBoxes);
+                               short height, RegionPtr clipBoxes,
+                               DrawablePtr pDraw);
 static void vmw_video_port_cleanup(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port);
 
 static int vmw_video_buffer_alloc(int drm_fd, int size,
@@ -380,7 +382,7 @@ vmw_video_port_init(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
                     short drw_y, short src_w, short src_h,
                     short drw_w, short drw_h, int format,
                     unsigned char *buf, short width,
-                    short height, RegionPtr clipBoxes)
+                    short height, RegionPtr clipBoxes, DrawablePtr pDraw)
 {
     unsigned short w, h;
     int i, ret;
@@ -412,7 +414,7 @@ vmw_video_port_init(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
     REGION_NULL(pScrn->pScreen, &port->clipBoxes);
     port->play = vmw_video_port_play;
     return port->play(pScrn, port, src_x, src_y, drw_x, drw_y, src_w, src_h,
-                      drw_w, drw_h, format, buf, width, height, clipBoxes);
+                      drw_w, drw_h, format, buf, width, height, clipBoxes, pDraw);
 
   out_no_buffer:
     while(i-- != 0) {
@@ -448,7 +450,7 @@ vmw_video_port_play(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
                     short drw_y, short src_w, short src_h,
                     short drw_w, short drw_h, int format,
                     unsigned char *buf, short width,
-                    short height, RegionPtr clipBoxes)
+                    short height, RegionPtr clipBoxes, DrawablePtr pDraw)
 {
     struct drm_vmw_control_stream_arg arg;
     unsigned short w, h;
@@ -468,7 +470,7 @@ vmw_video_port_play(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
         vmw_xv_stop_video(pScrn, port, TRUE);
         return port->play(pScrn, port, src_x, src_y, drw_x, drw_y, src_w,
                           src_h, drw_w, drw_h, format, buf, width, height,
-                          clipBoxes);
+                          clipBoxes, pDraw);
     }
 
     memcpy(port->bufs[port->currBuf].data, buf, port->size);
@@ -502,8 +504,14 @@ vmw_video_port_play(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
      */
     if (!REGION_EQUAL(pScrn->pScreen, &port->clipBoxes, clipBoxes)) {
         REGION_COPY(pScrn->pScreen, &port->clipBoxes, clipBoxes);
-        if (port->isAutoPaintColorkey)
-            xf86XVFillKeyHelper(pScrn->pScreen, port->colorKey, clipBoxes);
+        if (port->isAutoPaintColorkey) {
+            if (pDraw->type == DRAWABLE_WINDOW) {
+                xf86XVFillKeyHelperDrawable(pDraw, port->colorKey, clipBoxes);
+                DamageDamageRegion(pDraw, clipBoxes);
+            } else {
+                xf86XVFillKeyHelper(pScrn->pScreen, port->colorKey, clipBoxes);
+            }
+        }
     }
 
     xorg_flush(pScrn->pScreen);
@@ -667,7 +675,7 @@ vmw_xv_put_image(ScrnInfoPtr pScrn, short src_x, short src_y,
 		 width, height);
 
     return port->play(pScrn, port, src_x, src_y, drw_x, drw_y, src_w, src_h,
-                      drw_w, drw_h, format, buf, width, height, clipBoxes);
+                      drw_w, drw_h, format, buf, width, height, clipBoxes, dst);
 }
 
 

commit 43e043868fbd74e28cd392a3665b36abdfe87de0
Author: Jakob Bornecrantz <jakob@vmware.com>
Date:   Wed May 21 11:54:48 2014 +0200

    vmware/vmwgfx: A bit more error logging when handling cursors
    
    Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
    Reviewed-by: Thomas Hellström <thellstrom@vmware.com>

diff --git a/vmwgfx/vmwgfx_crtc.c b/vmwgfx/vmwgfx_crtc.c
index 3bc3b21..5fce5f7 100644
--- a/vmwgfx/vmwgfx_crtc.c
+++ b/vmwgfx/vmwgfx_crtc.c
@@ -300,8 +300,11 @@ crtc_load_cursor_argb_kms(xf86CrtcPtr crtc, CARD32 * image)
     if (!crtcp->cursor_bo) {
 	size_t size = 64*64*4;
         crtcp->cursor_bo = vmwgfx_dmabuf_alloc(ms->fd, size);
-	if (!crtcp->cursor_bo)
+	if (!crtcp->cursor_bo) {
+	    xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
+		       "Failed to create a dmabuf for cursor.\n");
 	    return;
+	}
 	crtcp->cursor_handle = crtcp->cursor_bo->handle;
     }
 
@@ -309,6 +312,9 @@ crtc_load_cursor_argb_kms(xf86CrtcPtr crtc, CARD32 * image)
     if (ptr) {
 	memcpy(ptr, image, 64*64*4);
 	vmwgfx_dmabuf_unmap(crtcp->cursor_bo);
+    } else {
+	xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
+		   "Failed to map cursor dmabuf.\n");
     }
 
     if (crtc->cursor_shown)

commit aa7309254808e27a4ac5d3dc674be179646280b5
Author: Jakob Bornecrantz <jakob@vmware.com>
Date:   Wed May 21 11:54:24 2014 +0200

    vmware/vmwgfx: Don't move cursors without images
    
    Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
    Reviewed-by: Thomas Hellström <thellstrom@vmware.com>

diff --git a/vmwgfx/vmwgfx_crtc.c b/vmwgfx/vmwgfx_crtc.c
index fec04c0..3bc3b21 100644
--- a/vmwgfx/vmwgfx_crtc.c
+++ b/vmwgfx/vmwgfx_crtc.c
@@ -276,6 +276,10 @@ crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y)
     modesettingPtr ms = modesettingPTR(crtc->scrn);
     struct crtc_private *crtcp = crtc->driver_private;
 
+    /* Seems like newer X servers try to move cursors without images */
+    if (!crtcp->cursor_bo)
+	return;
+
     drmModeMoveCursor(ms->fd, crtcp->drm_crtc->crtc_id, x, y);
 }
 

commit e8d6facf34adf1c601a3afd0a984ce90ad8fe059
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date:   Tue May 20 06:29:19 2014 -0700

    vmware/vmwgfx: Fix xwayland build on newer XA versions
    
    Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
    Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>

diff --git a/vmwgfx/vmwgfx_xwayland.c b/vmwgfx/vmwgfx_xwayland.c
index a16a7c4..5e25666 100644
--- a/vmwgfx/vmwgfx_xwayland.c
+++ b/vmwgfx/vmwgfx_xwayland.c
@@ -62,7 +62,7 @@ vmwgfx_create_window_buffer(struct xwl_window *xwl_window,
      * surface.
      */
     vpix->hw_is_hosted = TRUE;
-    if (xa_surface_handle(vpix->hw, &name, &pitch) != XA_ERR_NONE)
+    if (_xa_surface_handle(vpix->hw, &name, &pitch) != XA_ERR_NONE)
 	return BadDrawable;
 
     return xwl_create_window_buffer_drm(xwl_window, pixmap, name);

commit 268307e85c06be27345a6808bcf2b3c9887bf8bc
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Tue May 6 16:33:21 2014 +0200

    Add support for server managed fds
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>

diff --git a/src/vmware_bootstrap.c b/src/vmware_bootstrap.c
index b30cf2b..1635876 100644
--- a/src/vmware_bootstrap.c
+++ b/src/vmware_bootstrap.c
@@ -30,6 +30,7 @@
 #endif
 
 #include "xf86.h"
+#include <xorgVersion.h>
 #include "compiler.h"
 #include "xf86Pci.h"		/* pci */
 #include "vm_device_version.h"
@@ -496,6 +497,10 @@ VMWareDriverFunc(ScrnInfoPtr pScrn,
 			      pScrn->yDpi / 2) / pScrn->yDpi;
       }
       return TRUE;
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,902,0)
+   case SUPPORTS_SERVER_FDS:
+      return TRUE;
+#endif
    default:
       return FALSE;
    }
diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c
index 7e5dc4e..03103a8 100644
--- a/vmwgfx/vmwgfx_driver.c
+++ b/vmwgfx/vmwgfx_driver.c
@@ -54,6 +54,10 @@
 
 #include <pciaccess.h>
 
+#ifdef XSERVER_PLATFORM_BUS
+#include "xf86platformBus.h"
+#endif
+
 #include "vmwgfx_driver.h"
 
 #include <saa.h>
@@ -243,6 +247,15 @@ static const xf86CrtcConfigFuncsRec crtc_config_funcs = {
     .resize = drv_crtc_resize
 };
 
+static Bool vmwgfx_use_server_fd(modesettingPtr ms)
+{
+#ifdef XF86_PDEV_SERVER_FD
+    return ms->platform_dev && (ms->platform_dev->flags & XF86_PDEV_SERVER_FD);
+#else
+    return FALSE;
+#endif
+}
+
 static Bool
 drv_init_drm(ScrnInfoPtr pScrn)
 {
@@ -253,6 +266,12 @@ drv_init_drm(ScrnInfoPtr pScrn)
 
 	ms->fd = vmwgfx_hosted_drm_fd(ms->hdriver, ms->hosted, ms->PciInfo);
 
+#ifdef ODEV_ATTRIB_FD
+	if (ms->fd < 0 && vmwgfx_use_server_fd(ms))
+	    ms->fd = xf86_get_platform_device_int_attrib(ms->platform_dev,
+	                                                 ODEV_ATTRIB_FD, -1);
+#endif
+
 	if (ms->fd < 0) {
 
 	    char bus_id[64];
@@ -472,6 +491,9 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
 	goto out_err_bus;
     }
 
+    if (pEnt->location.type == BUS_PLATFORM)
+        ms->platform_dev = pEnt->location.id.plat;
+
     xf86SetPrimInitDone(pScrn->entityList[0]);
 
     ms->hdriver = vmwgfx_hosted_detect();
@@ -605,7 +627,7 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
     free(ms->Options);
   out_depth:
   out_drm_version:
-    if (!vmwgfx_is_hosted(ms->hdriver))
+    if (!vmwgfx_is_hosted(ms->hdriver) && !vmwgfx_use_server_fd(ms))
 	close(ms->fd);
   out_no_drm:
     vmwgfx_hosted_destroy(ms->hdriver, ms->hosted);
@@ -783,8 +805,8 @@ drv_set_master(ScrnInfoPtr pScrn)
 {
     modesettingPtr ms = modesettingPTR(pScrn);
 
-    if (!vmwgfx_is_hosted(ms->hdriver) && !ms->isMaster &&
-	drmSetMaster(ms->fd) != 0) {
+    if (!vmwgfx_is_hosted(ms->hdriver) && !vmwgfx_use_server_fd(ms) &&
+            !ms->isMaster && drmSetMaster(ms->fd) != 0) {
 	if (errno == EINVAL) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
 		       "drmSetMaster failed: 2.6.29 or newer kernel required for "
@@ -1184,7 +1206,8 @@ drv_leave_vt(VT_FUNC_ARGS_DECL)
 
     vmwgfx_saa_drop_master(pScrn->pScreen);
 
-    if (!vmwgfx_is_hosted(ms->hdriver) && drmDropMaster(ms->fd))
+    if (!vmwgfx_is_hosted(ms->hdriver) && !vmwgfx_use_server_fd(ms) &&
+            drmDropMaster(ms->fd))
 	xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
 		   "drmDropMaster failed: %s\n", strerror(errno));
     ms->isMaster = FALSE;
diff --git a/vmwgfx/vmwgfx_driver.h b/vmwgfx/vmwgfx_driver.h
index c044a81..31dfc0f 100644
--- a/vmwgfx/vmwgfx_driver.h
+++ b/vmwgfx/vmwgfx_driver.h
@@ -83,6 +83,7 @@ enum xorg_throttling_reason {
 };
 
 struct vmwgfx_hosted;
+struct xf86_platform_device;
 
 typedef struct _modesettingRec
 {
@@ -98,6 +99,7 @@ typedef struct _modesettingRec
     int Chipset;
     EntityInfoPtr pEnt;
     struct pci_device *PciInfo;
+    struct xf86_platform_device *platform_dev;
 
     /* Accel */
     Bool accelerate_render;

commit 675fe58eee8acdb302c3501236b86a3289991053
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Tue May 6 16:00:50 2014 +0200

    Add support for XSERVER_PLATFORM_BUS
    
    This is a preparation patch for adding support for server managed fds.
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>

diff --git a/src/vmware.c b/src/vmware.c
index 6b74e14..17434ab 100644
--- a/src/vmware.c
+++ b/src/vmware.c
@@ -310,9 +310,6 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
     pVMWARE->pvtSema = &pScrn->vtSema;
 
     pVMWARE->pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
-    if (pVMWARE->pEnt->location.type != BUS_PCI) {
-        return FALSE;
-    }
     pVMWARE->PciInfo = xf86GetPciInfoForEntity(pVMWARE->pEnt->index);
     if (pVMWARE->PciInfo == NULL) {
         return FALSE;
diff --git a/src/vmware_bootstrap.c b/src/vmware_bootstrap.c
index ed6c740..b30cf2b 100644
--- a/src/vmware_bootstrap.c
+++ b/src/vmware_bootstrap.c
@@ -50,6 +50,10 @@
 #include <xf86_libc.h>
 #endif
 
+#ifdef XSERVER_PLATFORM_BUS
+#include "xf86platformBus.h"
+#endif
+
 #ifdef HaveDriverFuncs
 #define VMWARE_DRIVER_FUNC HaveDriverFuncs
 #else
@@ -247,9 +251,6 @@ VMwarePreinitStub(ScrnInfoPtr pScrn, int flags)
     vmwlegacy_hookup(pScrn);
 
     pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
-    if (pEnt->location.type != BUS_PCI)
-        return FALSE;
-
     pciInfo = xf86GetPciInfoForEntity(pEnt->index);
     if (pciInfo == NULL)
         return FALSE;
@@ -407,6 +408,45 @@ VMWAREProbe(DriverPtr drv, int flags)
 }
 #endif
 
+#ifdef XSERVER_PLATFORM_BUS
+static Bool
+VMwarePlatformProbe(DriverPtr drv, int entity, int flags,
+                    struct xf86_platform_device *dev, intptr_t match_data)
+{
+    ScrnInfoPtr pScrn;
+    int scrnFlag = 0;
+
+    if (!dev->pdev)
+        return FALSE;
+
+    if (flags & PLATFORM_PROBE_GPU_SCREEN)
+        scrnFlag = XF86_ALLOCATE_GPU_SCREEN;
+
+    pScrn = xf86AllocateScreen(drv, scrnFlag);
+    if (!pScrn)
+        return FALSE;
+
+    if (xf86IsEntitySharable(entity))
+        xf86SetEntityShared(entity);
+
+    xf86AddEntityToScreen(pScrn, entity);
+
+    pScrn->driverVersion = VMWARE_DRIVER_VERSION;
+    pScrn->driverName = VMWARE_DRIVER_NAME;
+    pScrn->name = VMWARE_NAME;
+    pScrn->Probe = NULL;
+#ifdef BUILD_VMWGFX
+    vmwgfx_hookup(pScrn);
+#else
+    vmwlegacy_hookup(pScrn);
+#endif
+    pScrn->driverPrivate = pScrn->PreInit;
+    pScrn->PreInit = VMwarePreinitStub;
+
+    return TRUE;
+}
+#endif
+
 static void
 VMWAREIdentify(int flags)
 {
@@ -481,6 +521,14 @@ _X_EXPORT DriverRec vmware = {
 #if XSERVER_LIBPCIACCESS
     VMwareDeviceMatch,
     VMwarePciProbe,
+#else
+    NULL,
+    NULL,
+#endif
+#ifdef XSERVER_PLATFORM_BUS
+    VMwarePlatformProbe,
+#else
+    NULL,
 #endif
 };
 
diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c
index 2d38d2a..7e5dc4e 100644
--- a/vmwgfx/vmwgfx_driver.c
+++ b/vmwgfx/vmwgfx_driver.c
@@ -465,13 +465,13 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
 
     pScrn->displayWidth = 640;	       /* default it */
 
-    if (ms->pEnt->location.type != BUS_PCI) {
+    ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index);
+    if (!ms->PciInfo) {
 	xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		   "Incorrect bus for device.\n");
 	goto out_err_bus;
     }
 
-    ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index);
     xf86SetPrimInitDone(pScrn->entityList[0]);
 
     ms->hdriver = vmwgfx_hosted_detect();

commit 88c487cb19aaf2882d582f7f887a52935ef8d92e
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date:   Fri May 9 09:35:59 2014 +0200

    vmware/saa: Disable the noreadback polyfillrect optimization
    
    It causes rendering artefacts with some motif applications due to
    damage area confusion. Until that is sorted out, temporarily disable the
    optimization.
    
    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 e2bf3ac..deaeb8b 100644
--- a/saa/saa_unaccel.c
+++ b/saa/saa_unaccel.c
@@ -396,6 +396,7 @@ saa_check_poly_arc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * pArcs)
  * 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.
  */
+#if 0
 static Bool
 saa_check_poly_fill_rect_noreadback(DrawablePtr pDrawable, GCPtr pGC,
 				    int nrect, xRectangle *prect)
@@ -476,7 +477,7 @@ saa_check_poly_fill_rect_noreadback(DrawablePtr pDrawable, GCPtr pGC,
 
     return FALSE;
 }
-
+#endif
 void
 saa_check_poly_fill_rect(DrawablePtr pDrawable, GCPtr pGC,
 			 int nrect, xRectangle * prect)
@@ -487,8 +488,17 @@ saa_check_poly_fill_rect(DrawablePtr pDrawable, GCPtr pGC,
 
     SAA_FALLBACK(("to %p (%c)\n", pDrawable, saa_drawable_loc(pDrawable)));
 
+
+    /*
+     * Disable saa_check_poly_fill_rect_noreadback as it causes rendering
+     * artefacts with some motif applications. There seems to be some
+     * confusion with the damage area.
+     */
+
+#if 0
     if (saa_check_poly_fill_rect_noreadback(pDrawable, pGC, nrect, prect))
 	return;
+#endif
 
     sscreen->fallback_count++;
 

commit f31eed4a578784329a7038aa01acaa10a2d0c246
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date:   Thu May 8 09:24:04 2014 +0200

    vmware/vmwgfx: Fix initial dirty region for pixmaps
    
    When storage is attached to pixmaps for the first time the dirty region is
    set to cover either the hardware surface or the software buffer based on
    the presence of the hardware surface.
    
    However, if the storage was created as part of an accelerated operation,
    the dirty region was assigned before the hardware surface was assigned to the
    pixmap, causing the dirty region to incorrectly cover the software buffer.
    
    Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
    Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>

diff --git a/vmwgfx/vmwgfx_saa.c b/vmwgfx/vmwgfx_saa.c
index 99a289d..b9204c6 100644
--- a/vmwgfx/vmwgfx_saa.c
+++ b/vmwgfx/vmwgfx_saa.c
@@ -824,11 +824,11 @@ vmwgfx_create_hw(struct vmwgfx_saa *vsaa,
 	return FALSE;
 
     vpix->xa_flags = new_flags;
+    vpix->hw = hw;
 
     if (!vmwgfx_pixmap_add_damage(pixmap))
 	goto out_no_damage;
 
-    vpix->hw = hw;
     vpix->backing |= VMWGFX_PIX_SURFACE;
     vmwgfx_pixmap_free_storage(vpix);
 
@@ -841,6 +841,7 @@ vmwgfx_create_hw(struct vmwgfx_saa *vsaa,
     return TRUE;
 
 out_no_damage:
+    vpix->hw = NULL;
     xa_surface_destroy(hw);
     return FALSE;
 }

commit f9208ee13d7ecb6efac784514897c824c65e9365
Author: Julien Cristau <jcristau@debian.org>
Date:   Tue Apr 29 18:36:30 2014 +0200

    rules: avoid mixing implicit and normal rules; make 4 doesn't like that.

diff --git a/debian/changelog b/debian/changelog
index b9bf917..5cf4dd4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+xserver-xorg-video-vmware (1:13.0.2-3) UNRELEASED; urgency=medium
+
+  * rules: avoid mixing implicit and normal rules; make 4 doesn't like that.
+
+ -- Julien Cristau <jcristau@debian.org>  Tue, 29 Apr 2014 18:34:12 +0200
+
 xserver-xorg-video-vmware (1:13.0.2-2) unstable; urgency=medium
 
   * Fix build failure on kfreebsd (closes: #743239)
diff --git a/debian/rules b/debian/rules
index 7fa7b81..c601423 100755
--- a/debian/rules
+++ b/debian/rules
@@ -19,7 +19,10 @@ override_dh_install:
 override_dh_shlibdeps:
 	dh_shlibdeps -- --warnings=6
 
-build %:
-	dh $@ --with quilt,autoreconf,xsf --builddirectory=build/
+build:
+	dh build --with quilt,autoreconf,xsf --builddirectory=build/
 
 .PHONY: build
+
+%:
+	dh $@ --with quilt,autoreconf,xsf --builddirectory=build/

commit 1ed14687a3f1092db8504fb9cf4f446451801665
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date:   Thu Apr 10 14:05:24 2014 +0200

    vmware/vmwgfx: Set desired modes after xMir screen init
    
    While XMir does initial mode configuration, it leaves setting initial
    modes to the DDX driver.
    
    Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
    Reviewed-by: Brian Paul <brianp@vmware.com>

diff --git a/vmwgfx/vmwgfx_xmir.c b/vmwgfx/vmwgfx_xmir.c
index ede6753..89dbaf3 100644
--- a/vmwgfx/vmwgfx_xmir.c
+++ b/vmwgfx/vmwgfx_xmir.c
@@ -36,6 +36,7 @@
 
 #include "vmwgfx_hosted.h"
 #include "vmwgfx_saa.h"
+#include <xf86Crtc.h>
 #include <xf86Priv.h>
 #include <xmir.h>
 
@@ -103,6 +104,11 @@ vmwgfx_xmir_screen_init(struct vmwgfx_hosted *hosted, ScreenPtr pScreen)
 	return FALSE;
 
     hosted->pScreen = pScreen;
+    if (!xf86SetDesiredModes(hosted->pScrn)) {
+	xmir_screen_close(hosted->pScreen, hosted->xmir);
+	hosted->pScreen = NULL;
+	return FALSE;
+    }
 
     return TRUE;
 }


Reply to: