From f393a12d21eed668cf4771f022beded9a4c547c7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 4 Oct 2007 13:03:14 -0700 Subject: 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. --- src/i830_driver.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/i830_driver.c') 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; } -- cgit v1.2.3