summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@vmware.com>2014-05-21 11:51:46 +0200
committerJakob Bornecrantz <jakob@vmware.com>2014-05-23 12:57:00 +0200
commit82c9b0c1d34459c568d004521e3f35a69f5d7ae3 (patch)
tree767952815c4ebf3558fb2a3aa1596ceca9a5d93d
parent43e043868fbd74e28cd392a3665b36abdfe87de0 (diff)
vmware/vmwgfx: Fix auto colorkey fill usage
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Reviewed-by: Thomas Hellström <thellstrom@vmware.com>
-rw-r--r--vmwgfx/vmwgfx_overlay.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/vmwgfx/vmwgfx_overlay.c b/vmwgfx/vmwgfx_overlay.c
index 2c0d7fa..ef1d541 100644
--- a/vmwgfx/vmwgfx_overlay.c
+++ b/vmwgfx/vmwgfx_overlay.c
@@ -162,7 +162,7 @@ struct vmwgfx_overlay_port
int (*play)(ScrnInfoPtr, struct vmwgfx_overlay_port *,
short, short, short, short, short,
short, short, short, int, unsigned char*,
- short, short, RegionPtr);
+ short, short, RegionPtr, DrawablePtr);
/* values to go into the SVGAOverlayUnit */
uint32 streamId;
@@ -217,13 +217,15 @@ static int vmw_video_port_init(ScrnInfoPtr pScrn,
short drw_y, short src_w, short src_h,
short drw_w, short drw_h, int format,
unsigned char *buf, short width,
- short height, RegionPtr clipBoxes);
+ short height, RegionPtr clipBoxes,
+ DrawablePtr pDraw);
static int vmw_video_port_play(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
short src_x, short src_y, short drw_x,
short drw_y, short src_w, short src_h,
short drw_w, short drw_h, int format,
unsigned char *buf, short width,
- short height, RegionPtr clipBoxes);
+ short height, RegionPtr clipBoxes,
+ DrawablePtr pDraw);
static void vmw_video_port_cleanup(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port);
static int vmw_video_buffer_alloc(int drm_fd, int size,
@@ -380,7 +382,7 @@ vmw_video_port_init(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
short drw_y, short src_w, short src_h,
short drw_w, short drw_h, int format,
unsigned char *buf, short width,
- short height, RegionPtr clipBoxes)
+ short height, RegionPtr clipBoxes, DrawablePtr pDraw)
{
unsigned short w, h;
int i, ret;
@@ -412,7 +414,7 @@ vmw_video_port_init(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
REGION_NULL(pScrn->pScreen, &port->clipBoxes);
port->play = vmw_video_port_play;
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);
+ drw_w, drw_h, format, buf, width, height, clipBoxes, pDraw);
out_no_buffer:
while(i-- != 0) {
@@ -448,7 +450,7 @@ vmw_video_port_play(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
short drw_y, short src_w, short src_h,
short drw_w, short drw_h, int format,
unsigned char *buf, short width,
- short height, RegionPtr clipBoxes)
+ short height, RegionPtr clipBoxes, DrawablePtr pDraw)
{
struct drm_vmw_control_stream_arg arg;
unsigned short w, h;
@@ -468,7 +470,7 @@ vmw_video_port_play(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
vmw_xv_stop_video(pScrn, port, TRUE);
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);
+ clipBoxes, pDraw);
}
memcpy(port->bufs[port->currBuf].data, buf, port->size);
@@ -502,8 +504,14 @@ vmw_video_port_play(ScrnInfoPtr pScrn, struct vmwgfx_overlay_port *port,
*/
if (!REGION_EQUAL(pScrn->pScreen, &port->clipBoxes, clipBoxes)) {
REGION_COPY(pScrn->pScreen, &port->clipBoxes, clipBoxes);
- if (port->isAutoPaintColorkey)
- xf86XVFillKeyHelper(pScrn->pScreen, port->colorKey, clipBoxes);
+ if (port->isAutoPaintColorkey) {
+ if (pDraw->type == DRAWABLE_WINDOW) {
+ xf86XVFillKeyHelperDrawable(pDraw, port->colorKey, clipBoxes);
+ DamageDamageRegion(pDraw, clipBoxes);
+ } else {
+ xf86XVFillKeyHelper(pScrn->pScreen, port->colorKey, clipBoxes);
+ }
+ }
}
xorg_flush(pScrn->pScreen);
@@ -667,7 +675,7 @@ vmw_xv_put_image(ScrnInfoPtr pScrn, short src_x, short src_y,
width, height);
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);
+ drw_w, drw_h, format, buf, width, height, clipBoxes, dst);
}