Mesa (master): gallium/targets/xorg-vmwgfx: Xv fixes

Thomas Hellstrom thomash at kemper.freedesktop.org
Wed Nov 24 14:25:25 UTC 2010


Module: Mesa
Branch: master
Commit: f20a219e9e0815209b021c43d6331d578cd38ea7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f20a219e9e0815209b021c43d6331d578cd38ea7

Author: Thomas Hellstrom <thellstrom at vmware.com>
Date:   Wed Nov 24 15:18:15 2010 +0100

gallium/targets/xorg-vmwgfx: Xv fixes

Make sure regions are properly updated and that the colorkey painting is
flushed before we update the HW overlay.

Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>

---

 src/gallium/targets/xorg-vmwgfx/vmw_video.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/gallium/targets/xorg-vmwgfx/vmw_video.c b/src/gallium/targets/xorg-vmwgfx/vmw_video.c
index 94465e5..719646a 100644
--- a/src/gallium/targets/xorg-vmwgfx/vmw_video.c
+++ b/src/gallium/targets/xorg-vmwgfx/vmw_video.c
@@ -362,8 +362,10 @@ vmw_video_close(struct vmw_customizer *vmw)
 	/* make sure the port is stoped as well */
 	vmw_xv_stop_video(pScrn, &video->port[i], TRUE);
 	vmw_ioctl_unref_stream(vmw, video->port[i].streamId);
+	REGION_UNINIT(pScreen, &video->port[i].clipBoxes);
     }
 
+
     /* XXX: I'm sure this function is missing code for turning off Xv */
 
     free(vmw->video_priv);
@@ -463,6 +465,7 @@ vmw_video_init_adaptor(ScrnInfoPtr pScrn, struct vmw_customizer *vmw)
         video->port[i].flags = SVGA_VIDEO_FLAG_COLORKEY;
         video->port[i].colorKey = VMWARE_VIDEO_COLORKEY;
         video->port[i].isAutoPaintColorkey = TRUE;
+        REGION_NULL(pScrn->pScreen, &video->port[i].clipBoxes);
         adaptor->pPortPrivates[i].ptr = &video->port[i];
     }
 
@@ -553,8 +556,10 @@ vmw_video_port_init(ScrnInfoPtr pScrn, struct vmw_video_port *port,
 
     REGION_COPY(pScrn->pScreen, &port->clipBoxes, clipBoxes);
 
-    if (port->isAutoPaintColorkey)
-        xf86XVFillKeyHelper(pScrn->pScreen, port->colorKey, clipBoxes);
+    if (port->isAutoPaintColorkey) {
+	xf86XVFillKeyHelper(pScrn->pScreen, port->colorKey, clipBoxes);
+	xorg_flush(pScrn->pScreen);
+    }
 
     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);
@@ -643,6 +648,7 @@ vmw_video_port_play(ScrnInfoPtr pScrn, struct vmw_video_port *port,
         REGION_COPY(pScrn->pScreen, &port->clipBoxes, clipBoxes);
         if (port->isAutoPaintColorkey) {
             xf86XVFillKeyHelper(pScrn->pScreen, port->colorKey, clipBoxes);
+	    xorg_flush(pScrn->pScreen);
         }
     }
 
@@ -865,6 +871,8 @@ vmw_xv_stop_video(ScrnInfoPtr pScrn, pointer data, Bool cleanup)
     if (!vmw->video_priv)
         return;
 
+    REGION_EMPTY(pScrn->pScreen, &port->clipBoxes);
+
     if (!cleanup)
         return;
 




More information about the mesa-commit mailing list