Subject: Re: X11 on iBook G4: flickering screen
To: Emmanuel Dreyfus <manu@NetBSD.org>
From: Matthieu Herrb <matthieu.herrb@laas.fr>
List: tech-x11
Date: 06/24/2004 08:49:25
This is a multi-part message in MIME format.
--------------000504010205020500070005
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Emmanuel Dreyfus wrote:
> Hi
> 
> XFree86 on the iBook is somewhat unusable: the X server works, I can see
> the mouse pointer moving, but the screen is flickering, about 4 times
> per second. 
> 
> Google tells me that Linux users experienced that due to broken
> framebuffer in th kernel that needed a patch. I have found various
> config files, they all use a fremebuffer device. 
> 
> The video board is an ATI radeon. I can probably port the framebuffer
> device driver from Linux to NetBSD, but maybe we have an easier was of
> dealing with that issue? What can make a TFT scrren flickering?
> 
Try the attached patch (from Rene Rebe, Rock Linux)
It fixed the similar problem many people had on iBooks under OpenBSD.

--------------000504010205020500070005
Content-Type: text/plain;
 name="iBook-800-radeon.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="iBook-800-radeon.diff"

Index: radeon_driver.c
===================================================================
RCS file: /cvs/XF4/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v
retrieving revision 1.6
diff -u -r1.6 radeon_driver.c
--- radeon_driver.c	18 Mar 2004 20:54:23 -0000	1.6
+++ radeon_driver.c	20 Jun 2004 17:07:35 -0000
@@ -1808,6 +1808,11 @@
 		    pll->reference_div  = 12;
 		    pll->xclk           = 23000;
 		    break;
+		case PCI_CHIP_RADEON_LW: /* Guessed based on iBook Open Firmware data -ReneR */
+		    pll->reference_freq = 2700;
+		    pll->reference_div  = 12;
+		    pll->xclk           = 36000;
+		    break;
 		default:
 		    pll->reference_freq = 2700;
 		    pll->reference_div  = 67;
@@ -3684,9 +3689,9 @@
 
 static Bool RADEONPreInitInt10(ScrnInfoPtr pScrn, xf86Int10InfoPtr *ppInt10)
 {
+#if !defined(__powerpc__)
     RADEONInfoPtr  info = RADEONPTR(pScrn);
 
-#if !defined(__powerpc__)
     if (xf86LoadSubModule(pScrn, "int10")) {
 	xf86LoaderReqSymLists(int10Symbols, NULL);
 	xf86DrvMsg(pScrn->scrnIndex,X_INFO,"initializing int10\n");
@@ -6510,6 +6515,9 @@
 
     save->ppll_ref_div   = pll->reference_div;
     save->ppll_div_3     = (save->feedback_div | (post_div->bitvalue << 16));
+#if defined(__powerpc__) /* on iBooks the LCD pannel needs tweaked PLL timings -ReneR */
+    save->ppll_div_3     = 0x000600ad; /* -ReneR */
+#endif
     save->htotal_cntl    = 0;
 }
 

--------------000504010205020500070005--