[Intel-gfx] [PATCH] uxa: use vtSema for pixmap access fallback to bo_map

Zhenyu Wang zhenyu.z.wang at intel.com
Tue Jan 6 07:56:22 CET 2009


My last patch for pixmap access in vt switch looks still
broken. Instead of figuring out what private field is
good for pixmap bo, this simply uses vtSema that will fallback
to bo map/unmap in vt switched case.

I think it's enough for pushing 2.6 out.

---
 src/i830_exa.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/i830_exa.c b/src/i830_exa.c
index aeffedd..109e41e 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -785,14 +785,15 @@ i830_uxa_prepare_access (PixmapPtr pixmap, uxa_access_t access)
 	    i830->need_sync = FALSE;
 	}
 
-	if (drm_intel_bo_pin(bo, 4096) != 0) {
-	    /* happen in vt switched */
-	    if (dri_bo_map(bo, access == UXA_ACCESS_RW) != 0)
+	if (scrn->vtSema) {
+	    if (drm_intel_bo_pin(bo, 4096) != 0)
 		return FALSE;
-	    pixmap->devPrivate.ptr = bo->virtual;
-	} else {
 	    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;
+	    pixmap->devPrivate.ptr = bo->virtual;
 	}
     }
     return TRUE;
@@ -808,10 +809,10 @@ i830_uxa_finish_access (PixmapPtr pixmap)
 	ScrnInfoPtr scrn = xf86Screens[screen->myNum];
 	I830Ptr i830 = I830PTR(scrn);
 
-	if (bo->virtual)
-	    dri_bo_unmap(bo);
-	else
+	if (scrn->vtSema)
 	    drm_intel_bo_unpin(bo);
+	else
+	    dri_bo_unmap(bo);
 
 	pixmap->devPrivate.ptr = NULL;
 	if (bo == i830->front_buffer->bo)
-- 
1.5.3.8




More information about the Intel-gfx mailing list