xserver: Branch 'master' - 6 commits

Keith Packard keithp at kemper.freedesktop.org
Tue Oct 13 18:41:01 PDT 2009


 hw/xfree86/common/compiler.h             |   16 +++++++
 hw/xfree86/os-support/linux/lnx_axp.c    |   16 ++-----
 hw/xfree86/os-support/linux/lnx_ev56.c   |   18 +++++---
 hw/xfree86/os-support/misc/SlowBcopy.c   |   68 +++++++++++++++++++++++++++++++
 hw/xfree86/os-support/shared/bios_mmap.c |    2 
 hw/xfree86/vgahw/vgaHW.c                 |   16 +++----
 6 files changed, 111 insertions(+), 25 deletions(-)

New commits:
commit 6e158003e80534ce007290f75c89d698aec1d00b
Merge: 2b14e14... 5e762f0...
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Oct 13 18:40:42 2009 -0700

    Merge remote branch 'mattst88/master'
    
    * mattst88/master:
      [alpha] assume we have __NR_pciconfig_iobase
      [alpha] don't return from void functions
      Fix undefined symbols on alpha
      Fix breakage on alpha caused by c7680befe5ae
      Revert "alpha: kill xf86SlowBCopyToBus and xf86SlowBCopyFromBus"

commit 5e762f0e2f203b5121a3de3b9af3c8981b31a77f
Author: Matt Turner <mattst88 at gmail.com>
Date:   Tue Oct 13 20:42:14 2009 -0400

    [alpha] assume we have __NR_pciconfig_iobase
    
    The code path if we didn't have support has been broken since before we
    switched to git.
    
    The pciconfig_iobase syscall has been supported since 2000.
    
    Signed-off-by: Matt Turner <mattst88 at gmail.com>

diff --git a/hw/xfree86/os-support/linux/lnx_axp.c b/hw/xfree86/os-support/linux/lnx_axp.c
index 34129cc..10b97b0 100644
--- a/hw/xfree86/os-support/linux/lnx_axp.c
+++ b/hw/xfree86/os-support/linux/lnx_axp.c
@@ -138,16 +138,12 @@ long (*_iobase)(unsigned, int, int, int) = _alpha_iobase_query;
 static long
 _alpha_iobase(unsigned flags, int hose, int bus, int devfn)
 {
-#ifdef __NR_pciconfig_iobase
   if (bus < 0) {
     bus = hose;
     flags |= IOBASE_FROM_HOSE;
   }
 
   return syscall(__NR_pciconfig_iobase, flags, bus, devfn);
-#else
-  return -ENOSYS
-#endif
 }
 
 static long
commit 46785c04bca16f495af3ed8d685aee939a1a8f39
Author: Matt Turner <mattst88 at gmail.com>
Date:   Tue Oct 13 20:40:59 2009 -0400

    [alpha] don't return from void functions
    
    Signed-off-by: Matt Turner <mattst88 at gmail.com>

diff --git a/hw/xfree86/os-support/linux/lnx_ev56.c b/hw/xfree86/os-support/linux/lnx_ev56.c
index e751da2..c65e1cc 100644
--- a/hw/xfree86/os-support/linux/lnx_ev56.c
+++ b/hw/xfree86/os-support/linux/lnx_ev56.c
@@ -94,28 +94,34 @@ writeDense32(int Value, pointer Base, register unsigned long Offset)
 void
 _dense_outb(char val, unsigned long port)
 {
-  if ((port & ~0xffff) == 0) return _outb(val, port);
-
+  if ((port & ~0xffff) == 0) {
+  _outb(val, port);
+  } else {
   write_mem_barrier();
   *(volatile CARD8 *)port = val;
+  }
 }
 
 void
 _dense_outw(short val, unsigned long port)
 {
-  if ((port & ~0xffff) == 0) return _outw(val, port);
-
+  if ((port & ~0xffff) == 0) {
+  _outw(val, port);
+  } else {
   write_mem_barrier();
   *(volatile CARD16 *)port = val;
+  }
 }
 
 void
 _dense_outl(int val, unsigned long port)
 {
-  if ((port & ~0xffff) == 0) return _outl(val, port);
-
+  if ((port & ~0xffff) == 0) {
+  _outl(val, port);
+  } else {
   write_mem_barrier();
   *(volatile CARD32 *)port = val;
+  }
 }
 
 unsigned int
commit 34eddbbb73bb16395dba0818247909c1b4bee4c2
Author: Michael Cree <mcree at orcon.net.nz>
Date:   Wed Oct 7 18:33:29 2009 -0400

    Fix undefined symbols on alpha
    
    Signed-off-by: Matt Turner <mattst88 at gmail.com>

diff --git a/hw/xfree86/os-support/linux/lnx_axp.c b/hw/xfree86/os-support/linux/lnx_axp.c
index 8571c04..34129cc 100644
--- a/hw/xfree86/os-support/linux/lnx_axp.c
+++ b/hw/xfree86/os-support/linux/lnx_axp.c
@@ -125,12 +125,12 @@ extern unsigned int _dense_inb(unsigned long);
 extern unsigned int _dense_inw(unsigned long);
 extern unsigned int _dense_inl(unsigned long);
 
-void (*_alpha_outb)(char, unsigned long) = _outb;
-void (*_alpha_outw)(short, unsigned long) = _outw;
-void (*_alpha_outl)(int, unsigned long) = _outl;
-unsigned int (*_alpha_inb)(unsigned long) = _inb;
-unsigned int (*_alpha_inw)(unsigned long) = _inw;
-unsigned int (*_alpha_inl)(unsigned long) = _inl;
+_X_EXPORT void (*_alpha_outb)(char, unsigned long) = _outb;
+_X_EXPORT void (*_alpha_outw)(short, unsigned long) = _outw;
+_X_EXPORT void (*_alpha_outl)(int, unsigned long) = _outl;
+_X_EXPORT unsigned int (*_alpha_inb)(unsigned long) = _inb;
+_X_EXPORT unsigned int (*_alpha_inw)(unsigned long) = _inw;
+_X_EXPORT unsigned int (*_alpha_inl)(unsigned long) = _inl;
 
 static long _alpha_iobase_query(unsigned, int, int, int);
 long (*_iobase)(unsigned, int, int, int) = _alpha_iobase_query;
commit 9625f6d328d6f516520930227b218979309938bc
Author: Matt Turner <mattst88 at gmail.com>
Date:   Tue Oct 6 20:58:30 2009 -0400

    Fix breakage on alpha caused by c7680befe5ae
    
    Pinpointed by by Michael Cree.
    
    Commit c7680befe5ae removed Jensen support, but at the same time broke
    support for dense memory systems.
    
    Signed-off-by: Matt Turner <mattst88 at gmail.com>

diff --git a/hw/xfree86/os-support/misc/SlowBcopy.c b/hw/xfree86/os-support/misc/SlowBcopy.c
index 182a3e6..0021b55 100644
--- a/hw/xfree86/os-support/misc/SlowBcopy.c
+++ b/hw/xfree86/os-support/misc/SlowBcopy.c
@@ -59,10 +59,16 @@ xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len)
 
 #ifdef linux
 
+unsigned long _bus_base(void);
+
+#define useSparse() (!_bus_base())
+
 #define SPARSE (7)
 
 #else
 
+#define useSparse() 0
+
 #define SPARSE 0
 
 #endif
@@ -70,32 +76,42 @@ xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len)
 void
 xf86SlowBCopyFromBus(unsigned char *src, unsigned char *dst, int count)
 {
-    unsigned long addr;
-    long result;
-
-    addr = (unsigned long) src;
-    while( count ){
-	result = *(volatile int *) addr;
-	result >>= ((addr>>SPARSE) & 3) * 8;
-	*dst++ = (unsigned char) (0xffUL & result);
-	addr += 1<<SPARSE;
-	count--;
-	outb(0x80, 0x00);
-    }
+	if (useSparse())
+	{
+		unsigned long addr;
+		long result;
+
+		addr = (unsigned long) src;
+		while (count) {
+			result = *(volatile int *) addr;
+			result >>= ((addr>>SPARSE) & 3) * 8;
+			*dst++ = (unsigned char) (0xffUL & result);
+			addr += 1<<SPARSE;
+			count--;
+			outb(0x80, 0x00);
+		}
+	}
+	else
+		xf86SlowBcopy(src, dst, count);
 }
-  
+
 void
 xf86SlowBCopyToBus(unsigned char *src, unsigned char *dst, int count)
 {
-    unsigned long addr;
-
-    addr = (unsigned long) dst;
-    while(count) {
-	*(volatile unsigned int *) addr = (unsigned short)(*src) * 0x01010101;
-	src++;
-	addr += 1<<SPARSE;
-	count--;
-	outb(0x80, 0x00);
-    }
+	if (useSparse())
+	{
+		unsigned long addr;
+
+		addr = (unsigned long) dst;
+		while (count) {
+			*(volatile unsigned int *) addr = (unsigned short)(*src) * 0x01010101;
+			src++;
+			addr += 1<<SPARSE;
+			count--;
+			outb(0x80, 0x00);
+		}
+	}
+	else
+		xf86SlowBcopy(src, dst, count);
 }
 #endif
commit aa07957373fd7cbe67458a001e4afd6a7f1ea37f
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Sep 28 12:20:03 2009 +1000

    Revert "alpha: kill xf86SlowBCopyToBus and xf86SlowBCopyFromBus"
    
    The vesa driver still uses slowbcopy_frombus and slowbcopy_tobus.
    
    This reverts commit 5ef53a94ce4e48e11de26290cd677266308640c8.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index cdb493a..a450bd6 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -1211,6 +1211,8 @@ extern _X_EXPORT void (*xf86WriteMmio32)(int, void *, unsigned long);
 extern _X_EXPORT void (*xf86WriteMmioNB8)(int, void *, unsigned long);
 extern _X_EXPORT void (*xf86WriteMmioNB16)(int, void *, unsigned long);
 extern _X_EXPORT void (*xf86WriteMmioNB32)(int, void *, unsigned long);
+extern _X_EXPORT void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int);
+extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int);
 
 /* Some macros to hide the system dependencies for MMIO accesses */
 /* Changed to kill noise generated by gcc's -Wcast-align */
@@ -1342,4 +1344,18 @@ extern _X_EXPORT void (*xf86WriteMmioNB32)(int, void *, unsigned long);
 #  define MMIO_MOVE32(base, offset, val) MMIO_OUT32(base, offset, val)
 
 # endif /* __alpha__ */
+
+/*
+ * With Intel, the version in os-support/misc/SlowBcopy.s is used.
+ * This avoids port I/O during the copy (which causes problems with
+ * some hardware).
+ */
+# ifdef __alpha__
+#  define slowbcopy_tobus(src,dst,count) xf86SlowBCopyToBus(src,dst,count)
+#  define slowbcopy_frombus(src,dst,count) xf86SlowBCopyFromBus(src,dst,count)
+# else /* __alpha__ */
+#  define slowbcopy_tobus(src,dst,count) xf86SlowBcopy(src,dst,count)
+#  define slowbcopy_frombus(src,dst,count) xf86SlowBcopy(src,dst,count)
+# endif /* __alpha__ */
+
 #endif /* _COMPILER_H */
diff --git a/hw/xfree86/os-support/misc/SlowBcopy.c b/hw/xfree86/os-support/misc/SlowBcopy.c
index 8a5017e..182a3e6 100644
--- a/hw/xfree86/os-support/misc/SlowBcopy.c
+++ b/hw/xfree86/os-support/misc/SlowBcopy.c
@@ -1,8 +1,15 @@
+/*******************************************************************************
+  for Alpha Linux
+*******************************************************************************/
+ 
 /* 
  *   Create a dependency that should be immune from the effect of register
  *   renaming as is commonly seen in superscalar processors.  This should
  *   insert a minimum of 100-ns delays between reads/writes at clock rates
  *   up to 100 MHz---GGL
+ *   
+ *   Slowbcopy(char *src, char *dst, int count)   
+ *   
  */ 
 
 #ifdef HAVE_XORG_CONFIG_H
@@ -47,3 +54,48 @@ xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len)
     while(len--)
 	*dst++ = *src++;
 }
+
+#ifdef __alpha__
+
+#ifdef linux
+
+#define SPARSE (7)
+
+#else
+
+#define SPARSE 0
+
+#endif
+
+void
+xf86SlowBCopyFromBus(unsigned char *src, unsigned char *dst, int count)
+{
+    unsigned long addr;
+    long result;
+
+    addr = (unsigned long) src;
+    while( count ){
+	result = *(volatile int *) addr;
+	result >>= ((addr>>SPARSE) & 3) * 8;
+	*dst++ = (unsigned char) (0xffUL & result);
+	addr += 1<<SPARSE;
+	count--;
+	outb(0x80, 0x00);
+    }
+}
+  
+void
+xf86SlowBCopyToBus(unsigned char *src, unsigned char *dst, int count)
+{
+    unsigned long addr;
+
+    addr = (unsigned long) dst;
+    while(count) {
+	*(volatile unsigned int *) addr = (unsigned short)(*src) * 0x01010101;
+	src++;
+	addr += 1<<SPARSE;
+	count--;
+	outb(0x80, 0x00);
+    }
+}
+#endif
diff --git a/hw/xfree86/os-support/shared/bios_mmap.c b/hw/xfree86/os-support/shared/bios_mmap.c
index a615a1d..40afd5b 100644
--- a/hw/xfree86/os-support/shared/bios_mmap.c
+++ b/hw/xfree86/os-support/shared/bios_mmap.c
@@ -131,7 +131,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
 		return(-1);
 	}
 
-	xf86SlowBcopy((unsigned char *)(base+Offset), Buf, Len);
+	xf86SlowBCopyFromBus((unsigned char *)(base+Offset), Buf, Len);
 
 	munmap((caddr_t)base, mlen);
 	close(fd);
diff --git a/hw/xfree86/vgahw/vgaHW.c b/hw/xfree86/vgahw/vgaHW.c
index 025dde2..004376b 100644
--- a/hw/xfree86/vgahw/vgaHW.c
+++ b/hw/xfree86/vgahw/vgaHW.c
@@ -793,7 +793,7 @@ vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
     if (hwp->FontInfo1) {
 	hwp->writeSeq(hwp, 0x02, 0x04);	/* write to plane 2 */
 	hwp->writeGr(hwp, 0x04, 0x02);	/* read plane 2 */
-	xf86SlowBcopy(hwp->FontInfo1, hwp->Base, FONT_AMOUNT);
+	slowbcopy_tobus(hwp->FontInfo1, hwp->Base, FONT_AMOUNT);
     }
 #endif
 
@@ -801,7 +801,7 @@ vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
     if (hwp->FontInfo2) {
 	hwp->writeSeq(hwp, 0x02, 0x08);	/* write to plane 3 */
 	hwp->writeGr(hwp, 0x04, 0x03);	/* read plane 3 */
-	xf86SlowBcopy(hwp->FontInfo2, hwp->Base, FONT_AMOUNT);
+	slowbcopy_tobus(hwp->FontInfo2, hwp->Base, FONT_AMOUNT);
     }
 #endif
 
@@ -809,10 +809,10 @@ vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
     if (hwp->TextInfo) {
 	hwp->writeSeq(hwp, 0x02, 0x01);	/* write to plane 0 */
 	hwp->writeGr(hwp, 0x04, 0x00);	/* read plane 0 */
-	xf86SlowBcopy(hwp->TextInfo, hwp->Base, TEXT_AMOUNT);
+	slowbcopy_tobus(hwp->TextInfo, hwp->Base, TEXT_AMOUNT);
 	hwp->writeSeq(hwp, 0x02, 0x02);	/* write to plane 1 */
 	hwp->writeGr(hwp, 0x04, 0x01);	/* read plane 1 */
-	xf86SlowBcopy((unsigned char *)hwp->TextInfo + TEXT_AMOUNT,
+	slowbcopy_tobus((unsigned char *)hwp->TextInfo + TEXT_AMOUNT,
 			hwp->Base, TEXT_AMOUNT);
     }
 #endif
@@ -971,24 +971,24 @@ vgaHWSaveFonts(ScrnInfoPtr scrninfp, vgaRegPtr save)
     if (hwp->FontInfo1 || (hwp->FontInfo1 = xalloc(FONT_AMOUNT))) {
 	hwp->writeSeq(hwp, 0x02, 0x04);	/* write to plane 2 */
 	hwp->writeGr(hwp, 0x04, 0x02);	/* read plane 2 */
-	xf86SlowBcopy(hwp->Base, hwp->FontInfo1, FONT_AMOUNT);
+	slowbcopy_frombus(hwp->Base, hwp->FontInfo1, FONT_AMOUNT);
     }
 #endif /* SAVE_FONT1 */
 #if SAVE_FONT2
     if (hwp->FontInfo2 || (hwp->FontInfo2 = xalloc(FONT_AMOUNT))) {
 	hwp->writeSeq(hwp, 0x02, 0x08);	/* write to plane 3 */
 	hwp->writeGr(hwp, 0x04, 0x03);	/* read plane 3 */
-	xf86SlowBcopy(hwp->Base, hwp->FontInfo2, FONT_AMOUNT);
+	slowbcopy_frombus(hwp->Base, hwp->FontInfo2, FONT_AMOUNT);
     }
 #endif /* SAVE_FONT2 */
 #if SAVE_TEXT
     if (hwp->TextInfo || (hwp->TextInfo = xalloc(2 * TEXT_AMOUNT))) {
 	hwp->writeSeq(hwp, 0x02, 0x01);	/* write to plane 0 */
 	hwp->writeGr(hwp, 0x04, 0x00);	/* read plane 0 */
-	xf86SlowBcopy(hwp->Base, hwp->TextInfo, TEXT_AMOUNT);
+	slowbcopy_frombus(hwp->Base, hwp->TextInfo, TEXT_AMOUNT);
 	hwp->writeSeq(hwp, 0x02, 0x02);	/* write to plane 1 */
 	hwp->writeGr(hwp, 0x04, 0x01);	/* read plane 1 */
-	xf86SlowBcopy(hwp->Base,
+	slowbcopy_frombus(hwp->Base,
 		(unsigned char *)hwp->TextInfo + TEXT_AMOUNT, TEXT_AMOUNT);
     }
 #endif /* SAVE_TEXT */


More information about the xorg-commit mailing list