diff options
author | Michel Dänzer <daenzer@vmware.com> | 2009-08-27 09:52:11 +0200 |
---|---|---|
committer | Michel Dänzer <daenzer@vmware.com> | 2009-08-27 09:52:11 +0200 |
commit | 066c90e8f5b93c80195dc43486ad3efa083a1f3a (patch) | |
tree | 5e223c7fbeb22ba2c0e5119673109e21cdefa048 | |
parent | 174b61bb786a841cebd354e23b4b0caa85b541aa (diff) |
KMS: Don't use a blit for UploadToScreen if the pixmap BO will be idle anyway.
Direct CPU writes should be at least as fast in that case.
-rw-r--r-- | src/radeon_exa_funcs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c index d95adb5..58cd527 100644 --- a/src/radeon_exa_funcs.c +++ b/src/radeon_exa_funcs.c @@ -455,6 +455,7 @@ RADEONUploadToScreenCS(PixmapPtr pDst, int x, int y, int w, int h, struct radeon_bo *scratch; unsigned size; uint32_t datatype = 0; + uint32_t dst_domain; uint32_t dst_pitch_offset; unsigned bpp = pDst->drawable.bitsPerPixel; uint32_t scratch_pitch = (w * bpp / 8 + 63) & ~63; @@ -466,6 +467,11 @@ RADEONUploadToScreenCS(PixmapPtr pDst, int x, int y, int w, int h, driver_priv = exaGetPixmapDriverPrivate(pDst); + /* If we know the BO won't be busy, don't bother */ + if (driver_priv->bo->cref == 1 && + !radeon_bo_is_busy(driver_priv->bo, &dst_domain)) + return FALSE; + size = scratch_pitch * h; scratch = radeon_bo_open(info->bufmgr, 0, size, 0, RADEON_GEM_DOMAIN_GTT, 0); if (scratch == NULL) { |