diff --git a/src/i830_driver.c b/src/i830_driver.c index e48e20e..57033f3 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -3254,6 +3254,14 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) } #endif + if (!pI830->use_drm_mode) { + DPRINTF(PFX, "assert( if(!I830MapMem(pScrn)) )\n"); + if (!I830MapMem(pScrn)) + return FALSE; + pScrn->memPhysBase = (unsigned long)pI830->FbBase; + } + i830_init_bufmgr(pScrn); + #ifdef XF86DRI /* * Setup DRI after visuals have been established, but before fbScreenInit @@ -3287,13 +3295,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pI830->allowPageFlip ? "en" : "dis"); #endif - if (!pI830->use_drm_mode) { - DPRINTF(PFX, "assert( if(!I830MapMem(pScrn)) )\n"); - if (!I830MapMem(pScrn)) - return FALSE; - pScrn->memPhysBase = (unsigned long)pI830->FbBase; - } - if (I830IsPrimary(pScrn)) { pScrn->fbOffset = pI830->front_buffer->offset; } else { @@ -3311,8 +3312,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) return FALSE; } - i830_init_bufmgr(pScrn); - i830_disable_render_standby(pScrn); DPRINTF(PFX, "assert( if(!I830EnterVT(scrnIndex, 0)) )\n"); @@ -3693,7 +3692,7 @@ I830EnterVT(int scrnIndex, int flags) * operation which accessing that page, like irq install, etc. */ if (pI830->starting && !pI830->memory_manager) { - if (!I830DRISetHWS(pScrn)) { + if (pI830->hw_status != NULL && !I830DRISetHWS(pScrn)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Fail to setup hardware status page.\n"); I830DRICloseScreen(pScrn->pScreen);