[Intel-gfx] [PATCH] uxa: Do a little hack to use bo_pin instead of bo_map.

Eric Anholt eric at anholt.net
Wed Dec 17 23:40:23 CET 2008


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.
---
 src/i830_exa.c |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/src/i830_exa.c b/src/i830_exa.c
index 3e3487e..df2a5ab 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)
-- 
1.5.6.5




More information about the Intel-gfx mailing list