summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2011-12-14 10:18:16 +0100
committerThomas Hellstrom <thellstrom@vmware.com>2011-12-15 08:30:29 +0100
commit0eef22437093d29f572abea845fff9c03fca5e4e (patch)
tree16b21627bc66981fbf8f34317733f4ac2d4b4af3
parentafd2f828b8a8b2ccc6ebe4d56104db3d03d08493 (diff)
downloadxf86-video-vmware-0eef22437093d29f572abea845fff9c03fca5e4e.tar.gz
xf86-video-vmware-0eef22437093d29f572abea845fff9c03fca5e4e.tar.bz2
xf86-video-vmware-0eef22437093d29f572abea845fff9c03fca5e4e.zip
saa: Only try to accelerate pixmaps that are driver pixmaps
Trying to accelerate scratch pixmaps doesn't work currently, and I'm not sure it's a big benefit either. This is in line with what EXA does. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrants <jakob@vmware.com>
-rw-r--r--saa/saa_accel.c5
-rw-r--r--saa/saa_render.c15
2 files changed, 19 insertions, 1 deletions
diff --git a/saa/saa_accel.c b/saa/saa_accel.c
index 7bd5d61..5e1501b 100644
--- a/saa/saa_accel.c
+++ b/saa/saa_accel.c
@@ -61,6 +61,11 @@ saa_hw_copy_nton(DrawablePtr pSrcDrawable,
src_spix = saa_pixmap(pSrcPixmap);
dst_spix = saa_pixmap(pDstPixmap);
+ if (src_spix->auth_loc != saa_loc_driver ||
+ dst_spix->auth_loc != saa_loc_driver)
+ return FALSE;
+
+
ordering = (nbox == 1 || (dx > 0 && dy > 0) ||
(pDstDrawable != pSrcDrawable &&
(pDstDrawable->type != DRAWABLE_WINDOW ||
diff --git a/saa/saa_render.c b/saa/saa_render.c
index 6bd58f7..3c441da 100644
--- a/saa/saa_render.c
+++ b/saa/saa_render.c
@@ -235,11 +235,18 @@ saa_driver_composite(CARD8 op,
return FALSE;
dst_pix = saa_get_pixmap(pDst->pDrawable, &dst_off_x, &dst_off_y);
+ if (saa_pixmap(dst_pix)->auth_loc != saa_loc_driver)
+ return FALSE;
+
if (pMask && pMask->pDrawable) {
mask_pix = saa_get_pixmap(pMask->pDrawable, &mask_off_x, &mask_off_y);
+ if (saa_pixmap(mask_pix)->auth_loc != saa_loc_driver)
+ return FALSE;
}
if (pSrc->pDrawable) {
src_pix = saa_get_pixmap(pSrc->pDrawable, &src_off_x, &src_off_y);
+ if (saa_pixmap(src_pix)->auth_loc != saa_loc_driver)
+ return FALSE;
}
if (!driver->composite_prepare(driver, op, pSrc, pMask, pDst,
@@ -304,6 +311,10 @@ saa_copy_composite(CARD8 op,
ySrc + height > pSrc->pDrawable->height)
return FALSE;
+ if (saa_pixmap(saa_get_drawable_pixmap(pSrc->pDrawable))->auth_loc !=
+ saa_loc_driver)
+ return FALSE;
+
if ((op == PictOpSrc &&
(pSrc->format == pDst->format ||
(PICT_FORMAT_COLOR(pDst->format) &&
@@ -318,8 +329,10 @@ saa_copy_composite(CARD8 op,
!PICT_FORMAT_A(pSrc->format))) {
Bool ret;
int xoff, yoff;
+ PixmapPtr pixmap = saa_get_pixmap(pDst->pDrawable, &xoff, &yoff);
- saa_get_pixmap(pDst->pDrawable, &xoff, &yoff);
+ if (saa_pixmap(pixmap)->auth_loc != saa_loc_driver)
+ return FALSE;
xDst += pDst->pDrawable->x;
yDst += pDst->pDrawable->y;