summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhenyu Wang <zhenyu.z.wang@intel.com>2008-01-25 16:59:13 +0800
committerZhenyu Wang <zhenyu.z.wang@intel.com>2008-01-25 17:00:09 +0800
commit6bf53eb48f40ad0c8ea9679ee634447410821b4f (patch)
treeb1ed144d4fa27051e30bcda285775f4e85b9cd71
parent94a18fa1f8141837bdab32e545da7a7aed1cc396 (diff)
Set vtSema before EnterVT
Which was missing in our ScreenInit and initial EnterVT. This not only causes failure in initial rotation with TTM, as we won't bind in rotate_mem alloc in this case, and hide another bug that we call randr12 function in I830LoadPalete before we call xf86RandR12Init.
-rw-r--r--src/i830_driver.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 70774568..dffc6306 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2934,9 +2934,25 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pI830->directRenderingEnabled = I830DRIFinishScreenInit(pScreen);
#endif
+ /* Must force it before EnterVT, so we are in control of VT and
+ * later memory should be bound when allocating, e.g rotate_mem */
+ pScrn->vtSema = TRUE;
+
if (!I830EnterVT(scrnIndex, 0))
return FALSE;
+ pI830->BlockHandler = pScreen->BlockHandler;
+ pScreen->BlockHandler = I830BlockHandler;
+
+ pScreen->SaveScreen = xf86SaveScreen;
+ pI830->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = I830CloseScreen;
+ pI830->CreateScreenResources = pScreen->CreateScreenResources;
+ pScreen->CreateScreenResources = i830CreateScreenResources;
+
+ if (!xf86CrtcScreenInit (pScreen))
+ return FALSE;
+
DPRINTF(PFX, "assert( if(!miCreateDefColormap(pScreen)) )\n");
if (!miCreateDefColormap(pScreen))
return FALSE;
@@ -2973,18 +2989,7 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "direct rendering: Not available\n");
#endif
- pI830->BlockHandler = pScreen->BlockHandler;
- pScreen->BlockHandler = I830BlockHandler;
- pScreen->SaveScreen = xf86SaveScreen;
- pI830->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = I830CloseScreen;
- pI830->CreateScreenResources = pScreen->CreateScreenResources;
- pScreen->CreateScreenResources = i830CreateScreenResources;
-
- if (!xf86CrtcScreenInit (pScreen))
- return FALSE;
-
/* Wrap pointer motion to flip touch screen around */
pI830->PointerMoved = pScrn->PointerMoved;
pScrn->PointerMoved = I830PointerMoved;