summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2010-09-07 21:55:28 +0200
committerThomas Hellstrom <thellstrom@vmware.com>2010-09-07 21:59:37 +0200
commit03dca39afa06da04472d56ec4888f010186c6a13 (patch)
tree4ae0a6f950a7f60b693847389851cc3e39ec26c3
parentdfb062e024dfd20789ee8d43c7f94640faa5ea9f (diff)
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 <thellstrom@vmware.com>
-rw-r--r--src/vmwarevideo.c26
1 files changed, 26 insertions, 0 deletions
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;