summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2008-08-12 18:16:37 -0700
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-08-12 18:16:37 -0700
commit1ab7239b73a5e298cadaf44e5605cf05855f08e9 (patch)
tree1fe86899678bf4a87999a33722011c893dc931f3
parent603f48e31b021c4dc0bbf7b5efbb2e68aeb421d5 (diff)
Map gen4 render state buffer before initializing
-rw-r--r--src/i965_render.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/i965_render.c b/src/i965_render.c
index 391e0633..bd693cab 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -1448,9 +1448,13 @@ gen4_render_state_init(ScrnInfoPtr pScrn)
render_state = pI830->gen4_render_state;
render_state->card_state_offset = pI830->gen4_render_state_mem->offset;
- render_state->card_state = (gen4_state_t *)
- (pI830->FbBase + render_state->card_state_offset);
+ if (dri_bo_map(pI830->gen4_render_state_mem->bo, 1)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Failed to map gen4 state\n");
+ return;
+ }
+
+ render_state->card_state = pI830->gen4_render_state_mem->bo->virtual;
gen4_state_init(render_state);
}
@@ -1462,6 +1466,8 @@ gen4_render_state_cleanup(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
+ dri_bo_unmap(pI830->gen4_render_state_mem->bo);
+ dri_bo_unreference(pI830->gen4_render_state_mem->bo);
pI830->gen4_render_state->card_state = NULL;
}