diff --git a/src/i830_display.c b/src/i830_display.c index 06bbd67..21314cf 100644 --- a/src/i830_display.c +++ b/src/i830_display.c @@ -796,9 +796,15 @@ i830_crtc_dpms(xf86CrtcPtr crtc, int mode) static Bool i830_crtc_lock (xf86CrtcPtr crtc) { + ScrnInfoPtr pScrn = crtc->scrn; + I830Ptr pI830 = I830PTR(pScrn); + /* Sync the engine before mode switch */ i830WaitSync(crtc->scrn); + if (pI830->preinit) + return FALSE; + #ifdef XF86DRI return I830DRILock(crtc->scrn); #else @@ -809,6 +815,12 @@ i830_crtc_lock (xf86CrtcPtr crtc) static void i830_crtc_unlock (xf86CrtcPtr crtc) { + ScrnInfoPtr pScrn = crtc->scrn; + I830Ptr pI830 = I830PTR(pScrn); + + if (pI830->preinit) + return; + #ifdef XF86DRI I830DRIUnlock (crtc->scrn); #endif diff --git a/src/i830_memory.c b/src/i830_memory.c index bdfa100..0ad2803 100644 --- a/src/i830_memory.c +++ b/src/i830_memory.c @@ -1413,14 +1413,19 @@ i830_allocate_2d_memory(ScrnInfoPtr pScrn) */ size = 3 * pitch * pScrn->virtualY; size = ROUND_TO_PAGE(size); - +#if EXA_VERSION_MINOR >= 5 + /* Recent EXA supports relocation */ + pI830->exa_offscreen = + i830_allocate_memory(pScrn, "exa offscreen", size, 1, 0); +#else /* EXA has no way to tell it that the offscreen memory manager has * moved its base and all the contents with it, so we have to have * it locked in place for the whole driver instance. */ pI830->exa_offscreen = - i830_allocate_memory(pScrn, "exa offscreen", - size, 1, NEED_LIFETIME_FIXED); + i830_allocate_memory(pScrn, "exa offscreen", size, 1, + NEED_LIFETIME_FIXED); +#endif /* EXA_VERSION_MINOR */ if (pI830->exa_offscreen == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Failed to allocate EXA offscreen memory.\n"); @@ -1931,6 +1936,13 @@ i830_bind_all_memory(ScrnInfoPtr pScrn) #endif } i830_update_cursor_offsets(pScrn); +#if defined(I830_USE_EXA) && EXA_VERSION_MINOR >= 5 + if (pI830->accel_method == ACCEL_EXA) { + ScreenPtr pScreen = pScrn->pScreen; + + exaOffscreenUpdateBase(pScreen, pI830->exa_offscreen->offset); + } +#endif return TRUE; }