From bcc454ea2fb239e13942270faec7801270615b9c Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 6 Jan 2014 09:52:50 -0500 Subject: radeon/exa: Always use a scratch surface for UTS to vram MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we don't, we may hit a buffer that crosses the visible vram boundary resulting in a sigbus when the CPU accesses the buffer beyond the PCI aperture. This will introduce an extra copy in certain cases. This is based on Michel's patch from bug 44099 updated for all asic families. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=44099 Signed-off-by: Alex Deucher Reviewed-by: Michel Dänzer --- src/radeon_exa_funcs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/radeon_exa_funcs.c') diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c index d9340c5f..d9013057 100644 --- a/src/radeon_exa_funcs.c +++ b/src/radeon_exa_funcs.c @@ -403,13 +403,14 @@ RADEONUploadToScreenCS(PixmapPtr pDst, int x, int y, int w, int h, } #endif - /* If we know the BO won't be busy, don't bother with a scratch */ + /* If we know the BO won't be busy / in VRAM, don't bother with a scratch */ copy_dst = driver_priv->bo; copy_pitch = pDst->devKind; if (!(driver_priv->tiling_flags & (RADEON_TILING_MACRO | RADEON_TILING_MICRO))) { if (!radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs)) { flush = FALSE; - if (!radeon_bo_is_busy(driver_priv->bo, &dst_domain)) + if (!radeon_bo_is_busy(driver_priv->bo, &dst_domain) && + !(dst_domain & RADEON_GEM_DOMAIN_VRAM)) goto copy; } /* use cpu copy for fast fb access */ -- cgit v1.2.3