Resent-Date: Thu, 22 Oct 1998 23:23:03 +0200 (MET DST)
Sender: bharries@vossnet.de
Date: Thu, 22 Oct 1998 23:13:45 +0200
From: Bernd Harries <bha@gmx.de>
Organization: BHA Industries
To: Juergen Orschiedt <orschied@kassandra.zx.basf-ag.de>,
        Petr Stehlik <stehlik@cas3.zlin.vutbr.cz>, scott@dmi.stevens-tech.edu,
        Gerald.Haese@hgw.scn.de, linux-m68k@lists.linux-m68k.org
Subject: 2nd atyfb.c diff 2.1.124
References: <199810031735.TAA21471@cas3.zlin.vutbr.cz> <361741C2.23BB12FE@gmx.de> <19981004172140.A7778@kassandra.zx.basf-ag.de> <361BB8B1.1C9CC312@gmx.de> <19981007224741.A24777@kassandra.zx.basf-ag.de> <361CFE92.265E4427@gmx.de> <362895B0.2CA8C2EE@gmx.de>
Resent-From: linux-m68k@phil.uni-sb.de

Hi dudes,

this could almost be it. I found some bugs in the aty_set_dac_*
functions. It no longer makes a black screen on my system when it is
enabled, so I enabled them now. But when I switch to 1024x768 it gives a
pink screen. And when I init 3 to start X11 the screen turns black. pink
screen. But I can switch back to tty2 .. tty6 and see the normal text.

First you have to apply the atyfb.c patch from 13. October 1998.
Then apply this one. It is not very big.

If anyone needs I can send a sumary diff or the complete atyfb.c
to him.



--- drivers/video/atyfb.c_21124bha1	Thu Oct 22 22:46:22 1998
+++ drivers/video/atyfb.c	Thu Oct 22 22:44:30 1998
@@ -1253,52 +1253,50 @@
 
 /*-------------------------------------------------------------------------*/
 {
-  u32 gmr, dsra, temp, mask;
+  u32 gModeReg, devSetupRegA, temp, mask;
 
   /*-------------------------------------------------------------------------*/
-  printk(" aty_set_dac_ATI68860_B() bpp=$%02X    (still dummy) \n", bpp);
+  /* printk(" aty_set_dac_ATI68860_B() bpp=$%02X \n", bpp); */
 
-  return 0;
-  
-  gmr = 0;
-  dsra = 0;
+  gModeReg = 0;
+  devSetupRegA = 0;
   
   switch(bpp)
   {
-    case CRTC_PIX_WIDTH_8BPP:
-      gmr = 0x83;
-      dsra = 0x60 | 0x00  /*(info->mach64DAC8Bit ? 0x00 : 0x01) */ ;
+    case 8:
+      gModeReg = 0x83;
+      devSetupRegA = 0x60 | 0x00  /*(info->mach64DAC8Bit ? 0x00 : 0x01) */ ;
       break;
-    case CRTC_PIX_WIDTH_15BPP:
-      gmr = 0xA0;
-      dsra = 0x60;
+    case 15:
+      gModeReg = 0xA0;
+      devSetupRegA = 0x60;
       break;
-    case CRTC_PIX_WIDTH_16BPP:
-      gmr = 0xA1;
-      dsra = 0x60;
+    case 16:
+      gModeReg = 0xA1;
+      devSetupRegA = 0x60;
       break;
-    case CRTC_PIX_WIDTH_24BPP:
-      gmr = 0xC0;
-      dsra = 0x60;
+    case 24:
+      gModeReg = 0xC0;
+      devSetupRegA = 0x60;
       break;
-    case CRTC_PIX_WIDTH_32BPP:
-      gmr = 0xE3;
-      dsra = 0x60;
+    case 32:
+      gModeReg = 0xE3;
+      devSetupRegA = 0x60;
       break;
   }
   /*endswitch(bpp)*/
 
   if(!AccelMode)
   {
-    gmr = 0x80;
-    dsra = 0x61;
+    gModeReg = 0x80;
+    devSetupRegA = 0x61;
   }
 
   temp = aty_ld_8(DAC_CNTL, info);
   aty_st_8(DAC_CNTL, (temp & ~DAC_EXT_SEL_RS2) | DAC_EXT_SEL_RS3, info);
 
   aty_st_8(DAC_REGS + 2, 0x1D, info);
-  aty_st_8(DAC_REGS + 3, gmr, info);
+  aty_st_8(DAC_REGS + 3, gModeReg, info);
   aty_st_8(DAC_REGS, 0x02, info);
 
   temp = aty_ld_8(DAC_CNTL, info);
@@ -1317,7 +1315,7 @@
 #define A860_DELAY_L	0x80
 
   temp = aty_ld_8(DAC_REGS, info);
-  aty_st_8(DAC_REGS, (dsra | mask) | (temp & A860_DELAY_L), info);
+  aty_st_8(DAC_REGS, (devSetupRegA | mask) | (temp & A860_DELAY_L), info);
   temp = aty_ld_8(DAC_CNTL, info);
   aty_st_8(DAC_CNTL, (temp & ~(DAC_EXT_SEL_RS2 | DAC_EXT_SEL_RS3)), info);
 
@@ -1340,15 +1338,13 @@
   int   DACMask;
 
   /*-------------------------------------------------------------------------*/
-  printk(" aty_set_dac_ATT21C498() bpp=$%02X    (still dummy) \n", bpp);
-
-  return muxmode;
+  /* printk(" aty_set_dac_ATT21C498() bpp=$%02X \n", bpp); */
 
   dotClock = 100000000 / pll->period_in_ps;
 
   switch(bpp)
   {
-    case CRTC_PIX_WIDTH_8BPP:
+    case 8:
       if (dotClock > 8000)
       {
         DACMask = 0x24;
@@ -1359,16 +1355,16 @@
         DACMask = 0x04;
       }
       break;
-    case CRTC_PIX_WIDTH_15BPP:
+    case 15:
       DACMask = 0x16;
       break;
-    case CRTC_PIX_WIDTH_16BPP:
+    case 16:
       DACMask = 0x36;
       break;
-    case CRTC_PIX_WIDTH_24BPP:
+    case 24:
       DACMask = 0xE6;
       break;
-    case CRTC_PIX_WIDTH_32BPP:
+    case 32:
       DACMask = 0xE6;
       break;
   }
@@ -2634,14 +2630,14 @@
       }
       case DAC_ATT20C408:
       {
-        muxmode = aty_set_dac_ATT21C498(info, &par->pll.ics2595, accelmode);
+        muxmode = aty_set_dac_ATT21C498(info, &par->pll.ics2595, par->crtc.bpp);
         aty_st_le32(BUS_CNTL, 0x890e20f1, info);
         aty_st_le32(DAC_CNTL, 0x00072000, info);
         break;
       }
       case DAC_ATT21C498:
       {
-        muxmode = aty_set_dac_ATT21C498(info, &par->pll.ics2595, accelmode);
+        muxmode = aty_set_dac_ATT21C498(info, &par->pll.ics2595, par->crtc.bpp);
         aty_st_le32(BUS_CNTL, 0x890e20f1, info);
         aty_st_le32(DAC_CNTL, 0x00072000, info);
         break;
@@ -3389,7 +3385,7 @@
 	/* FIXME: clockchip/RAMDAC probing? */
 #ifdef CONFIG_ATARI
 	info->clk_type = CLK_ATI18818_1;
-	info->dac_type = (aty_ld_le32(DAC_CNTL, info) >> 16) & 0x07;
+	info->dac_type = (aty_ld_le32(CONFIG_STAT0, info) >> 9) & 0x07;
         if(info->dac_type == 0x07)
         {
           info->dac_subtype = DAC_ATT20C408;
@@ -3934,7 +3930,7 @@
           }
         }
         /*endswitch*/
-
+        
 	if (!aty_init(info, "ISA bus")) {
 	    kfree(info);
 	    /* This is insufficient! kernel_map has added two large chunks!! */
@@ -4247,7 +4243,7 @@
 	(Gx == GP_CHIP_ID) || (Gx == GQ_CHIP_ID))
 	i |= 0x2;	/*DAC_CNTL|0x2 turns off the extra brightness for gt*/
     aty_st_8(DAC_CNTL, i, info);
-    aty_st_8(DAC_REGS + DAC_MASK, 0xff, info);
+    aty_st_8(DAC_MASK, 0xff, info);
     eieio();
     scale = ((Gx != GX_CHIP_ID) && (Gx != CX_CHIP_ID) &&
 	     (info->current_par.crtc.bpp == 16)) ? 3 : 0;



-- 
Bernd Harries

bha@gmx.de            http://www.freeyellow.com/members/bharries
bharries@vossnet.de    Tel. +49 421 809 7351 priv.  | MSB First!
harries@stn-atlas.de        +49 421 457 3966 offi.  | Linux-m68k
bernd@linux-m68k.org                                | Medusa T40
           <>_<>      _______                _____
       .---|'"`|---. |  |_|  |_|_|_|_|_|_|_ (_____)  .-----.
______`o"O-OO-OO-O"o'`-o---o-'`-oo-----oo-'`-o---o-'`-o---o-'___

