[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Patch for M3 external monitor for 2.6 kernel



Hi all!

Sorry for my poor english :-)

I have an  iBook 2002 (dual usb+fw+aty128) which have the problem,
just discussed on the list, on the external CRT (solved with
http://stampflee.com/kernel/aty128fb-m3fixes.diff).

I tested 2.6 benh kernel (test11), and i tried to modify the patch to
solve the same problem on this kernel.

The patch is at
http://www.gulp.linux.it/Members/Arcimboldo/ibook/aty128fb-m3fixes-2_5benh_diff
and it works for me.

ciao
.a.

-- 
Il mattino ha l'oro in bocca. Il MATTino ha l'OrO In bOcca.
i lma tt ino ha l'o roin bocc a.ilmattinohal'oroinbocca. il ma tt in
oh al' or oi nb oc ca. il matti noha l'oroinbocca. IL MATtiNO Ha l'ORO
InBOCCa. I l m a t t i n o  h a l' o r o i n b o c c a . ilmattinohal'oroin
BoCcA. iLmAtTiNoHaL'oRoInBoCcA.

--- src-2.5-benh.old/include/video/aty128.h	2003-12-07 22:23:50.000000000 +0100
+++ src-2.5-benh.new/include/video/aty128.h	2003-12-05 02:35:50.000000000 +0100
@@ -258,7 +258,7 @@
 #define PLL_TEST_CNTL				0x0013
 #define P2PLL_CNTL				0x002a
 #define P2PLL_REF_DIV				0x002b
-#define P2PLL_DIV_0				0x002c
+#define P2PLL_DIV_0				0x002b
 #define POWER_MANAGEMENT			0x002f
 
 #define PPLL_RESET				0x01
--- src-2.5-benh.old/drivers/video/aty/aty128fb.c	2003-12-07 22:31:34.000000000 +0100
+++ src-2.5-benh.new/drivers/video/aty/aty128fb.c	2003-12-07 22:48:52.000000000 +0100
@@ -748,17 +748,15 @@
 }
 
 #ifdef CONFIG_PMAC_PBOOK
-	static void
-	aty128_set_crtc2(const struct aty128_crtc *crtc,
-		       const struct fb_info_aty128 *info)
+static void
+aty128_set_crtc2(const struct aty128_crtc *crtc,
+		 const struct aty128fb_par *par)
 {
 
-	aty_st_le32(CRTC2_GEN_CNTL, crtc->gen_cntl);
-	
+	aty_st_le32(CRTC2_GEN_CNTL, crtc->gen_cntl);	
 	/* FIXME - Hardcoded */
 	aty_st_le32(CRTC2_H_TOTAL_DISP, crtc->h_total & ~0xf | 0xa);
-	aty_st_le32(CRTC2_H_SYNC_STRT_WID, crtc->h_sync_strt_wid & ~0xff | 0x10 );
-	
+	aty_st_le32(CRTC2_H_SYNC_STRT_WID, crtc->h_sync_strt_wid & ~0xff | 0x10 );	
 	aty_st_le32(CRTC2_V_TOTAL_DISP, crtc->v_total);
 	aty_st_le32(CRTC2_V_SYNC_STRT_WID, crtc->v_sync_strt_wid);
 	aty_st_le32(CRTC2_PITCH, crtc->pitch);
@@ -1102,7 +1100,7 @@
 
 #ifdef CONFIG_PMAC_PBOOK
 static void
-  aty128_set_pll2(struct aty128_pll *pll, const struct fb_info_aty128 *info)
+  aty128_set_pll2(struct aty128_pll *pll, const struct aty128fb_par *par)
 {
    u32 div;
    
@@ -1114,9 +1112,9 @@
 	      aty_ld_pll(P2PLL_CNTL) | PPLL_RESET | PPLL_ATOMIC_UPDATE_EN);
 		
    /* write the reference divider */
-   aty_pll_wait_readupdate(info);
-   aty_st_pll(P2PLL_REF_DIV, info->constants.ref_divider & 0x3ff);
-   aty_pll_writeupdate(info);
+   aty_pll_wait_readupdate(par);
+   aty_st_pll(P2PLL_REF_DIV, par->constants.ref_divider & 0x3ff);
+   aty_pll_writeupdate(par);
    
    div = aty_ld_pll(P2PLL_DIV_0);
    div &= ~XPLL_FB_DIV_MASK;
@@ -1125,13 +1123,13 @@
    div |= 0x00040000; /* magic value */
      
      /* write feedback and post dividers */
-   aty_pll_wait_readupdate(info);
+   aty_pll_wait_readupdate(par);
    aty_st_pll(P2PLL_DIV_0, div);
-   aty_pll_writeupdate(info);
+   aty_pll_writeupdate(par);
    
-   aty_pll_wait_readupdate(info);
+   aty_pll_wait_readupdate(par);
    aty_st_pll(HTOTAL_CNTL, 0);        /* no horiz crtc adjustment */
-   aty_pll_writeupdate(info);
+   aty_pll_writeupdate(par);
    
    
    /* clear the reset, just in case */
@@ -1204,7 +1202,7 @@
 #ifdef CONFIG_PMAC_PBOOK
 static void
 aty128_set_fifo2(const struct aty128_ddafifo *dsp,
-		 const struct fb_info_aty128 *info)
+		 const struct aty128fb_par *par)
 {
    /* FIXME - Hardcoded */
    aty_st_le32(DDA2_CONFIG, 0x010502aa);
@@ -1309,10 +1307,10 @@
 	aty128_set_fifo(&par->fifo_reg, par);
 
 #ifdef CONFIG_PMAC_PBOOK
-   if(info->chip_gen == rage_M3) {
-      aty128_set_crtc2(&par->crtc2, info);
-      aty128_set_pll2(&par->pll2, info);
-      aty128_set_fifo2(&par->fifo_reg2, info);
+   if(par->chip_gen == rage_M3) {
+      aty128_set_crtc2(&par->crtc2, par);
+      aty128_set_pll2(&par->pll2, par);
+      aty128_set_fifo2(&par->fifo_reg2, par);
    }
 #endif
 			
@@ -1376,13 +1374,13 @@
 
 #ifdef CONFIG_PMAC_PBOOK
 		
-   if ((err = aty128_var_to_crtc(var, &par->crtc2, info)))
+   if ((err = aty128_var_to_crtc(var, &par->crtc2, par)))
      return err;
    
-   if ((err = aty128_var_to_pll(var->pixclock, &par->pll2, info)))
+   if ((err = aty128_var_to_pll(var->pixclock, &par->pll2, par)))
      return err;
    
-   if ((err = aty128_ddafifo(&par->fifo_reg2, &par->pll2, par->crtc2.depth, info)))
+   if ((err = aty128_ddafifo(&par->fifo_reg2, &par->pll2, par->crtc2.depth, par)))
      return err;
 #endif
 		
@@ -2244,7 +2242,7 @@
 static inline void
 aty128_rectcopy(int srcx, int srcy, int dstx, int dsty,
 		u_int width, u_int height,
-		struct fb_info_aty128 *par)
+		struct aty128fb_par *par)
 {
     u32 save_dp_datatype, save_dp_cntl, dstval;
 
@@ -2298,7 +2296,7 @@
     height *= fontheight(p);
 
     aty128_rectcopy(sx, sy, dx, dy, width, height,
-			(struct fb_info_aty128 *)p->fb_info);
+			(struct aty128fb_par *)p->fb_info);
 }
 #endif /* 0 */
 

Attachment: pgpcohPypWsZF.pgp
Description: PGP signature


Reply to: