summaryrefslogtreecommitdiff
path: root/src/gallium/targets/xorg-vmwgfx/vmw_video.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/targets/xorg-vmwgfx/vmw_video.c')
-rw-r--r--src/gallium/targets/xorg-vmwgfx/vmw_video.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/gallium/targets/xorg-vmwgfx/vmw_video.c b/src/gallium/targets/xorg-vmwgfx/vmw_video.c
index 94465e5204..7979209993 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);
@@ -448,7 +450,16 @@ vmw_video_init_adaptor(ScrnInfoPtr pScrn, struct vmw_customizer *vmw)
vmw->video_priv = video;
adaptor->type = XvInputMask | XvImageMask | XvWindowMask;
- adaptor->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT;
+
+ /**
+ * Note: CLIP_TO_VIEWPORT was removed from the flags, since with the
+ * crtc/output based modesetting, the viewport is not updated on
+ * RandR modeswitches. Hence the video may incorrectly be clipped away.
+ * The correct approach, (if needed) would be to clip against the
+ * scanout area union of all active crtcs. Revisit if needed.
+ */
+
+ adaptor->flags = VIDEO_OVERLAID_IMAGES;
adaptor->name = "VMware Video Engine";
adaptor->nEncodings = VMWARE_VID_NUM_ENCODINGS;
adaptor->pEncodings = vmwareVideoEncodings;
@@ -463,6 +474,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];
}
@@ -554,7 +566,9 @@ 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);
+ 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);
@@ -641,11 +655,12 @@ vmw_video_port_play(ScrnInfoPtr pScrn, struct vmw_video_port *port,
*/
if (!REGION_EQUAL(pScrn->pScreen, &port->clipBoxes, clipBoxes)) {
REGION_COPY(pScrn->pScreen, &port->clipBoxes, clipBoxes);
- if (port->isAutoPaintColorkey) {
+ if (port->isAutoPaintColorkey)
xf86XVFillKeyHelper(pScrn->pScreen, port->colorKey, clipBoxes);
- }
}
+ xorg_flush(pScrn->pScreen);
+
ret = drmCommandWrite(vmw->fd, DRM_VMW_CONTROL_STREAM, &arg, sizeof(arg));
if (ret) {
vmw_video_port_cleanup(pScrn, port);
@@ -865,6 +880,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;