From f56a9fd2aaf35f6b7f8a963fb6cb54fbc94f7112 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 2 Nov 2007 17:18:31 +0000 Subject: [PATCH] * Fri Nov 02 2007 Adam Jackson 1.4.99.1-0.6 - Merge a bunch of the more trivial patches upstream. - New git snapshot containing the merged bits. - Remove unused patches. - Drop the XFree86 obsoletes. --- xorg-x11-server-1.2.99-unbreak-domain.patch | 17 ----- xserver-1.3.0-domain-obiwan.patch | 19 ----- xserver-1.3.0-mmap-failure-check.patch | 41 ---------- xserver-1.3.0-pci-bus-count.patch | 40 ---------- xserver-1.3.0-pci-device-enable.patch | 84 --------------------- xserver-1.3.0-rom-search.patch | 13 ---- 6 files changed, 214 deletions(-) delete mode 100644 xorg-x11-server-1.2.99-unbreak-domain.patch delete mode 100644 xserver-1.3.0-domain-obiwan.patch delete mode 100644 xserver-1.3.0-mmap-failure-check.patch delete mode 100644 xserver-1.3.0-pci-bus-count.patch delete mode 100644 xserver-1.3.0-pci-device-enable.patch delete mode 100644 xserver-1.3.0-rom-search.patch diff --git a/xorg-x11-server-1.2.99-unbreak-domain.patch b/xorg-x11-server-1.2.99-unbreak-domain.patch deleted file mode 100644 index b48f299..0000000 --- a/xorg-x11-server-1.2.99-unbreak-domain.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- xorg-server-1.2.99.901/hw/xfree86/os-support/bus/linuxPci.c~ 2006-11-16 18:01:25.000000000 +0000 -+++ xorg-server-1.2.99.901/hw/xfree86/os-support/bus/linuxPci.c 2007-03-07 15:44:10.000000000 +0000 -@@ -158,7 +158,13 @@ linuxPciOpenFile(PCITAG tag, Bool write) - if (stat("/sys/bus/pci",&ignored) < 0) - is26 = 0; - else -- is26 = 1; -+ /* If we don't find the incompatible IA64 "domain support" in -+ /proc/bus/pci then we don't know domain numbers. This means -+ we ought to use /proc/bus/pci for accessing devices, instead -+ of /sys/bus/pci. So in that case we just pretend it's a 2.4 -+ kernel, and hope the kernel has set up disjoint bus numbers -+ for us, like it always used to. */ -+ is26 = domain_support; - } - - if (!domain_support && domain > 0) diff --git a/xserver-1.3.0-domain-obiwan.patch b/xserver-1.3.0-domain-obiwan.patch deleted file mode 100644 index f74c226..0000000 --- a/xserver-1.3.0-domain-obiwan.patch +++ /dev/null @@ -1,19 +0,0 @@ -commit 1b94c117e0f294ef2f89bf24d45ba7a8e45efe35 -Author: Matthias Hopf -Date: Tue Oct 10 19:37:22 2006 +0200 - - Fixing probably long-standing bug in domain support. - -diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c -index c6dad1f..7d220d0 100644 ---- a/hw/xfree86/os-support/bus/linuxPci.c -+++ b/hw/xfree86/os-support/bus/linuxPci.c -@@ -498,7 +498,7 @@ xf86GetPciDomain(PCITAG Tag) - pPCI = xf86GetPciHostConfigFromTag(Tag); - - if (pPCI && (result = PCI_DOM_FROM_BUS(pPCI->busnum))) -- return result; -+ return result + 1; - - if (!pPCI || pPCI->fakeDevice) - return 1; /* Domain 0 is reserved */ diff --git a/xserver-1.3.0-mmap-failure-check.patch b/xserver-1.3.0-mmap-failure-check.patch deleted file mode 100644 index e926ba3..0000000 --- a/xserver-1.3.0-mmap-failure-check.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- ./hw/xfree86/os-support/bus/linuxPci.c.orig 2007-03-14 09:37:44.000000000 -0600 -+++ ./hw/xfree86/os-support/bus/linuxPci.c 2007-03-14 09:41:01.000000000 -0600 -@@ -634,28 +634,28 @@ - ADDRESS Base, unsigned long Size) - { - int domain = xf86GetPciDomain(Tag); -- int fd; -+ int fd = -1; - pointer addr; - - /* - * We use /proc/bus/pci on non-legacy addresses or if the Linux sysfs - * legacy_mem interface is unavailable. - */ -- if (Base > 1024*1024) -- return linuxMapPci(ScreenNum, Flags, Tag, Base, Size, -+ if (Base >= 1024*1024) -+ addr = linuxMapPci(ScreenNum, Flags, Tag, Base, Size, - PCIIOC_MMAP_IS_MEM); -- -- if ((fd = linuxOpenLegacy(Tag, "legacy_mem")) < 0) -- return linuxMapPci(ScreenNum, Flags, Tag, Base, Size, -+ else if ((fd = linuxOpenLegacy(Tag, "legacy_mem")) < 0) -+ addr = linuxMapPci(ScreenNum, Flags, Tag, Base, Size, - PCIIOC_MMAP_IS_MEM); -+ else -+ addr = mmap(NULL, Size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, Base); - -- addr = mmap(NULL, Size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, Base); -- if (addr == MAP_FAILED) { -- close (fd); -+ if (fd >= 0) -+ close(fd); -+ if (addr == NULL || addr == MAP_FAILED) { - perror("mmap failure"); - FatalError("xf86MapDomainMem(): mmap() failure\n"); - } -- close(fd); - return addr; - } - diff --git a/xserver-1.3.0-pci-bus-count.patch b/xserver-1.3.0-pci-bus-count.patch deleted file mode 100644 index 13b5808..0000000 --- a/xserver-1.3.0-pci-bus-count.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- xorg-server-1.1.1/hw/xfree86/os-support/bus/Pci.c.jx 2007-02-12 11:08:52.000000000 -0500 -+++ xorg-server-1.1.1/hw/xfree86/os-support/bus/Pci.c 2007-03-30 12:20:08.000000000 -0400 -@@ -231,14 +231,14 @@ - int pciMaxBusNum = MAX_PCI_BUSES; - static Bool inProbe = FALSE; - --static pciConfigPtr pci_devp[MAX_PCI_DEVICES + 1] = {NULL, }; -+static pciConfigPtr *pci_devp = NULL; - - static int readPciBios( PCITAG Tag, CARD8* tmp, ADDRESS hostbase, - unsigned char * buf, int len, PciBiosType BiosType ); - - static int (*pciOSHandleBIOS)(PCITAG Tag, int basereg, unsigned char *buf, int len); - --int xf86MaxPciDevs = MAX_PCI_DEVICES; -+int xf86MaxPciDevs = 0; - - /* - * Platform specific PCI function pointers. -@@ -271,6 +271,11 @@ - if (pciNumBuses <= 0) - ARCH_PCI_OS_INIT(); - #endif -+ if (xf86MaxPciDevs == 0) -+ xf86MaxPciDevs = MAX_PCI_DEVICES; /* XXX bogus */ -+ if (pci_devp) -+ xfree(pci_devp); -+ pci_devp = xnfcalloc(xf86MaxPciDevs + 1, sizeof(pciConfigPtr)); - } - - void pciSetOSBIOSPtr(int (*bios_fn)(PCITAG Tag, int basereg, unsigned char * buf, int len)) -@@ -913,7 +918,7 @@ - * result in an endless recursion if platform/OS specific PCI - * bus probing code calls this function from with in it. - */ -- if (done || pci_devp[0]) -+ if (done || pci_devp) - return pci_devp; - - done = TRUE; diff --git a/xserver-1.3.0-pci-device-enable.patch b/xserver-1.3.0-pci-device-enable.patch deleted file mode 100644 index 35b8fb1..0000000 --- a/xserver-1.3.0-pci-device-enable.patch +++ /dev/null @@ -1,84 +0,0 @@ ---- xorg-server-1.2.99.905/hw/xfree86/common/xf86Bus.c.device-enable 2007-02-17 20:31:36.000000000 -0500 -+++ xorg-server-1.2.99.905/hw/xfree86/common/xf86Bus.c 2007-04-11 18:56:56.000000000 -0400 -@@ -42,6 +42,10 @@ - #include "xf86.h" - #include "xf86Priv.h" - #include "xf86Resources.h" -+#include "Pci.h" -+#include -+#include -+#include - - /* Bus-specific headers */ - -@@ -66,6 +70,7 @@ - BusRec primaryBus = { BUS_NONE, {{0}}}; - - static Bool xf86ResAccessEnter = FALSE; -+static int lnxEntityPrivate; - - #ifdef REDUCER - /* Resources that temporarily conflict with estimated resources */ -@@ -116,6 +121,9 @@ - #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) - xf86SbusProbe(); - #endif -+#ifdef linux -+ lnxEntityPrivate = xf86AllocateEntityPrivateIndex(); -+#endif - } - - /* -@@ -264,6 +272,39 @@ - return FALSE; - } - } -+ -+static void -+lnxEntityInit(int entityIndex, pointer private) -+{ -+ EntityProc init; -+ EntityPtr ent = xf86Entities[entityIndex]; -+ -+ if (ent->bus.type == BUS_PCI) do { -+ char file[256], buf = '\0'; -+ int fd; -+ int dom = PCI_DOM_FROM_BUS(ent->bus.id.pci.bus); -+ int bus = PCI_BUS_NO_DOMAIN(ent->bus.id.pci.bus); -+ int dev = ent->bus.id.pci.device; -+ int func = ent->bus.id.pci.func; -+ sprintf(file, "/sys/bus/pci/devices/%04x:%02x:%02x.%1x/enable", -+ dom, bus, dev, func); -+ -+ if ((fd = open(file, O_RDWR)) < 0) { -+ xf86Msg(X_ERROR, "Unable to open %s. Be afraid.\n", file); -+ break; -+ } -+ read(fd, &buf, 1); -+ if (buf = '0') { -+ xf86Msg(X_INFO, "Enabling PCI device\n"); -+ write(fd, "1", 2); -+ } -+ close(fd); -+ } while (0); -+ -+ init = xf86GetEntityPrivate(entityIndex, lnxEntityPrivate)->ptr; -+ if (init) -+ init(entityIndex, private); -+} - - _X_EXPORT Bool - xf86SetEntityFuncs(int entityIndex, EntityProc init, EntityProc enter, -@@ -271,7 +312,12 @@ - { - if (entityIndex >= xf86NumEntities) - return FALSE; -+#ifndef linux - xf86Entities[entityIndex]->entityInit = init; -+#else -+ xf86Entities[entityIndex]->entityInit = lnxEntityInit; -+ xf86GetEntityPrivate(entityIndex, lnxEntityPrivate)->ptr = init; -+#endif - xf86Entities[entityIndex]->entityEnter = enter; - xf86Entities[entityIndex]->entityLeave = leave; - xf86Entities[entityIndex]->private = private; diff --git a/xserver-1.3.0-rom-search.patch b/xserver-1.3.0-rom-search.patch deleted file mode 100644 index c18188e..0000000 --- a/xserver-1.3.0-rom-search.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- xorg-server-1.2.99.905/hw/xfree86/os-support/bus/linuxPci.c.jx 2007-04-09 16:15:43.000000000 -0400 -+++ xorg-server-1.2.99.905/hw/xfree86/os-support/bus/linuxPci.c 2007-04-09 17:37:28.000000000 -0400 -@@ -778,8 +778,8 @@ - bus = PCI_BUS_NO_DOMAIN(PCI_BUS_FROM_TAG(Tag)); - dev = PCI_DEV_FROM_TAG(Tag); - func = PCI_FUNC_FROM_TAG(Tag); -- sprintf(file, "/sys/devices/pci%04x:%02x/%04x:%02x:%02x.%1x/rom", -- dom, bus, dom, bus, dev, func); -+ sprintf(file, "/sys/bus/pci/devices/%04x:%02x:%02x.%1x/rom", -+ dom, bus, dev, func); - - /* - * If the caller wants the ROM and the sysfs rom interface exists,