--- xc/programs/Xserver/hw/xfree86/vga256/drivers/cirrus/cir_driver.orig.c	Thu Jul  3 11:08:05 1997
+++ xc/programs/Xserver/hw/xfree86/vga256/drivers/cirrus/cir_driver.bank.c	Tue Oct 28 14:02:00 1997
@@ -267,6 +267,7 @@
   unsigned char BCLK;           /* Rambus clock (546X) */
   unsigned short cursorX;
   unsigned short cursorY;
+  unsigned char SR2D;
 } vgacirrusRec, *vgacirrusPtr;
 
 unsigned char SavedExtSeq;
@@ -2687,8 +2688,29 @@
   outb(0x3C4,0x0F);		/* Restoring this registers avoids */
   outb(0x3C5,restore->SRF);	/* textmode corruption on 2Mb cards. */
 
-  outb(0x3C4,0x07);		/* This will disable linear addressing */
-  outb(0x3C5,restore->SR7);	/* if enabled. */
+  /* -- SZG -- */
+  if (cirrusChip == CLGD7543 && cirrusUseLinear) {
+    if ((restore->SR7 & 0xF0) == 0) {
+      /* going to banked framebuffer */
+      /* Clear SR7 */
+      outb(0x3C4,0x07);
+      outb(0x3C5,restore->SR7);
+      /* Clear SR2D */
+      outb(0x3C4,0x2D);
+      outb(0x3C5,restore->SR2D);
+    } else {
+      /* going to linear framebuffer */
+      /* Set SR2D to high bits */
+      outb(0x3C4,0x2D);
+      outb(0x3C5,restore->SR2D);
+      /* Set SR7 to low bits */
+      outb(0x3C4,0x07);
+      outb(0x3C5,restore->SR7);
+    }
+  } else {
+    outb(0x3C4,0x07);		/* This will disable linear addressing */
+    outb(0x3C5,restore->SR7);	/* if enabled. */
+  }
 
 #ifndef MONOVGA
 #ifdef ALLOW_8BPP_MULTIPLEXING
@@ -3025,6 +3047,10 @@
   outb(0x3C4,0x07);
   save->SR7 = inb(0x3C5);
 
+  /* SZG */
+  outb(0x3C4,0x2D);
+  save->SR2D = inb(0x3C5);
+
   outb(0x3C4,0x0E);
   save->SRE = inb(0x3C5);
 
@@ -3687,6 +3713,7 @@
 #ifdef MONOVGA
     new->SR7 = 0x00;		/* Use 16 color mode. */
 #else
+
       /*
        * There are two 16bpp clocking modes.
        * 'Clock / 2 for 16-bit/Pixel Data' clocking mode (0x03).
@@ -3741,6 +3768,10 @@
 #ifdef CIRRUS_SUPPORT_LINEAR
       if (cirrusUseLinear && !HAVE546X())
 	new->SR7 |= 0x0E << 4;	/* Map at 14Mb. */
+      /* Map at 62Mb */
+      if (cirrusUseLinear && cirrusChip == CLGD7543) {
+	new->SR2D |= 0xC0;
+      }
 #endif
 
       if (mode->VTotal >= 1024 && !(mode->Flags & V_INTERLACE))
