[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 4afa305..d952bf3 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)