From fde2990e26ffb0736e78a82178a31df8807cf1ed Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 17 Dec 2008 14:25:22 -0800 Subject: uxa: Do a hack to use the aperture mapping instead of bo_map in sw fallbacks. Because of how fallbacky the uxa rendering core is, and our inability (without wfb in userland or page faulting in the kernel) to tell the kernel just where we're going to fall back, the clflush overhead can become outrageous, for example with emacs and xcompmgr. Instead of using drm_intel_bo_map, pin the buffer and do the fallback to the aperture mapping. This gets us the bad old performance that fb is designed for, instead of bad new performance. (cherry picked from commit aae4008096399a0e84abc7c016b35092caf9db25) --- src/i830_exa.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/i830_exa.c b/src/i830_exa.c index 4a046447..636aa0af 100644 --- a/src/i830_exa.c +++ b/src/i830_exa.c @@ -785,17 +785,11 @@ i830_uxa_prepare_access (PixmapPtr pixmap, uxa_access_t access) i830->need_sync = FALSE; } - /* For tiled front buffer, short-circuit to the GTT mapping. */ - if (i830_pixmap_tiled(pixmap)) { - drm_intel_gem_bo_start_gtt_access(bo, access == UXA_ACCESS_RW); - - pixmap->devPrivate.ptr = pI830->FbBase + bo->offset; - } else { - if (dri_bo_map (bo, access == UXA_ACCESS_RW) != 0) - return FALSE; + if (drm_intel_bo_pin(bo, 4096) != 0) + return FALSE; - pixmap->devPrivate.ptr = bo->virtual; - } + drm_intel_gem_bo_start_gtt_access(bo, access == UXA_ACCESS_RW); + pixmap->devPrivate.ptr = pI830->FbBase + bo->offset; } return TRUE; } @@ -810,8 +804,7 @@ i830_uxa_finish_access (PixmapPtr pixmap) ScrnInfoPtr scrn = xf86Screens[screen->myNum]; I830Ptr i830 = I830PTR(scrn); - if (!i830_pixmap_tiled(pixmap)) - dri_bo_unmap(bo); + drm_intel_bo_unpin(bo); pixmap->devPrivate.ptr = NULL; if (bo == i830->front_buffer->bo) -- cgit v1.2.3