summaryrefslogtreecommitdiff
path: root/src/i830_memory.c
diff options
context:
space:
mode:
authorZhenyu Wang <zhenyu.z.wang@intel.com>2008-03-13 10:15:55 +0800
committerZhenyu Wang <zhenyu.z.wang@intel.com>2008-03-13 10:15:55 +0800
commit1c0e4958564588162bc22a980567436dfc9d1e56 (patch)
tree5f0e5c691446d95760fbc84d793f78b10490fa10 /src/i830_memory.c
parent2e2372912ed9bc0d86e8960653ef0bfce5cf99ab (diff)
Always bind memory after agp aperture allocation
This fixed the crash appearing for Xv buffer memory, which appears allocation and free happening in stolen memory. We should always try to bind for stolen memory for correct protect setup, otherwise we might get fault that stolen memory protect reverted to non-r/w after previous free and unbind. Credit goes to Lukas Hejtmanek to identify the real problem of Xv crash!
Diffstat (limited to 'src/i830_memory.c')
-rw-r--r--src/i830_memory.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/i830_memory.c b/src/i830_memory.c
index ec4d699a..2cac26b7 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -730,10 +730,6 @@ i830_allocate_agp_memory(ScrnInfoPtr pScrn, i830_memory *mem, int flags)
return FALSE;
}
- if (!i830_bind_memory(pScrn, mem)) {
- return FALSE;
- }
-
return TRUE;
}
@@ -853,6 +849,11 @@ i830_allocate_memory(ScrnInfoPtr pScrn, const char *name,
i830_free_memory(pScrn, mem);
return NULL;
}
+
+ if (!i830_bind_memory(pScrn, mem)) {
+ i830_free_memory(pScrn, mem);
+ return NULL;
+ }
}
mem->tiling = TILE_NONE;