summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2011-03-29 13:03:39 +0200
committerThomas Hellstrom <thellstrom@vmware.com>2011-03-30 10:52:38 +0200
commitc02d5977015983473a9bbae97ec65ce70a5faa3b (patch)
tree10c844dfa5b87f1cd90a0f8a28983ccc0932cecb
parentb234d7d6925b480a9c4fe23e5100e6fe7e5c0eac (diff)
vmwlegacy: Make sure we draw the colorkey to the right drawable
Don't draw the colorkey to the screen drawable, but to the video drawable when possible. Also change the Xv API/ABI test to use the builtin ABI version functions. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Michel Dänzer <daenzer@vmware.com>
-rw-r--r--configure.ac4
-rw-r--r--src/vmwarevideo.c50
2 files changed, 37 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac
index e3dcf30..cd2854e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -81,10 +81,6 @@ PKG_CHECK_EXISTS([xorg-server >= 1.1.0],
[AC_DEFINE([HAVE_XORG_SERVER_1_1_0], 1,
[Has version 1.1.0 or greater of the Xserver])])
-PKG_CHECK_EXISTS([xorg-server >= 1.0.99.901],
- [AC_DEFINE([HAVE_XORG_SERVER_1_0_99_901], 1,
- [Has version 1.0.99.901 or greater of the Xserver])])
-
PKG_CHECK_EXISTS([xorg-server >= 1.2.0],
[AC_DEFINE([HAVE_XORG_SERVER_1_2_0], 1,
[Has version 1.2.0 or greater of the Xserver])])
diff --git a/src/vmwarevideo.c b/src/vmwarevideo.c
index 4ce0d5d..71f21fe 100644
--- a/src/vmwarevideo.c
+++ b/src/vmwarevideo.c
@@ -51,6 +51,12 @@
#include <xf86_libc.h>
#endif
+
+#define HAVE_FILLKEYHELPERDRAWABLE \
+ ((GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 2) || \
+ ((GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) == 1) && \
+ (GET_ABI_MINOR(ABI_VIDEODRV_VERSION) >= 2)))
+
#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
/*
@@ -159,7 +165,7 @@ struct VMWAREVideoRec {
int (*play)(ScrnInfoPtr, struct VMWAREVideoRec *,
short, short, short, short, short,
short, short, short, int, unsigned char*,
- short, short, RegionPtr);
+ short, short, RegionPtr, DrawablePtr);
/*
* Offscreen memory region used to pass video data to the host.
*/
@@ -180,7 +186,7 @@ typedef VMWAREVideoRec *VMWAREVideoPtr;
/*
* Callback functions
*/
-#ifdef HAVE_XORG_SERVER_1_0_99_901
+#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 1)
static int vmwareXvPutImage(ScrnInfoPtr pScrn, 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 image,
@@ -217,7 +223,8 @@ static int vmwareVideoInitStream(ScrnInfoPtr pScrn, VMWAREVideoPtr pVid,
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 draw);
static int vmwareVideoInitAttributes(ScrnInfoPtr pScrn, VMWAREVideoPtr pVid,
int format, unsigned short width,
unsigned short height);
@@ -226,7 +233,8 @@ static int vmwareVideoPlay(ScrnInfoPtr pScrn, VMWAREVideoPtr pVid,
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 draw);
static void vmwareVideoFlush(VMWAREPtr pVMWARE, uint32 streamId);
static void vmwareVideoSetOneReg(VMWAREPtr pVMWARE, uint32 streamId,
uint32 regId, uint32 value);
@@ -631,7 +639,8 @@ vmwareVideoInitStream(ScrnInfoPtr pScrn, VMWAREVideoPtr pVid,
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 draw)
{
VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
int i;
@@ -676,8 +685,11 @@ vmwareVideoInitStream(ScrnInfoPtr pScrn, VMWAREVideoPtr pVid,
BoxPtr boxes = REGION_RECTS(&pVid->clipBoxes);
int nBoxes = REGION_NUM_RECTS(&pVid->clipBoxes);
+#if HAVE_FILLKEYHELPERDRAWABLE
+ xf86XVFillKeyHelperDrawable(draw, pVid->colorKey, clipBoxes);
+#else
xf86XVFillKeyHelper(pScrn->pScreen, pVid->colorKey, clipBoxes);
-
+#endif
/**
* Force update to paint the colorkey before the overlay flush.
*/
@@ -691,7 +703,8 @@ vmwareVideoInitStream(ScrnInfoPtr pScrn, VMWAREVideoPtr pVid,
pVid->fbarea->offset, pVid->fbarea->size, pVid->size));
return pVid->play(pScrn, pVid, 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,
+ draw);
}
@@ -761,7 +774,8 @@ vmwareVideoPlay(ScrnInfoPtr pScrn, VMWAREVideoPtr pVid,
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 draw)
{
VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
uint32 *fifoItem;
@@ -803,7 +817,7 @@ vmwareVideoPlay(ScrnInfoPtr pScrn, VMWAREVideoPtr pVid,
vmwareStopVideo(pScrn, pVid, TRUE);
return pVid->play(pScrn, pVid, src_x, src_y, drw_x, drw_y, src_w,
src_h, drw_w, drw_h, format, buf, width, height,
- clipBoxes);
+ clipBoxes, draw);
}
pVid->size = size;
@@ -856,8 +870,11 @@ vmwareVideoPlay(ScrnInfoPtr pScrn, VMWAREVideoPtr pVid,
BoxPtr boxes = REGION_RECTS(&pVid->clipBoxes);
int nBoxes = REGION_NUM_RECTS(&pVid->clipBoxes);
- xf86XVFillKeyHelper(pScrn->pScreen, pVid->colorKey, clipBoxes);
-
+#if HAVE_FILLKEYHELPERDRAWABLE
+ xf86XVFillKeyHelperDrawable(draw, pVid->colorKey, clipBoxes);
+#else
+ xf86XVFillKeyHelper(pScrn->pScreen, pVid->colorKey, clipBoxes);
+#endif
/**
* Force update to paint the colorkey before the overlay flush.
*/
@@ -1056,7 +1073,7 @@ vmwareVideoEndStream(ScrnInfoPtr pScrn, VMWAREVideoPtr pVid)
*-----------------------------------------------------------------------------
*/
-#ifdef HAVE_XORG_SERVER_1_0_99_901
+#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 1)
static int
vmwareXvPutImage(ScrnInfoPtr pScrn, short src_x, short src_y,
short drw_x, short drw_y, short src_w, short src_h,
@@ -1082,8 +1099,15 @@ vmwareXvPutImage(ScrnInfoPtr pScrn, short src_x, short src_y,
return XvBadAlloc;
}
+#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 1)
return pVid->play(pScrn, pVid, 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);
+#else
+ return pVid->play(pScrn, pVid, src_x, src_y, drw_x, drw_y, src_w, src_h,
+ drw_w, drw_h, format, buf, width, height, clipBoxes,
+ NULL);
+#endif
}