[PATCH] savagefb: Fix black screen on load in Savage IX
authorAntonino A. Daplas <adaplas@gmail.com>
Fri, 16 Mar 2007 21:38:18 +0000 (13:38 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 17 Mar 2007 02:25:04 +0000 (19:25 -0700)
This is a hack that seems to kick start the 2D engine of the Savage IX in some
Toshiba laptops.  Without this, the laptop starts with a black screen and
occasionally crashes X.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/savage/savagefb_driver.c

index 4afa30522fdbb4c375b37057a77b3a04d1bf3097..d952bf3199a6a6474de0e8b5a6ca17fb9e6925cc 100644 (file)
@@ -384,6 +384,19 @@ SavageSetup2DEngine(struct savagefb_par  *par)
        BCI_SEND(0);
        BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD2);
        BCI_SEND(GlobalBitmapDescriptor);
+
+       /*
+        * I don't know why, sending this twice fixes the intial black screen,
+        * prevents X from crashing at least in Toshiba laptops with SavageIX.
+        * --Tony
+        */
+       par->bci_ptr = 0;
+       par->SavageWaitFifo(par, 4);
+
+       BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD1);
+       BCI_SEND(0);
+       BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD2);
+       BCI_SEND(GlobalBitmapDescriptor);
 }
 
 static void savagefb_set_clip(struct fb_info *info)