Date: Sat, 22 Nov 1997 15:50:09 +0100
From: Jes Sorensen <Jes.Sorensen@cern.ch>
To: linux-m68k@lists.linux-m68k.org
Subject: L68K: CV3D clear problems
Sender: owner-linux-m68k@phil.uni-sb.de

Hi

Those who experienced the problems with the CV3D where it clears the
wrong part of a line etc., could you please try this patch (agains't the
release 2.0.31-pre3 so it include the palette fix as well - and adds a
1600x1200-8 screen-mode).

Another thing - someone must look at the 53c7xx problems real soon, we
need to get the WarpEngine/A4000T/A4091 driver working again in 2.0.x.

Jes

--- /data/tmp/linux-2.0.31-m68k-pre3/arch/m68k/amiga/cyberfb.c	Sun Oct 26 18:12:31 1997
+++ linux20/arch/m68k/amiga/cyberfb.c	Sat Nov 22 15:41:57 1997
@@ -166,6 +166,7 @@
 	"1024x768-8",
 	"1152x886-8",
 	"1280x1024-8",
+	"1600x1200-8",
 	"800x600-16",
 
 	/*
@@ -232,6 +233,12 @@
 	0, 0, -1, -1, FB_ACCEL_NONE, 12500, 64, 96, 35, 12, 112, 2,
 	FB_SYNC_COMP_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
 	}, {
+	/* Cybervision 8 bpp */
+	1600, 1200, 1600, 1200, 0, 0, 8, 0,
+	{0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
+	0, 0, -1, -1, FB_ACCEL_NONE, 12500, 64, 96, 35, 12, 112, 2,
+	FB_SYNC_COMP_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
+	}, {
 	/* Cybervision 16 bpp */
 	800, 600, 800, 600, 0, 0, 16, 0,
 	{11, 5, 0}, {5, 6, 0}, {0, 5, 0}, {0, 0, 0},
@@ -255,7 +262,7 @@
 
 
 #define NUM_TOTAL_MODES    arraysize(Cyber_fb_predefined)
-#define NUM_PREDEF_MODES   6
+#define NUM_PREDEF_MODES   7
 
 
 static int Cyberfb_inverse = 0;
@@ -674,10 +681,6 @@
 {
 	short i;
 
-	/*
-	 * No CV3D blanking yet.
-	 */
-
 	if (CV3D){
 		if (blank)
 			for (i = 0; i < 256; i++){
@@ -691,11 +694,9 @@
 				vgawb_3d(0x3c8, (unsigned char) i);
 				vgawb_3d(0x3c9, Cyber_colour_table[i][0] >> 2);
 				vgawb_3d(0x3c9, Cyber_colour_table[i][1] >> 2);
-				vgawb_3d(0x3c9, Cyber_colour_table[i][0] >> 2);
+				vgawb_3d(0x3c9, Cyber_colour_table[i][2] >> 2);
 			}
 	}else{
-
-		if (blank)
 		if (blank)
 			for (i = 0; i < 256; i++){
 				wb_64(0x3c8, (unsigned char) i);
@@ -708,7 +709,7 @@
 				wb_64(0x3c8, (unsigned char) i);
 				wb_64(0x3c9, Cyber_colour_table[i][0] >> 2);
 				wb_64(0x3c9, Cyber_colour_table[i][1] >> 2);
-				wb_64(0x3c9, Cyber_colour_table[i][0] >> 2);
+				wb_64(0x3c9, Cyber_colour_table[i][2] >> 2);
 			}
 	}
 }
@@ -746,7 +747,7 @@
  * BitBLT - Through the Plane
  */
 void Cyber3d_BitBLT (u_short curx, u_short cury, u_short destx, u_short desty,
-		     u_short width, u_short height, u_short mode)
+		     u_short width, u_short height)
 {
 	unsigned int blitcmd = S3V_BITBLT | S3V_DRAW | S3V_DST_8BPP;
 
@@ -790,7 +791,7 @@
 {
 	unsigned int tmp;
 	unsigned int blitcmd = S3V_RECTFILL | S3V_DRAW | S3V_DST_8BPP |
-		S3V_BLT_CLEAR | S3V_MONO_PAT | (1 << 26);
+		S3V_BLT_CLEAR | S3V_MONO_PAT | (1 << 26) | (1 << 25);
 
 	tmp = color & 0xff;
 	wl_3d(0xa4f4, tmp);
@@ -1429,8 +1430,8 @@
 			Cyber_fb_predefined[0] = Cyber_fb_predefined[1];
 		}
 		else if (!strcmp (this_opt, "cyber16")){
-			Cyber_fb_predefined[0] = Cyber_fb_predefined[6];
-			Cyberfb_mode = 6;
+			Cyber_fb_predefined[0] = Cyber_fb_predefined[7];
+			Cyberfb_mode = 7;
 		}
 		else
 			Cyberfb_mode = get_video_mode(this_opt);
