rpms/xorg-x11/FC-3 xorg-x11-6.8.2-use-linux-native-pciscan-by-default.patch, 1.3, 1.4 xorg-x11.spec, 1.82, 1.83

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Sep 19 23:28:04 UTC 2005


Author: krh

Update of /cvs/dist/rpms/xorg-x11/FC-3
In directory cvs.devel.redhat.com:/tmp/cvs-serv29616

Modified Files:
	xorg-x11-6.8.2-use-linux-native-pciscan-by-default.patch 
	xorg-x11.spec 
Log Message:
* Mon Sep 19 2005 Kristian Høgsberg <krh at redhat.com> 6.8.2-1.FC3.45.1
- Fix broken byteswapping in the pci config patch (#168717).



xorg-x11-6.8.2-use-linux-native-pciscan-by-default.patch:
 int10/helper_exec.c       |  104 +++++++++++++++++++++++++++++++++++++++-------
 os-support/bus/Pci.c      |   61 +++++++++++++++++++++-----
 os-support/bus/Pci.h      |   11 ++++
 os-support/bus/linuxPci.c |   69 ++++++++++++++++++++++++++++++
 4 files changed, 217 insertions(+), 28 deletions(-)

Index: xorg-x11-6.8.2-use-linux-native-pciscan-by-default.patch
===================================================================
RCS file: /cvs/dist/rpms/xorg-x11/FC-3/xorg-x11-6.8.2-use-linux-native-pciscan-by-default.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- xorg-x11-6.8.2-use-linux-native-pciscan-by-default.patch	13 Sep 2005 18:35:42 -0000	1.3
+++ xorg-x11-6.8.2-use-linux-native-pciscan-by-default.patch	19 Sep 2005 23:28:00 -0000	1.4
@@ -1,183 +1,47 @@
---- xc/programs/Xserver/hw/xfree86/int10/helper_exec.c.use-linux-native-pciscan-by-default	2004-04-23 15:54:06.000000000 -0400
-+++ xc/programs/Xserver/hw/xfree86/int10/helper_exec.c	2005-09-13 14:00:13.131077360 -0400
-@@ -23,10 +23,12 @@
- #include "int10Defines.h"
- #include "xf86int10.h"
- 
--#if !defined (_PC) && !defined (_PC_PCI)
- static int pciCfg1in(CARD16 addr, CARD32 *val);
- static int pciCfg1out(CARD16 addr, CARD32 val);
--#endif
-+static int pciCfg1inw(CARD16 addr, CARD16 *val);
-+static int pciCfg1outw(CARD16 addr, CARD16 val);
-+static int pciCfg1inb(CARD16 addr, CARD8 *val);
-+static int pciCfg1outb(CARD16 addr, CARD8 val);
- #if defined (_PC)
- static void SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set);
- #endif
-@@ -321,7 +323,8 @@
- 	}
- #endif /* __NOT_YET__ */
-     } else {
--	val = inb(Int10Current->ioBase + port);
-+	if (!pciCfg1inb(port, &val))
-+	    val = inb(Int10Current->ioBase + port);
- #ifdef PRINT_PORT
- 	ErrorF(" inb(%#x) = %2.2x\n", port, val);
- #endif
-@@ -343,7 +346,8 @@
- 	(void)getsecs(&sec, &usec);
- 	val = (CARD16)(usec / 3);
-     } else {
--	val = inw(Int10Current->ioBase + port);
-+	if (!pciCfg1inw(port, &val))
-+	    val = inw(Int10Current->ioBase + port);
-     }
- #ifdef PRINT_PORT
-     ErrorF(" inw(%#x) = %4.4x\n", port, val);
-@@ -380,7 +384,8 @@
- #ifdef PRINT_PORT
- 	ErrorF(" outb(%#x, %2.2x)\n", port, val);
- #endif
--	outb(Int10Current->ioBase + port, val);
-+	if (!pciCfg1outb(port, val))
-+	    outb(Int10Current->ioBase + port, val);
-     }
- }
- 
-@@ -391,7 +396,8 @@
-     ErrorF(" outw(%#x, %4.4x)\n", port, val);
- #endif
- 
--    outw(Int10Current->ioBase + port, val);
-+    if (!pciCfg1outw(port, val))
-+	outw(Int10Current->ioBase + port, val);
- }
- 
- CARD32
-@@ -399,10 +405,8 @@
- {
-     CARD32 val;
- 
--#if !defined(_PC) && !defined(_PC_PCI)
-     if (!pciCfg1in(port, &val))
--#endif
--    val = inl(Int10Current->ioBase + port);
-+	val = inl(Int10Current->ioBase + port);
- 
- #ifdef PRINT_PORT
-     ErrorF(" inl(%#x) = %8.8x\n", port, val);
-@@ -417,10 +421,8 @@
-     ErrorF(" outl(%#x, %8.8x)\n", port, val);
+Patch by Kevin E. Martin <kem at redhat.com> based off a patch from Dell,
+which changes the X server to use Linux native /proc based PCI
+interfaces by default instead of bitbanging PCI config space directly.
+
+Patch updated by Olivier Baudron <olivier.baudron at m4x.org> to fix all
+occurrences of PCI config space access.
+
+This fixes a problem in Linux where other software may be probing PCI
+config space using the native interfaces correctly and the kernel PCI
+lock is held, then the X server starts up and simultaneously stomps on
+PCI space, generally causing the machine to hang.
+
+Fixes bugs:
+       https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=152608
+       https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=118130
+
+This may also fix the following bugs (unconfirmed):
+       https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=146386
+
+Update: This is a forward port of a patch we added to XFree86-4.3.0 for
+RHEL-3.  The only modification is the changes to xf86Globals.c were
+dropped, as they're included in xorg-x11 stock code already.
+
+    Mike A. Harris <mharris at redhat.com>
+
+This bug is nominated for the 6.8.3 release as attachment 2285.
+       https://bugs.freedesktop.org/show_bug.cgi?id=2880
+
+
+--- xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h.use-linux-native-pciscan-by-default	2005-09-19 14:05:14.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h	2005-09-19 14:29:20.000000000 -0400
+@@ -190,8 +190,11 @@
+ 			 ((val >>  8) & 0x0000ff00) |	\
+ 			 ((val <<  8) & 0x00ff0000) |	\
+ 			 ((val << 24) & 0xff000000))
++#define PCI_CPU16(val)	(((val >>  8) & 0x000000ff) |	\
++			 ((val <<  8) & 0x0000ff00))
+ #else
+ #define PCI_CPU(val)	(val)
++#define PCI_CPU16(val)	(val)
  #endif
  
--#if !defined(_PC) && !defined(_PC_PCI)
-     if (!pciCfg1out(port, val))
--#endif
--    outl(Int10Current->ioBase + port, val);
-+	outl(Int10Current->ioBase + port, val);
- }
- 
- CARD8
-@@ -459,7 +461,6 @@
-     (*Int10Current->mem->wl)(Int10Current, addr, val);
- }
- 
--#if !defined(_PC) && !defined(_PC_PCI)
- static CARD32 PciCfg1Addr = 0;
- 
- #define TAG(Cfg1Addr) (Cfg1Addr & 0xffff00)
-@@ -487,12 +488,85 @@
- 	return 1;
-     }
-     if (addr == 0xCFC) {
--	pciWriteLong(TAG(PciCfg1Addr), OFFSET(PciCfg1Addr),val);
-+	pciWriteLong(TAG(PciCfg1Addr), OFFSET(PciCfg1Addr), val);
-+	return 1;
-+    }
-+    return 0;
-+}
-+
-+static int
-+pciCfg1inw(CARD16 addr, CARD16 *val)
-+{
-+    int offset, shift;
-+
-+    if ((addr >= 0xCF8) && (addr <= 0xCFB)) {
-+	shift = (addr - 0xCF8) * 8;
-+	*val = (PciCfg1Addr >> shift) & 0xffff;
-+	return 1;
-+    }
-+    if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
-+	offset = addr - 0xCFC;
-+	*val = pciReadWord(TAG(PciCfg1Addr), OFFSET(PciCfg1Addr) + offset);
-+	return 1;
-+    }
-+    return 0;
-+}
-+
-+static int
-+pciCfg1outw(CARD16 addr, CARD16 val)
-+{
-+    int offset, shift;
-+
-+    if ((addr >= 0xCF8) && (addr <= 0xCFB)) {
-+	shift = (addr - 0xCF8) * 8;
-+	PciCfg1Addr &= ~(0xffff << shift);
-+	PciCfg1Addr |= ((CARD32) val) << shift;
-+	return 1;
-+    }
-+    if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
-+	offset = addr - 0xCFC;
-+	pciWriteWord(TAG(PciCfg1Addr), OFFSET(PciCfg1Addr) + offset, val);
-+	return 1;
-+    }
-+    return 0;
-+}
-+
-+static int
-+pciCfg1inb(CARD16 addr, CARD8 *val)
-+{
-+    int offset, shift;
-+
-+    if ((addr >= 0xCF8) && (addr <= 0xCFB)) {
-+	shift = (addr - 0xCF8) * 8;
-+	*val = (PciCfg1Addr >> shift) & 0xff;
-+	return 1;
-+    }
-+    if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
-+	offset = addr - 0xCFC;
-+	*val = pciReadByte(TAG(PciCfg1Addr), OFFSET(PciCfg1Addr) + offset);
-+	return 1;
-+    }
-+    return 0;
-+}
-+
-+static int
-+pciCfg1outb(CARD16 addr, CARD8 val)
-+{
-+    int offset, shift;
-+
-+    if ((addr >= 0xCF8) && (addr <= 0xCFB)) {
-+	shift = (addr - 0xCF8) * 8;
-+	PciCfg1Addr &= ~(0xff << shift);
-+	PciCfg1Addr |= ((CARD32) val) << shift;
-+	return 1;
-+    }
-+    if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
-+	offset = addr - 0xCFC;
-+	pciWriteByte(TAG(PciCfg1Addr), OFFSET(PciCfg1Addr) + offset, val);
- 	return 1;
-     }
-     return 0;
- }
--#endif
- 
- CARD8
- bios_checksum(CARD8 *start, int size)
---- xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h.use-linux-native-pciscan-by-default	2005-09-13 13:59:11.113505464 -0400
-+++ xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h	2005-09-13 13:59:11.191493608 -0400
-@@ -379,6 +379,14 @@
+ /*
+@@ -379,6 +382,14 @@
  	void    (*pciGetBridgeBuses)(int, int *, int *, int *);
  	/* Use pointer's to avoid #include recursion */
  	void    (*pciGetBridgeResources)(int, pointer *, pointer *, pointer *);
@@ -193,7 +57,7 @@
  
  /*
 --- xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c.use-linux-native-pciscan-by-default	2004-12-15 00:48:20.000000000 -0500
-+++ xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c	2005-09-13 13:59:11.192493456 -0400
++++ xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c	2005-09-19 14:34:38.000000000 -0400
 @@ -60,12 +60,28 @@
  static void linuxPciCfgWrite(PCITAG, int off, CARD32 val);
  static void linuxPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits);
@@ -224,7 +88,7 @@
  };
  
  static pciBusInfo_t linuxPci0 = {
-@@ -179,6 +195,58 @@
+@@ -179,6 +195,57 @@
  	}
  }
  
@@ -239,7 +103,7 @@
 +		read(fd,&val,1);
 +	}
 +
-+	return PCI_CPU(val);
++	return val;
 +}
 +
 +static void
@@ -249,7 +113,6 @@
 +
 +	if (-1 != (fd = linuxPciOpenFile(tag))) {
 +		lseek(fd,off,SEEK_SET);
-+		val = PCI_CPU(val);
 +		write(fd, &val, 1);
 +	}
 +}
@@ -265,7 +128,7 @@
 +		read(fd, &val, 2);
 +	}
 +
-+	return PCI_CPU(val) >> 16;
++	return PCI_CPU16(val);
 +}
 +
 +static void
@@ -275,7 +138,7 @@
 +
 +	if (-1 != (fd = linuxPciOpenFile(tag))) {
 +		lseek(fd, off, SEEK_SET);
-+		val = PCI_CPU(val);
++		val = PCI_CPU16(val);
 +		write(fd, &val, 2);
 +	}
 +}
@@ -284,7 +147,7 @@
  
  /*
 --- xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c.use-linux-native-pciscan-by-default	2004-12-15 00:52:16.000000000 -0500
-+++ xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c	2005-09-13 13:59:11.193493304 -0400
++++ xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c	2005-09-19 14:05:15.000000000 -0400
 @@ -322,14 +322,24 @@
    CARD32 tmp;
    int    shift = (offset & 3) * 8;
@@ -392,3 +255,180 @@
  }
  
  void
+--- xc/programs/Xserver/hw/xfree86/int10/helper_exec.c.use-linux-native-pciscan-by-default	2004-04-23 15:54:06.000000000 -0400
++++ xc/programs/Xserver/hw/xfree86/int10/helper_exec.c	2005-09-19 14:05:15.000000000 -0400
+@@ -23,10 +23,12 @@
+ #include "int10Defines.h"
+ #include "xf86int10.h"
+ 
+-#if !defined (_PC) && !defined (_PC_PCI)
+ static int pciCfg1in(CARD16 addr, CARD32 *val);
+ static int pciCfg1out(CARD16 addr, CARD32 val);
+-#endif
++static int pciCfg1inw(CARD16 addr, CARD16 *val);
++static int pciCfg1outw(CARD16 addr, CARD16 val);
++static int pciCfg1inb(CARD16 addr, CARD8 *val);
++static int pciCfg1outb(CARD16 addr, CARD8 val);
+ #if defined (_PC)
+ static void SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set);
+ #endif
+@@ -321,7 +323,8 @@
+ 	}
+ #endif /* __NOT_YET__ */
+     } else {
+-	val = inb(Int10Current->ioBase + port);
++	if (!pciCfg1inb(port, &val))
++	    val = inb(Int10Current->ioBase + port);
+ #ifdef PRINT_PORT
+ 	ErrorF(" inb(%#x) = %2.2x\n", port, val);
+ #endif
+@@ -343,7 +346,8 @@
+ 	(void)getsecs(&sec, &usec);
+ 	val = (CARD16)(usec / 3);
+     } else {
+-	val = inw(Int10Current->ioBase + port);
++	if (!pciCfg1inw(port, &val))
++	    val = inw(Int10Current->ioBase + port);
+     }
+ #ifdef PRINT_PORT
+     ErrorF(" inw(%#x) = %4.4x\n", port, val);
+@@ -380,7 +384,8 @@
+ #ifdef PRINT_PORT
+ 	ErrorF(" outb(%#x, %2.2x)\n", port, val);
+ #endif
+-	outb(Int10Current->ioBase + port, val);
++	if (!pciCfg1outb(port, val))
++	    outb(Int10Current->ioBase + port, val);
+     }
+ }
+ 
+@@ -391,7 +396,8 @@
+     ErrorF(" outw(%#x, %4.4x)\n", port, val);
+ #endif
+ 
+-    outw(Int10Current->ioBase + port, val);
++    if (!pciCfg1outw(port, val))
++	outw(Int10Current->ioBase + port, val);
+ }
+ 
+ CARD32
+@@ -399,10 +405,8 @@
+ {
+     CARD32 val;
+ 
+-#if !defined(_PC) && !defined(_PC_PCI)
+     if (!pciCfg1in(port, &val))
+-#endif
+-    val = inl(Int10Current->ioBase + port);
++	val = inl(Int10Current->ioBase + port);
+ 
+ #ifdef PRINT_PORT
+     ErrorF(" inl(%#x) = %8.8x\n", port, val);
+@@ -417,10 +421,8 @@
+     ErrorF(" outl(%#x, %8.8x)\n", port, val);
+ #endif
+ 
+-#if !defined(_PC) && !defined(_PC_PCI)
+     if (!pciCfg1out(port, val))
+-#endif
+-    outl(Int10Current->ioBase + port, val);
++	outl(Int10Current->ioBase + port, val);
+ }
+ 
+ CARD8
+@@ -459,7 +461,6 @@
+     (*Int10Current->mem->wl)(Int10Current, addr, val);
+ }
+ 
+-#if !defined(_PC) && !defined(_PC_PCI)
+ static CARD32 PciCfg1Addr = 0;
+ 
+ #define TAG(Cfg1Addr) (Cfg1Addr & 0xffff00)
+@@ -487,12 +488,85 @@
+ 	return 1;
+     }
+     if (addr == 0xCFC) {
+-	pciWriteLong(TAG(PciCfg1Addr), OFFSET(PciCfg1Addr),val);
++	pciWriteLong(TAG(PciCfg1Addr), OFFSET(PciCfg1Addr), val);
++	return 1;
++    }
++    return 0;
++}
++
++static int
++pciCfg1inw(CARD16 addr, CARD16 *val)
++{
++    int offset, shift;
++
++    if ((addr >= 0xCF8) && (addr <= 0xCFB)) {
++	shift = (addr - 0xCF8) * 8;
++	*val = (PciCfg1Addr >> shift) & 0xffff;
++	return 1;
++    }
++    if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
++	offset = addr - 0xCFC;
++	*val = pciReadWord(TAG(PciCfg1Addr), OFFSET(PciCfg1Addr) + offset);
++	return 1;
++    }
++    return 0;
++}
++
++static int
++pciCfg1outw(CARD16 addr, CARD16 val)
++{
++    int offset, shift;
++
++    if ((addr >= 0xCF8) && (addr <= 0xCFB)) {
++	shift = (addr - 0xCF8) * 8;
++	PciCfg1Addr &= ~(0xffff << shift);
++	PciCfg1Addr |= ((CARD32) val) << shift;
++	return 1;
++    }
++    if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
++	offset = addr - 0xCFC;
++	pciWriteWord(TAG(PciCfg1Addr), OFFSET(PciCfg1Addr) + offset, val);
++	return 1;
++    }
++    return 0;
++}
++
++static int
++pciCfg1inb(CARD16 addr, CARD8 *val)
++{
++    int offset, shift;
++
++    if ((addr >= 0xCF8) && (addr <= 0xCFB)) {
++	shift = (addr - 0xCF8) * 8;
++	*val = (PciCfg1Addr >> shift) & 0xff;
++	return 1;
++    }
++    if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
++	offset = addr - 0xCFC;
++	*val = pciReadByte(TAG(PciCfg1Addr), OFFSET(PciCfg1Addr) + offset);
++	return 1;
++    }
++    return 0;
++}
++
++static int
++pciCfg1outb(CARD16 addr, CARD8 val)
++{
++    int offset, shift;
++
++    if ((addr >= 0xCF8) && (addr <= 0xCFB)) {
++	shift = (addr - 0xCF8) * 8;
++	PciCfg1Addr &= ~(0xff << shift);
++	PciCfg1Addr |= ((CARD32) val) << shift;
++	return 1;
++    }
++    if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
++	offset = addr - 0xCFC;
++	pciWriteByte(TAG(PciCfg1Addr), OFFSET(PciCfg1Addr) + offset, val);
+ 	return 1;
+     }
+     return 0;
+ }
+-#endif
+ 
+ CARD8
+ bios_checksum(CARD8 *start, int size)


Index: xorg-x11.spec
===================================================================
RCS file: /cvs/dist/rpms/xorg-x11/FC-3/xorg-x11.spec,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -r1.82 -r1.83
--- xorg-x11.spec	14 Sep 2005 21:35:36 -0000	1.82
+++ xorg-x11.spec	19 Sep 2005 23:28:00 -0000	1.83
@@ -19,7 +19,7 @@
 Name: xorg-x11
 Version: 6.8.2
 #Release: 45
-Release: 1.FC3.45
+Release: 1.FC3.45.1
 # FC4 package Release number is "m.FC4.n.s", where "m" is the last integral
 # FC4 rpm build officially released for FC4 as an update, which is '37',
 # and "n" is the FC devel rpm release that this update is based upon. ".s"
@@ -3596,6 +3596,9 @@
 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT 
 
 %changelog
+* Mon Sep 19 2005 Kristian Høgsberg <krh at redhat.com> 6.8.2-1.FC3.45.1
+- Fix broken byteswapping in the pci config patch (#168717).
+
 * Wed Sep 14 2005 Mike A. Harris <mharris at redhat.com> 6.8.2-1.FC3.45
 - Merge 6.8.2-37.FC4.48.1 (which should have been called 6.8.2-37.FC4.45.1,
   but got misnamed accidentally) into FC3 as 6.8.2-1.FC3.45 for release as




More information about the fedora-cvs-commits mailing list