From 066c90e8f5b93c80195dc43486ad3efa083a1f3a Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 27 Aug 2009 09:52:11 +0200 Subject: 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. --- src/radeon_exa_funcs.c | 6 ++++++ 1 file changed, 6 insertions(+) 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) { -- cgit v1.2.3