[Intel-gfx] [PATCH] fix LeaveVT if KMS enabled

Jesse Barnes jbarnes at virtuousgeek.org
Thu Jan 15 22:24:18 CET 2009


Not sure if this is complete or not, but it did seem to make things more 
stable for me in light testing.

At LeaveVT time we unbind all memory and clear out the gen4 render state, then 
re-initialize it at EnterVT time.  But in the KMS case, we don't actually do 
the batch teardown.  It seems like this could cause problems since we could 
be executing a buffer after VT switch but have some of the state and memory 
associated with it be removed...

This patch also removes the KD stuff, since it could be causing problems with 
DPMS off/on (going back to fbcon after DPMS on rather than X), still testing 
it.  The downside of not using KD_TEXT mode is that any kernel messages 
output while X was running may not be visible if a panic occurs.  Which is 
shame, it's kind of nice to see the last few messages in addition to the 
panic data if you can.

Jesse

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 3e27b07..ae9fd54 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1228,7 +1228,6 @@ i830SetHotkeyControl(ScrnInfoPtr pScrn, int mode)
  * DRM mode setting Linux only at this point... later on we could
  * add a wrapper here.
  */
-#include <linux/kd.h>
 
 static Bool i830_kernel_mode_enabled(ScrnInfoPtr pScrn)
 {
@@ -1254,8 +1253,6 @@ static Bool i830_kernel_mode_enabled(ScrnInfoPtr pScrn)
     if (ret)
 	return FALSE;
 
-    ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT);
-
     return TRUE;
 }
 #else
@@ -3614,7 +3611,6 @@ I830LeaveVT(int scrnIndex, int flags)
 	*/
        if (!pI830->memory_manager)
 	   intel_bufmgr_fake_evict_all(pI830->bufmgr);
-       intel_batch_teardown(pScrn);
 
        if (!pI830->memory_manager)
 	   i830_stop_ring(pScrn, TRUE);
@@ -3625,6 +3621,8 @@ I830LeaveVT(int scrnIndex, int flags)
        }
    }
 
+   intel_batch_teardown(pScrn);
+
    if (I830IsPrimary(pScrn))
       i830_unbind_all_memory(pScrn);
 



More information about the Intel-gfx mailing list