From 03dca39afa06da04472d56ec4888f010186c6a13 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Tue, 7 Sep 2010 21:55:28 +0200 Subject: vmwlegacy: A number of Xv fixes Properly init and uninit the port private clipboxes on setup and end. Clear the port private clipboxes on video stop, to force re-painting of the colorkey when the stream is resumed. Make sure the colorkey is painted *before* the overlay is flushed. Some host implementations seem picky about this. Signed-off-by: Thomas Hellstrom --- src/vmwarevideo.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/vmwarevideo.c b/src/vmwarevideo.c index 7f78887..4ce0d5d 100644 --- a/src/vmwarevideo.c +++ b/src/vmwarevideo.c @@ -510,6 +510,7 @@ vmwareVideoEnd(ScreenPtr pScreen) pVid = (VMWAREVideoPtr) &pVMWARE->videoStreams[VMWARE_VID_NUM_PORTS]; for (i = 0; i < VMWARE_VID_NUM_PORTS; ++i) { vmwareVideoEndStream(pScrn, &pVid[i]); + REGION_UNINIT(pScreen, &pVid[i].clipBoxes); } free(pVMWARE->videoStreams); @@ -577,6 +578,7 @@ vmwareVideoSetup(ScrnInfoPtr pScrn) pPriv[i].flags = SVGA_VIDEO_FLAG_COLORKEY; pPriv[i].colorKey = VMWARE_VIDEO_COLORKEY; pPriv[i].isAutoPaintColorkey = TRUE; + REGION_NULL(pScreen, &pPriv[i].clipBoxes); adaptor->pPortPrivates[i].ptr = &pPriv[i]; } pVMWARE->videoStreams = du; @@ -671,7 +673,17 @@ vmwareVideoInitStream(ScrnInfoPtr pScrn, VMWAREVideoPtr pVid, REGION_COPY(pScrn->pScreen, &pVid->clipBoxes, clipBoxes); if (pVid->isAutoPaintColorkey) { + BoxPtr boxes = REGION_RECTS(&pVid->clipBoxes); + int nBoxes = REGION_NUM_RECTS(&pVid->clipBoxes); + xf86XVFillKeyHelper(pScrn->pScreen, pVid->colorKey, clipBoxes); + + /** + * Force update to paint the colorkey before the overlay flush. + */ + + while(nBoxes--) + vmwareSendSVGACmdUpdate(pVMWARE, boxes++); } VmwareLog(("Got offscreen region, offset %d, size %d " @@ -841,7 +853,18 @@ vmwareVideoPlay(ScrnInfoPtr pScrn, VMWAREVideoPtr pVid, if (!vmwareIsRegionEqual(&pVid->clipBoxes, clipBoxes)) { REGION_COPY(pScrn->pScreen, &pVid->clipBoxes, clipBoxes); if (pVid->isAutoPaintColorkey) { + BoxPtr boxes = REGION_RECTS(&pVid->clipBoxes); + int nBoxes = REGION_NUM_RECTS(&pVid->clipBoxes); + xf86XVFillKeyHelper(pScrn->pScreen, pVid->colorKey, clipBoxes); + + /** + * Force update to paint the colorkey before the overlay flush. + */ + + while(nBoxes--) + vmwareSendSVGACmdUpdate(pVMWARE, boxes++); + } } @@ -1093,6 +1116,9 @@ vmwareStopVideo(ScrnInfoPtr pScrn, pointer data, Bool Cleanup) if (!vmwareVideoEnabled(pVMWARE)) { return; } + + REGION_EMPTY(pScrn->pScreen, &pVid->clipBoxes); + if (!Cleanup) { VmwareLog(("vmwareStopVideo: Cleanup is FALSE.\n")); return; -- cgit v1.2.3