diff options
author | Christoph Bumiller <e0425955@student.tuwien.ac.at> | 2010-12-19 21:46:33 +0100 |
---|---|---|
committer | Christoph Bumiller <e0425955@student.tuwien.ac.at> | 2010-12-19 21:46:33 +0100 |
commit | 0f68236a2487dbeb0396b996debcda595b0b54a1 (patch) | |
tree | 938ae3b779349b6dba6f5a891550604f9a9ca895 /src/gallium/targets/xorg-vmwgfx/vmw_video.c | |
parent | d047168d81cfeb39a98f3ae16416872facc6237c (diff) | |
parent | 237880463d5168cad8df0bae6018b5fd76617777 (diff) |
Merge remote branch 'origin/master' into nvc0-new
Diffstat (limited to 'src/gallium/targets/xorg-vmwgfx/vmw_video.c')
-rw-r--r-- | src/gallium/targets/xorg-vmwgfx/vmw_video.c | 25 |
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; |