summaryrefslogtreecommitdiff
path: root/src/i830_driver.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-10-04 13:03:14 -0700
committerEric Anholt <eric@anholt.net>2007-10-11 12:17:14 -0700
commitf393a12d21eed668cf4771f022beded9a4c547c7 (patch)
tree69319ed0d119f42d1b3f0b038d973f78238217bb /src/i830_driver.c
parent8fc4e3078210f726c7c375faa2f2fd8d05017c09 (diff)
Move drmMMLock to after we have unbound our (pinned) buffers.
There are still issues due to the fact that we're allocating NEED_LIFETIME_FIXED memory as buffer objects, which we refuse to unpin because we have no way of pinning it back in the same location.
Diffstat (limited to 'src/i830_driver.c')
-rw-r--r--src/i830_driver.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c
index ce84bce6..b3edb61a 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2959,13 +2959,8 @@ I830LeaveVT(int scrnIndex, int flags)
#ifdef XF86DRI
if (pI830->directRenderingOpen) {
DRILock(screenInfo.screens[pScrn->scrnIndex], 0);
-#ifdef XF86DRI_MM
- if (pI830->memory_manager != NULL) {
- drmMMLock(pI830->drmSubFD, DRM_BO_MEM_TT);
- }
-#endif /* XF86DRI_MM */
+
I830DRISetVBlankInterrupt (pScrn, FALSE);
-
drmCtlUninstHandler(pI830->drmSubFD);
}
#endif
@@ -2983,6 +2978,18 @@ I830LeaveVT(int scrnIndex, int flags)
if (I830IsPrimary(pScrn))
i830_unbind_all_memory(pScrn);
+
+ /* Tell the kernel to evict all buffer objects and block new buffer
+ * allocations until we relese the lock.
+ */
+#ifdef XF86DRI_MM
+ if (pI830->directRenderingOpen) {
+ if (pI830->memory_manager != NULL) {
+ drmMMLock(pI830->drmSubFD, DRM_BO_MEM_TT);
+ }
+ }
+#endif /* XF86DRI_MM */
+
if (pI830->AccelInfoRec)
pI830->AccelInfoRec->NeedToSync = FALSE;
}