From 6cd914ef315036ce8e91c7b6492994353e8ed2d8 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Fri, 3 Apr 2009 11:15:18 -0700 Subject: [PATCH] Fix offset in begin_gtt_access case Don't use bo->virtual in the begin_gtt_access case, use the framebuffer mapping and bo offset instead. Reviewed-by: Eric Anholt Signed-off-by: Jesse Barnes --- src/i830_driver.c | 3 ++- src/i830_exa.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/i830_driver.c b/src/i830_driver.c index d7ee6154..32ca6c9a 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -846,11 +846,12 @@ i830_update_front_offset(ScrnInfoPtr pScrn) if (drm_intel_gem_bo_map_gtt(bo)) xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "%s: bo map failed\n", __FUNCTION__); + data = bo->virtual; } else { /* Will already be pinned by bind_all_memory in this case */ drm_intel_gem_bo_start_gtt_access(bo, 1); + data = pI830->FbBase + bo->offset; } - data = bo->virtual; } } if (!pScreen->ModifyPixmapHeader(pScreen->GetScreenPixmap(pScreen), diff --git a/src/i830_exa.c b/src/i830_exa.c index fc4e66ce..39011bc6 100644 --- a/src/i830_exa.c +++ b/src/i830_exa.c @@ -867,12 +867,13 @@ i830_uxa_prepare_access (PixmapPtr pixmap, uxa_access_t access) __FUNCTION__); return FALSE; } + pixmap->devPrivate.ptr = bo->virtual; } else { /* or not... */ if (drm_intel_bo_pin(bo, 4096) != 0) return FALSE; drm_intel_gem_bo_start_gtt_access(bo, access == UXA_ACCESS_RW); + pixmap->devPrivate.ptr = i830->FbBase + bo->offset; } - pixmap->devPrivate.ptr = bo->virtual; } return TRUE; }