From d894e86aa5bea81147c4a7ad8630bcfb04156792 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Sun, 15 Jun 2008 10:55:08 +0930 Subject: [PATCH 01/83] randr: remove superfluous check against uninitialised variable. Thanks to Eamon Walsh for pointing this out. --- randr/rrpointer.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/randr/rrpointer.c b/randr/rrpointer.c index e3b8b0395..6b934c0c6 100644 --- a/randr/rrpointer.c +++ b/randr/rrpointer.c @@ -136,14 +136,11 @@ RRPointerMoved (ScreenPtr pScreen, int x, int y) void RRPointerScreenConfigured (ScreenPtr pScreen) { - WindowPtr pRoot; + WindowPtr pRoot; ScreenPtr pCurrentScreen; int x, y; DeviceIntPtr pDev; - if (pScreen != pCurrentScreen) - return; - for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (IsPointerDevice(pDev)) From 8c9234a163eceda2abc0a2523e0f5587ea399935 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 15 Jun 2008 10:01:28 +0930 Subject: [PATCH 02/83] Xi: avoid double button mapping. Button events were mapped once in GetPointerEvents and then again in UpdateDeviceState. While it might make sense to just fix up UpdateDeviceState, it turns out to be better to leave the raw button number in the event because DGA reports raw device events without button translation, and so when it calls UpdateDeviceState, the button down counts get scrambled and buttons get stuck down. See also: http://lists.freedesktop.org/archives/xorg/2008-June/036201.html Signed-off-by: Peter Hutterer --- Xi/exevents.c | 13 +++++++++---- dix/getevents.c | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 725c57835..6f88b57f3 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1066,9 +1066,11 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count) (key == device->deviceGrab.activatingKey)) deactivateDeviceGrab = TRUE; } else if (xE->u.u.type == DeviceButtonPress) { - xE->u.u.detail = key; - if (xE->u.u.detail == 0) + xE->u.u.detail = b->map[key]; + if (xE->u.u.detail == 0) { + xE->u.u.detail = key; return; + } if (!grab && CheckDeviceGrabs(device, xE, 0, count)) { /* if a passive grab was activated, the event has been sent @@ -1077,9 +1079,11 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count) } } else if (xE->u.u.type == DeviceButtonRelease) { - xE->u.u.detail = key; - if (xE->u.u.detail == 0) + xE->u.u.detail = b->map[key]; + if (xE->u.u.detail == 0) { + xE->u.u.detail = key; return; + } if (!b->state && device->deviceGrab.fromPassiveGrab) deactivateDeviceGrab = TRUE; } @@ -1094,6 +1098,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count) if (deactivateDeviceGrab == TRUE) (*device->deviceGrab.DeactivateGrab) (device); + xE->u.u.detail = key; } _X_EXPORT int diff --git a/dix/getevents.c b/dix/getevents.c index 5227c54ec..b00bc11ca 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -1030,7 +1030,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, kbp->type = DeviceButtonPress; else if (type == ButtonRelease) kbp->type = DeviceButtonRelease; - kbp->detail = pDev->button->map[buttons]; + kbp->detail = buttons; } kbp->root_x = cx; /* root_x/y always in screen coords */ From f3490d3eba94c7d9e760d6d21991ab6677196c2b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 17 Jun 2008 10:35:24 -0400 Subject: [PATCH 03/83] Bug #15169: Make the server build again on Alpha. Still won't work until the kernel makes the resource files actually exist. --- configure.ac | 2 - hw/xfree86/os-support/bus/Makefile.am | 4 - hw/xfree86/os-support/bus/Pci.h | 77 +---- hw/xfree86/os-support/bus/axpPci.c | 415 -------------------------- 4 files changed, 14 insertions(+), 484 deletions(-) delete mode 100644 hw/xfree86/os-support/bus/axpPci.c diff --git a/configure.ac b/configure.ac index e3fc9e551..fec18caee 100644 --- a/configure.ac +++ b/configure.ac @@ -1287,8 +1287,6 @@ if test "x$XORG" = xyes; then ;; alpha*) linux_alpha=yes - XORG_OS_PCI="axp" - xorg_bus_linuxpci="no" ;; i*86|amd64*|x86_64*) linux_acpi="yes" diff --git a/hw/xfree86/os-support/bus/Makefile.am b/hw/xfree86/os-support/bus/Makefile.am index 5a15430c1..d48fcb67d 100644 --- a/hw/xfree86/os-support/bus/Makefile.am +++ b/hw/xfree86/os-support/bus/Makefile.am @@ -23,10 +23,6 @@ if XORG_BUS_SPARCPCI PCI_SOURCES += sparcPci.c endif -if LINUX_ALPHA -PCI_SOURCES += axpPci.c -endif - if XORG_BUS_SPARC PLATFORM_SOURCES = Sbus.c sdk_HEADERS += xf86Sbus.h diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h index 1385eee85..557483b9b 100644 --- a/hw/xfree86/os-support/bus/Pci.h +++ b/hw/xfree86/os-support/bus/Pci.h @@ -189,75 +189,26 @@ #define ARCH_PCI_INIT bsdPciInit #endif +#if defined(linux) +# define ARCH_PCI_INIT linuxPciInit +# if defined(__m32r__) +# define INCLUDE_XF86_MAP_PCI_MEM +# define INCLUDE_XF86_NO_DOMAIN +# endif +#endif /* defined(linux) */ + + #if !defined(ARCH_PCI_INIT) /* * Select architecture specific PCI init function */ -#if defined(__alpha__) -# if defined(linux) -# define ARCH_PCI_INIT axpPciInit -# endif -#elif defined(__arm__) -# if defined(linux) -# define ARCH_PCI_INIT linuxPciInit -# endif -#elif defined(__hppa__) -# if defined(linux) -# define ARCH_PCI_INIT linuxPciInit -# endif -#elif defined(__ia64__) -# if defined(linux) -# define ARCH_PCI_INIT linuxPciInit -# endif -#elif defined(__i386__) || defined(__i386) -# if defined(linux) -# define ARCH_PCI_INIT linuxPciInit -# else -# define ARCH_PCI_INIT ix86PciInit -# endif -#elif defined(__mc68000__) -# if defined(linux) -# define ARCH_PCI_INIT linuxPciInit -# endif -#elif defined(__mips__) -# if defined(linux) -# define ARCH_PCI_INIT linuxPciInit -# endif +#if defined(__i386__) || defined(__i386) || defined(__amd64__) || defined(__amd64) || defined(__x86_64__) +# define ARCH_PCI_INIT ix86PciInit #elif defined(__powerpc__) || defined(__powerpc64__) -# if defined(linux) -# define ARCH_PCI_INIT linuxPciInit -# else -# define ARCH_PCI_INIT ppcPciInit -# endif -#elif defined(__s390__) -# if defined(linux) -# define ARCH_PCI_INIT linuxPciInit -# endif -#elif defined(__sh__) -# if defined(linux) -# define ARCH_PCI_INIT linuxPciInit -# endif -#elif defined(__m32r__) -# if defined(linux) -# define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_MAP_PCI_MEM -# define INCLUDE_XF86_NO_DOMAIN -# endif +# define ARCH_PCI_INIT ppcPciInit #elif defined(__sparc__) || defined(sparc) -# if defined(linux) -# define ARCH_PCI_INIT linuxPciInit -# elif defined(sun) -# define ARCH_PCI_INIT sparcPciInit -# endif -# if !defined(__FreeBSD__) && !defined(linux) -# define ARCH_PCI_PCI_BRIDGE sparcPciPciBridge -# endif -#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) -# if defined(linux) -# define ARCH_PCI_INIT linuxPciInit -# else -# define ARCH_PCI_INIT ix86PciInit -# endif +# define ARCH_PCI_INIT sparcPciInit +# define ARCH_PCI_PCI_BRIDGE sparcPciPciBridge #endif #endif /* !defined(ARCH_PCI_INIT) */ diff --git a/hw/xfree86/os-support/bus/axpPci.c b/hw/xfree86/os-support/bus/axpPci.c deleted file mode 100644 index c59c06804..000000000 --- a/hw/xfree86/os-support/bus/axpPci.c +++ /dev/null @@ -1,415 +0,0 @@ -/* - * Copyright 1998 by Concurrent Computer Corporation - * - * Permission to use, copy, modify, distribute, and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Concurrent Computer - * Corporation not be used in advertising or publicity pertaining to - * distribution of the software without specific, written prior - * permission. Concurrent Computer Corporation makes no representations - * about the suitability of this software for any purpose. It is - * provided "as is" without express or implied warranty. - * - * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD - * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION BE - * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY - * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * - * Copyright 1998 by Metro Link Incorporated - * - * Permission to use, copy, modify, distribute, and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Metro Link - * Incorporated not be used in advertising or publicity pertaining to - * distribution of the software without specific, written prior - * permission. Metro Link Incorporated makes no representations - * about the suitability of this software for any purpose. It is - * provided "as is" without express or implied warranty. - * - * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD - * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED BE - * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY - * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include "compiler.h" -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" -#include "Pci.h" - -#include -#include "../linux/lnx.h" /* for _iobase */ - -/* - * Alpha/Linux platform specific PCI access functions - */ -static CARD32 axpPciCfgRead(PCITAG tag, int off); -static void axpPciCfgWrite(PCITAG, int off, CARD32 val); -static void axpPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits); - -static pciBusFuncs_t axpFuncs0 = { -/* pciReadLong */ axpPciCfgRead, -/* pciWriteLong */ axpPciCfgWrite, -/* pciSetBitsLong */ axpPciCfgSetBits, -/* pciAddrHostToBus */ pciAddrNOOP, -/* pciAddrBusToHost */ pciAddrNOOP -}; - -typedef struct _axpDomainRec { - int domain, hose; - int root_bus; - unsigned long dense_io, sparse_io; - unsigned long dense_mem, sparse_mem; - IOADDRESS mapped_io; -} axpDomainRec, *axpDomainPtr; - -#define MAX_DOMAINS (MAX_PCI_BUSES / 256) -static axpDomainPtr xf86DomainInfo[MAX_DOMAINS] = { NULL, }; -static int pciNumDomains = 0; - -/* - * For debug, domain assignment can start downward from a fixed base - * (instead of up from 0) by defining FORCE_HIGH_DOMAINS. This allows - * debug of large domain numbers and sparse domain numbering on systems - * which don't have as many hoses. - */ -#if 0 -# define FORCE_HIGH_DOMAINS MAX_DOMAINS /* assign domains downward from here */ -#endif - -/* - * If FORCE_HIGH_DOMAINS is set, make sure it's not larger than the - * max domain - */ -#if defined(FORCE_HIGH_DOMAINS) && (FORCE_HIGH_DOMAINS > MAX_DOMAINS) -# undef FORCE_HIGH_DOMAINS -# define FORCE_HIGH_DOMAINS MAX_DOMAINS -#endif - -static int -axpSetupDomains(void) -{ - axpDomainRec axpDomain; - int numDomains = 0; - int hose; - -#ifndef INCLUDE_XF86_NO_DOMAIN - -#ifdef FORCE_HIGH_DOMAINS - xf86Msg(X_WARNING, - "DEBUG OPTION FORCE_HIGH_DOMAINS in use - DRI will *NOT* work\n"); - numDomains = FORCE_HIGH_DOMAINS; -#endif - - /* - * Since each hose has a different address space, hoses are a perfect - * overlay for domains, so set up one domain for each hose present - * in the system. We have to loop through all possible hoses because - * some systems allow sparse I/O controllers. - */ - for(hose = 0; hose < MAX_DOMAINS; hose++) { - axpDomain.root_bus = _iobase(IOBASE_ROOT_BUS, hose, -1, -1); - if (axpDomain.root_bus < 0) continue; - - axpDomain.hose = hose; - -#ifndef FORCE_HIGH_DOMAINS - - axpDomain.domain = axpDomain.hose = hose; - numDomains = axpDomain.domain + 1; - -#else /* FORCE_HIGH_DOMAINS */ - - axpDomain.domain = numDomains - hose - 1; - - xf86Msg(X_WARNING, - "FORCE_HIGH_DOMAINS - assigned hose %d to domain %d\n", - axpDomain.hose, axpDomain.domain); - -#endif /* FORCE_HIGH_DOMAINS */ - - axpDomain.dense_io = _iobase(IOBASE_DENSE_IO, hose, -1, -1); - axpDomain.sparse_io = _iobase(IOBASE_SPARSE_IO, hose, -1, -1); - axpDomain.mapped_io = 0; - axpDomain.dense_mem = _iobase(IOBASE_DENSE_MEM, hose, -1, -1); - axpDomain.sparse_mem = _iobase(IOBASE_SPARSE_MEM, hose, -1, -1); - - xf86DomainInfo[axpDomain.domain] = xnfalloc(sizeof(axpDomainRec)); - *(xf86DomainInfo[axpDomain.domain]) = axpDomain; - - /* - * For now, only allow a single domain (hose) on sparse i/o systems. - * - * Allowing multiple domains on sparse systems would require: - * 1) either - * a) revamping the sparse video mapping code to allow - * for multiple unrelated address regions - * -- OR -- - * b) implementing sparse mapping directly in - * xf86MapDomainMemory - * 2) revaming read/write sparse routines to correctly handle - * the solution to 1) - * 3) implementing a sparse I/O system (mapping, inX/outX) - * independent of glibc, since the glibc version only - * supports hose 0 - */ - if (axpDomain.sparse_io) { - if (_iobase(IOBASE_ROOT_BUS, hose + 1, -1, -1) >= 0) { - /* - * It's a sparse i/o system with (at least) one more hose, - * show a message indicating that video is constrained to - * hose 0 - */ - xf86Msg(X_INFO, - "Sparse I/O system - constraining video to hose 0\n"); - } - break; - } - } - -#else /* INCLUDE_XF86_NO_DOMAIN */ - - /* - * domain support is not included, so just set up a single domain (0) - * to represent the first hose so that axpPciInit will still have - * be able to set up the root bus - */ - xf86DomainInfo[0] = xnfalloc(sizeof(axpDomainRec)); - *(xf86DomainInfo[0]) = axpDomain; - numDomains = 1; - -#endif /* INCLUDE_XF86_NO_DOMAIN */ - - return numDomains; -} - -void -axpPciInit() -{ - axpDomainPtr pDomain; - int domain, bus; - - pciNumDomains = axpSetupDomains(); - - for(domain = 0; domain < pciNumDomains; domain++) { - if (!(pDomain = xf86DomainInfo[domain])) continue; - - /* - * Since any bridged buses will be behind a probed pci-pci bridge, - * only set up the root bus for each domain (hose) and the bridged - * buses will be set up as they are found. - */ - /* make a bus with both the domain and the root bus in it */ - bus = PCI_MAKE_BUS(domain, pDomain->root_bus); - pciBusInfo[bus] = xnfalloc(sizeof(pciBusInfo_t)); - (void)memset(pciBusInfo[bus], 0, sizeof(pciBusInfo_t)); - - pciBusInfo[bus]->configMech = PCI_CFG_MECH_OTHER; - pciBusInfo[bus]->numDevices = 32; - pciBusInfo[bus]->funcs = &axpFuncs0; - pciBusInfo[bus]->pciBusPriv = pDomain; - - pciNumBuses = bus + 1; - } -} - -/* - * Alpha/Linux PCI configuration space access routines - */ -static int -axpPciBusFromTag(PCITAG tag) -{ - pciBusInfo_t *pBusInfo; - axpDomainPtr pDomain; - int bus, dfn; - - bus = PCI_BUS_FROM_TAG(tag); - if ((bus >= pciNumBuses) - || !(pBusInfo = pciBusInfo[bus]) - || !(pDomain = pBusInfo->pciBusPriv) - || (pDomain->domain != PCI_DOM_FROM_TAG(tag))) return -1; - - bus = PCI_BUS_NO_DOMAIN(bus); /* should just be root_bus */ - dfn = PCI_DFN_FROM_TAG(tag); - if (_iobase(IOBASE_HOSE, -1, bus, dfn) != pDomain->hose) return -1; - - return bus; -} - -static CARD32 -axpPciCfgRead(PCITAG tag, int off) -{ - int bus, dfn; - CARD32 val = 0xffffffff; - - if ((bus = axpPciBusFromTag(tag)) >= 0) { - dfn = PCI_DFN_FROM_TAG(tag); - - syscall(__NR_pciconfig_read, bus, dfn, off, 4, &val); - } - return(val); -} - -static void -axpPciCfgWrite(PCITAG tag, int off, CARD32 val) -{ - int bus, dfn; - - if ((bus = axpPciBusFromTag(tag)) >= 0) { - dfn = PCI_DFN_FROM_TAG(tag); - syscall(__NR_pciconfig_write, bus, dfn, off, 4, &val); - } -} - -static void -axpPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits) -{ - int bus, dfn; - CARD32 val = 0xffffffff; - - if ((bus = axpPciBusFromTag(tag)) >= 0) { - dfn = PCI_DFN_FROM_TAG(tag); - - syscall(__NR_pciconfig_read, bus, dfn, off, 4, &val); - val = (val & ~mask) | (bits & mask); - syscall(__NR_pciconfig_write, bus, dfn, off, 4, &val); - } -} - -#ifndef INCLUDE_XF86_NO_DOMAIN - -/* - * Alpha/Linux addressing domain support - */ - -_X_EXPORT int -xf86GetPciDomain(PCITAG Tag) -{ - return PCI_DOM_FROM_TAG(Tag); -} - -_X_EXPORT pointer -xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag, - ADDRESS Base, unsigned long Size) -{ - axpDomainPtr pDomain; - int domain = PCI_DOM_FROM_TAG(Tag); - - if ((domain < 0) || (domain >= pciNumDomains) || - !(pDomain = xf86DomainInfo[domain])) - FatalError("%s called with invalid parameters\n", __FUNCTION__); - - /* - * xf86MapVidMem already does what we need, but remember to subtract - * _bus_base() (the physical dense memory root of hose 0) since - * xf86MapVidMem is expecting an offset relative to _bus_base() rather - * than an actual physical address. - */ - return xf86MapVidMem(ScreenNum, Flags, - pDomain->dense_mem + Base - _bus_base(), Size); -} - -IOADDRESS -xf86MapLegacyIO(struct pci_device *dev) -{ - axpDomainPtr pDomain; - const int domain = dev->domain; - - if ((domain < 0) || (domain >= pciNumDomains) || - !(pDomain = xf86DomainInfo[domain])) - FatalError("%s called with invalid parameters\n", __FUNCTION__); - - /* - * Use glibc inx/outx routines for sparse I/O, so just return the - * base [this is ok since we also constrain sparse I/O systems to - * a single domain in axpSetupDomains()] - */ - if (pDomain->sparse_io) return 0; - - /* - * I/O addresses on Alpha are really just different physical memory - * addresses that the system corelogic turns into I/O commands on the - * bus, so just use xf86MapVidMem to map I/O as well, but remember - * to subtract _bus_base() (the physical dense memory root of hose 0) - * since xf86MapVidMem is expecting an offset relative to _bus_base() - * rather than an actual physical address. - * - * Map the entire I/O space (64kB) at once and only once. - */ - if (!pDomain->mapped_io) - pDomain->mapped_io = (IOADDRESS)xf86MapVidMem(-1, VIDMEM_MMIO, - pDomain->dense_io - _bus_base(), - 0x10000); - - return pDomain->mapped_io; -} - -resPtr -xf86AccResFromOS(resPtr pRes) -{ - resRange range; - int domain; - - for(domain = 0; domain < pciNumDomains; domain++) { - if (!xf86DomainInfo[domain]) continue; - - /* - * Fallback is to claim the following areas: - * - * 0x000c0000 - 0x000effff location of VGA and other extensions ROMS - */ - - RANGE(range, 0x000c0000, 0x000effff, - RANGE_TYPE(ResExcMemBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - - /* - * Fallback would be to claim well known ports in the 0x0 - 0x3ff - * range along with their sparse I/O aliases, but that's too - * imprecise. Instead claim a bare minimum here. - */ - RANGE(range, 0x00000000, 0x000000ff, - RANGE_TYPE(ResExcIoBlock, domain)); /* For mainboard */ - pRes = xf86AddResToList(pRes, &range, -1); - - /* - * At minimum, the top and bottom resources must be claimed, so that - * resources that are (or appear to be) unallocated can be relocated. - */ - RANGE(range, 0x00000000, 0x00000000, - RANGE_TYPE(ResExcMemBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - RANGE(range, 0xffffffff, 0xffffffff, - RANGE_TYPE(ResExcMemBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); -/* RANGE(range, 0x00000000, 0x00000000, - RANGE_TYPE(ResExcIoBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); */ - RANGE(range, 0xffffffff, 0xffffffff, - RANGE_TYPE(ResExcIoBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - } - - return pRes; -} - -#endif /* !INCLUDE_XF86_NO_DOMAIN */ - From 656d3d7623c6b83024e9cdc60d1257f4d87aa268 Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Tue, 17 Jun 2008 17:55:11 -0400 Subject: [PATCH 04/83] SELinux: Bring server-side name registry up to date. --- dix/protocol.txt | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/dix/protocol.txt b/dix/protocol.txt index f4cdf7bbb..0a85ca872 100644 --- a/dix/protocol.txt +++ b/dix/protocol.txt @@ -359,16 +359,28 @@ V000 SECURITY:AuthorizationRevoked E000 SECURITY:BadAuthorization E001 SECURITY:BadAuthorizationProtocol R000 SELinux:SELinuxQueryVersion -R001 SELinux:SELinuxSetSelectionManager -R002 SELinux:SELinuxGetSelectionManager +R001 SELinux:SELinuxSetDeviceCreateContext +R002 SELinux:SELinuxGetDeviceCreateContext R003 SELinux:SELinuxSetDeviceContext R004 SELinux:SELinuxGetDeviceContext -R005 SELinux:SELinuxSetPropertyCreateContext -R006 SELinux:SELinuxGetPropertyCreateContext -R007 SELinux:SELinuxGetPropertyContext -R008 SELinux:SELinuxSetWindowCreateContext -R009 SELinux:SELinuxGetWindowCreateContext -R010 SELinux:SELinuxGetWindowContext +R005 SELinux:SELinuxSetWindowCreateContext +R006 SELinux:SELinuxGetWindowCreateContext +R007 SELinux:SELinuxGetWindowContext +R008 SELinux:SELinuxSetPropertyCreateContext +R009 SELinux:SELinuxGetPropertyCreateContext +R010 SELinux:SELinuxSetPropertyUseContext +R011 SELinux:SELinuxGetPropertyUseContext +R012 SELinux:SELinuxGetPropertyContext +R013 SELinux:SELinuxGetPropertyDataContext +R014 SELinux:SELinuxListProperties +R015 SELinux:SELinuxSetSelectionCreateContext +R016 SELinux:SELinuxGetSelectionCreateContext +R017 SELinux:SELinuxSetSelectionUseContext +R018 SELinux:SELinuxGetSelectionUseContext +R019 SELinux:SELinuxGetSelectionContext +R020 SELinux:SELinuxGetSelectionDataContext +R021 SELinux:SELinuxListSelections +R022 SELinux:SELinuxGetClientContext R000 SHAPE:QueryVersion R001 SHAPE:Rectangles R002 SHAPE:Mask From 79dd600942bbac3c6b531f284b42c7b2c822da90 Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Tue, 17 Jun 2008 19:09:44 -0400 Subject: [PATCH 05/83] SELinux: Add an extension alias under the OS-agnostic "Flask" name. --- Xext/xselinux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Xext/xselinux.c b/Xext/xselinux.c index 1e3b4d66c..a47df03c2 100644 --- a/Xext/xselinux.c +++ b/Xext/xselinux.c @@ -2031,6 +2031,8 @@ SELinuxExtensionInit(INITARGS) ProcSELinuxDispatch, SProcSELinuxDispatch, SELinuxResetProc, StandardMinorOpcode); + AddExtensionAlias("Flask", extEntry); + /* Label objects that were created before we could register ourself */ SELinuxLabelInitial(); } From 4f3ed54dc9ea7780ff03378b13de0fddfdec2e15 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 17 Jun 2008 10:43:36 +0930 Subject: [PATCH 06/83] mi: remove trailing whitespaces from misprite.c --- mi/misprite.c | 73 ++++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/mi/misprite.c b/mi/misprite.c index c1f64ce0f..6f0cbe730 100644 --- a/mi/misprite.c +++ b/mi/misprite.c @@ -50,7 +50,7 @@ in this Software without prior written authorization from The Open Group. # include "mispritest.h" # include "dixfontstr.h" # include -# include "inputstr.h" +# include "inputstr.h" #ifdef RENDER # include "mipict.h" @@ -99,12 +99,12 @@ static void miSpriteInstallColormap(ColormapPtr pMap); static void miSpriteStoreColors(ColormapPtr pMap, int ndef, xColorItem *pdef); -static void miSpriteComputeSaved(DeviceIntPtr pDev, +static void miSpriteComputeSaved(DeviceIntPtr pDev, ScreenPtr pScreen); -static Bool miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, +static Bool miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen); -static void miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, +static void miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen); #define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = \ @@ -118,12 +118,12 @@ static void miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, */ static Bool miSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, - CursorPtr pCursor); -static Bool miSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, + CursorPtr pCursor); +static Bool miSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor); -static void miSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, +static void miSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y); -static void miSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, +static void miSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y); _X_EXPORT miPointerSpriteFuncRec miSpritePointerFuncs = { @@ -139,8 +139,8 @@ _X_EXPORT miPointerSpriteFuncRec miSpritePointerFuncs = { * other misc functions */ -static void miSpriteRemoveCursor(DeviceIntPtr pDev, - ScreenPtr pScreen); +static void miSpriteRemoveCursor(DeviceIntPtr pDev, + ScreenPtr pScreen); static void miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen); static void miSpriteRestoreCursor(DeviceIntPtr pDev, @@ -153,7 +153,7 @@ miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure) miSpriteScreenPtr pScreenPriv; miCursorInfoPtr pCursorInfo; DeviceIntPtr pDev; - + pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); @@ -164,9 +164,9 @@ miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure) pCursorInfo = MISPRITE(pDev); if (pCursorInfo->isUp && - pCursorInfo->pScreen == pScreen && - RECT_IN_REGION (pScreen, pRegion, &pCursorInfo->saved) - != rgnOUT) + pCursorInfo->pScreen == pScreen && + RECT_IN_REGION (pScreen, pRegion, &pCursorInfo->saved) + != rgnOUT) { SPRITE_DEBUG(("Damage remove\n")); miSpriteRemoveCursor (pDev, pScreen); @@ -188,14 +188,14 @@ miSpriteInitialize (ScreenPtr pScreen, { miSpriteScreenPtr pScreenPriv; VisualPtr pVisual; - + if (!DamageSetup (pScreen)) return FALSE; pScreenPriv = (miSpriteScreenPtr) xalloc (sizeof (miSpriteScreenRec)); if (!pScreenPriv) return FALSE; - + pScreenPriv->pDamage = DamageCreate (miSpriteReportDamage, (DamageDestroyFunc) 0, DamageReportRawRegion, @@ -219,10 +219,10 @@ miSpriteInitialize (ScreenPtr pScreen, pScreenPriv->SourceValidate = pScreen->SourceValidate; pScreenPriv->CopyWindow = pScreen->CopyWindow; - + pScreenPriv->InstallColormap = pScreen->InstallColormap; pScreenPriv->StoreColors = pScreen->StoreColors; - + pScreenPriv->BlockHandler = pScreen->BlockHandler; pScreenPriv->DeviceCursorInitialize = pScreen->DeviceCursorInitialize; @@ -238,7 +238,7 @@ miSpriteInitialize (ScreenPtr pScreen, pScreenPriv->colors[MASK_COLOR].green = 0; pScreenPriv->colors[MASK_COLOR].blue = 0; dixSetPrivate(&pScreen->devPrivates, miSpriteScreenKey, pScreenPriv); - + pScreen->CloseScreen = miSpriteCloseScreen; pScreen->GetImage = miSpriteGetImage; pScreen->GetSpans = miSpriteGetSpans; @@ -268,6 +268,7 @@ static Bool miSpriteCloseScreen (int i, ScreenPtr pScreen) { miSpriteScreenPtr pScreenPriv; + DeviceIntPtr pDev; pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); @@ -295,7 +296,7 @@ miSpriteGetImage (DrawablePtr pDrawable, int sx, int sy, int w, int h, miSpriteScreenPtr pScreenPriv; DeviceIntPtr pDev = inputInfo.pointer; miCursorInfoPtr pCursorInfo; - + SCREEN_PROLOGUE (pScreen, GetImage); pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, @@ -308,8 +309,8 @@ miSpriteGetImage (DrawablePtr pDrawable, int sx, int sy, int w, int h, if (pDrawable->type == DRAWABLE_WINDOW && pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && - ORG_OVERLAP(&pCursorInfo->saved,pDrawable->x,pDrawable->y, - sx, sy, w, h)) + ORG_OVERLAP(&pCursorInfo->saved,pDrawable->x,pDrawable->y, + sx, sy, w, h)) { SPRITE_DEBUG (("GetImage remove\n")); miSpriteRemoveCursor (pDev, pScreen); @@ -331,7 +332,7 @@ miSpriteGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, miSpriteScreenPtr pScreenPriv; DeviceIntPtr pDev = inputInfo.pointer; miCursorInfoPtr pCursorInfo; - + SCREEN_PROLOGUE (pScreen, GetSpans); pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, @@ -343,8 +344,8 @@ miSpriteGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, { pCursorInfo = MISPRITE(pDev); - if (pDrawable->type == DRAWABLE_WINDOW && - pCursorInfo->isUp && + if (pDrawable->type == DRAWABLE_WINDOW && + pCursorInfo->isUp && pCursorInfo->pScreen == pScreen) { DDXPointPtr pts; @@ -385,7 +386,7 @@ miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width, miSpriteScreenPtr pScreenPriv; DeviceIntPtr pDev = inputInfo.pointer; miCursorInfoPtr pCursorInfo; - + SCREEN_PROLOGUE (pScreen, SourceValidate); pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, @@ -397,7 +398,7 @@ miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width, { pCursorInfo = MISPRITE(pDev); if (pDrawable->type == DRAWABLE_WINDOW && pCursorInfo->isUp && - pCursorInfo->pScreen == pScreen && + pCursorInfo->pScreen == pScreen && ORG_OVERLAP(&pCursorInfo->saved, pDrawable->x, pDrawable->y, x, y, width, height)) { @@ -420,7 +421,7 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) miSpriteScreenPtr pScreenPriv; DeviceIntPtr pDev = inputInfo.pointer; miCursorInfoPtr pCursorInfo; - + SCREEN_PROLOGUE (pScreen, CopyWindow); pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, @@ -503,7 +504,7 @@ miSpriteInstallColormap (ColormapPtr pMap) pPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); SCREEN_PROLOGUE(pScreen, InstallColormap); - + (*pScreen->InstallColormap) (pMap); SCREEN_EPILOGUE(pScreen, InstallColormap); @@ -542,7 +543,7 @@ miSpriteStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef) pPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); SCREEN_PROLOGUE(pScreen, StoreColors); - + (*pScreen->StoreColors) (pMap, ndef, pdef); SCREEN_EPILOGUE(pScreen, StoreColors); @@ -581,14 +582,14 @@ miSpriteStoreColors (ColormapPtr pMap, int ndef, xColorItem *pdef) for (i = 0; i < ndef; i++) { if (pdef[i].pixel == - pPriv->colors[SOURCE_COLOR].pixel) + pPriv->colors[SOURCE_COLOR].pixel) { pPriv->colors[SOURCE_COLOR] = pdef[i]; if (++updated == 2) break; } if (pdef[i].pixel == - pPriv->colors[MASK_COLOR].pixel) + pPriv->colors[MASK_COLOR].pixel) { pPriv->colors[MASK_COLOR] = pdef[i]; if (++updated == 2) @@ -695,7 +696,7 @@ miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen, pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); miCursorInfoPtr pPointer; - + if (!pDev->isMaster && !pDev->u.master) { ErrorF("[mi] miSpriteSetCursor called for floating device.\n"); @@ -754,7 +755,7 @@ miSpriteSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen, sx + (int)pCursor->bits->width < pointer->saved.x2 && sy >= pointer->saved.y1 && sy + (int)pCursor->bits->height < - pointer->saved.y2)) + pointer->saved.y2)) { int oldx1, oldy1, dx, dy; @@ -967,7 +968,7 @@ miSpriteRestoreCursor (DeviceIntPtr pDev, ScreenPtr pScreen) int x, y; CursorPtr pCursor; miCursorInfoPtr pCursorInfo; - + if (!pDev->isMaster && !pDev->u.master) { ErrorF("[mi] miSpriteRestoreCursor called for floating device.\n"); @@ -988,7 +989,7 @@ miSpriteRestoreCursor (DeviceIntPtr pDev, ScreenPtr pScreen) SPRITE_DEBUG(("RestoreCursor %d\n", pDev->id)); if (pCursorInfo->checkPixels) miSpriteFindColors (pCursorInfo, pScreen); - if ((*pScreenPriv->funcs->PutUpCursor) (pDev, pScreen, + if ((*pScreenPriv->funcs->PutUpCursor) (pDev, pScreen, pCursor, x, y, pScreenPriv->colors[SOURCE_COLOR].pixel, pScreenPriv->colors[MASK_COLOR].pixel)) From 2b9c829bdebd16910bdf48b9d64862e3d34f5b7f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 18 Jun 2008 09:55:53 +0930 Subject: [PATCH 07/83] Xi: don't drop the grab status in XExtendedGrabDevice(). --- Xi/extgrbdev.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Xi/extgrbdev.c b/Xi/extgrbdev.c index 1a2584fb6..c982fca2c 100644 --- a/Xi/extgrbdev.c +++ b/Xi/extgrbdev.c @@ -184,16 +184,11 @@ ProcXExtendedGrabDevice(ClientPtr client) gemasks->eventMask[xgeMask->extension & 0x7F]= xgeMask->evmask; } - ExtGrabDevice(client, dev, stuff->device_mode, - grab_window, confineTo, time, stuff->owner_events, - cursor, tmp[stuff->deviceid].mask, - gemasks); - - if (rc != Success) { - errval = 0; - goto cleanup; - } - + rep.status = ExtGrabDevice(client, dev, stuff->device_mode, + grab_window, confineTo, time, + stuff->owner_events, cursor, + tmp[stuff->deviceid].mask, + gemasks); cleanup: if (gemasks) From d21155a3e9b51df946766926bc6155c8972c4439 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Sun, 15 Jun 2008 20:00:41 +0930 Subject: [PATCH 08/83] input: fix up usage of button->down, used to be a bitmask, is now an array. device->button->down used to be a 32-byte bitmask with one bit for each button. This has changed into a 256-byte array, with one byte assigned for each button. Some of the callers were still using this array as a bitmask however, this is fixed with this patch. Thanks to Keith Packard for pointing this out. See also: http://lists.freedesktop.org/archives/xorg/2008-June/036202.html --- Xi/exevents.c | 10 +++++++--- Xi/queryst.c | 6 +++--- dix/devices.c | 2 +- dix/events.c | 4 ---- include/inputstr.h | 3 +++ xkb/xkbActions.c | 4 ++-- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 6f88b57f3..4736a1284 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1153,9 +1153,11 @@ FixDeviceStateNotify(DeviceIntPtr dev, deviceStateNotify * ev, KeyClassPtr k, ev->num_valuators = 0; if (b) { + int i; ev->classes_reported |= (1 << ButtonClass); ev->num_buttons = b->numButtons; - memmove((char *)&ev->buttons[0], (char *)b->down, 4); + for (i = 0; i < 32; i++) + SetBitIf(ev->buttons, b->down, i); } else if (k) { ev->classes_reported |= (1 << KeyClass); ev->num_keys = k->curKeySyms.maxKeyCode - k->curKeySyms.minKeyCode; @@ -1270,11 +1272,13 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, first += 3; nval -= 3; if (nbuttons > 32) { + int i; (ev - 1)->deviceid |= MORE_EVENTS; bev = (deviceButtonStateNotify *) ev++; bev->type = DeviceButtonStateNotify; bev->deviceid = dev->id; - memmove((char *)&bev->buttons[0], (char *)&b->down[4], 28); + for (i = 32; i < MAP_LENGTH; i++) + SetBitIf(bev->buttons, b->down, i); } if (nval > 0) { (ev - 1)->deviceid |= MORE_EVENTS; @@ -1692,7 +1696,7 @@ SetButtonMapping(ClientPtr client, DeviceIntPtr dev, int nElts, BYTE * map) if (BadDeviceMap(&map[0], nElts, 1, 255, &client->errorValue)) return BadValue; for (i = 0; i < nElts; i++) - if ((b->map[i + 1] != map[i]) && BitIsOn(b->down, i + 1)) + if ((b->map[i + 1] != map[i]) && (b->down[i + 1])) return MappingBusy; for (i = 0; i < nElts; i++) b->map[i + 1] = map[i]; diff --git a/Xi/queryst.c b/Xi/queryst.c index 71ab79be8..268bdd78b 100644 --- a/Xi/queryst.c +++ b/Xi/queryst.c @@ -119,7 +119,7 @@ ProcXQueryDeviceState(ClientPtr client) total_length += (sizeof(xValuatorState) + (v->numAxes * sizeof(int))); num_classes++; } - buf = (char *)xalloc(total_length); + buf = (char *)xcalloc(total_length, 1); if (!buf) return BadAlloc; savbuf = buf; @@ -139,8 +139,8 @@ ProcXQueryDeviceState(ClientPtr client) tb->class = ButtonClass; tb->length = sizeof(xButtonState); tb->num_buttons = b->numButtons; - for (i = 0; i < 32; i++) - tb->buttons[i] = b->down[i]; + for (i = 0; i < MAP_LENGTH; i++) + SetBitIf(tb->buttons, b->down, i); buf += sizeof(xButtonState); } diff --git a/dix/devices.c b/dix/devices.c index b88d856e6..3581cde8f 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -1734,7 +1734,7 @@ DoSetPointerMapping(ClientPtr client, DeviceIntPtr device, BYTE *map, int n) if ((dev->coreEvents || dev == inputInfo.pointer) && dev->button) { for (i = 0; i < n; i++) { if ((device->button->map[i + 1] != map[i]) && - BitIsOn(device->button->down, i + 1)) { + device->button->down[i + 1]) { return MappingBusy; } } diff --git a/dix/events.c b/dix/events.c index 81919737a..a35e9e404 100644 --- a/dix/events.c +++ b/dix/events.c @@ -4077,15 +4077,11 @@ ProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count) if (xE->u.u.type != MotionNotify) { int key; - BYTE *kptr; - int bit; XE_KBPTR.rootX = pSprite->hot.x; XE_KBPTR.rootY = pSprite->hot.y; key = xE->u.u.detail; - kptr = &butc->down[key >> 3]; - bit = 1 << (key & 7); switch (xE->u.u.type) { case ButtonPress: diff --git a/include/inputstr.h b/include/inputstr.h index 7209b2cb3..11fe031a0 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -57,6 +57,9 @@ SOFTWARE. #include "privates.h" #define BitIsOn(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))) +/* If byte[i] in src is non-zero, set bit i in dst, otherwise set bit to 0 */ +#define SetBitIf(dst, src, i) \ + (src[i]) ? (dst[i/8] |= (1 << (i % 8))) : (dst[i/8] &= ~(1 << (i % 8))); #define SameClient(obj,client) \ (CLIENT_BITS((obj)->resource) == (client)->clientAsMask) diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c index 41b4e4c8e..8a2682562 100644 --- a/xkb/xkbActions.c +++ b/xkb/xkbActions.c @@ -1045,7 +1045,7 @@ int button; switch (pAction->type) { case XkbSA_LockDeviceBtn: if ((pAction->devbtn.flags&XkbSA_LockNoLock)|| - (dev->button->down[button/8]&(1L<<(button%8)))) + (dev->button->down[button])) return 0; XkbDDXFakeDeviceButton(dev,True,button); filter->upAction.type= XkbSA_NoAction; @@ -1077,7 +1077,7 @@ int button; switch (filter->upAction.type) { case XkbSA_LockDeviceBtn: if ((filter->upAction.devbtn.flags&XkbSA_LockNoUnlock)|| - ((dev->button->down[button/8]&(1L<<(button%8)))==0)) + ((dev->button->down[button])==0)) return 0; XkbDDXFakeDeviceButton(dev,False,button); break; From 068fa63496c7c363706f0d356b5132bc591c04c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 18 Jun 2008 09:23:09 +0930 Subject: [PATCH 09/83] dix: fix a crash when the client has a different byteorder. Signed-off-by: Peter Hutterer --- dix/events.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dix/events.c b/dix/events.c index a35e9e404..4e11bda7d 100644 --- a/dix/events.c +++ b/dix/events.c @@ -6168,6 +6168,10 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) if (events->u.u.type == GenericEvent) { eventlength += ((xGenericEvent*)events)->length * 4; + } + + if(pClient->swapped) + { if (eventlength > swapEventLen) { swapEventLen = eventlength; @@ -6178,10 +6182,7 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) return; } } - } - if(pClient->swapped) - { for(i = 0; i < count; i++) { eventFrom = &events[i]; @@ -6192,7 +6193,7 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) (*EventSwapVector[eventFrom->u.u.type & 0177]) (eventFrom, eventTo); - (void)WriteToClient(pClient, eventlength, (char *)&eventTo); + (void)WriteToClient(pClient, eventlength, (char *)eventTo); } } else From 528b4e36ade482df99747081688ae52cfaeb28eb Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Wed, 18 Jun 2008 22:34:02 +0100 Subject: [PATCH 10/83] Set driverPriv immediately on CreatePixmap. If it's NULL anyway, we bail, if not, it lets ModifyPixmapHeader know about the private. --- exa/exa.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/exa/exa.c b/exa/exa.c index fc047483d..48352bd5b 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -314,7 +314,6 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, if (driver_alloc) { size_t paddedWidth, datasize; - void *driver_priv; paddedWidth = ((w * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits); if (paddedWidth / 4 > 32767 || h > 32767) @@ -327,22 +326,21 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, datasize = h * paddedWidth; - driver_priv = pExaScr->info->CreatePixmap(pScreen, datasize, 0); - if (!driver_priv) { + pExaPixmap->driverPriv = pExaScr->info->CreatePixmap(pScreen, datasize, 0); + if (!pExaPixmap->driverPriv) { fbDestroyPixmap(pPixmap); return NULL; } (*pScreen->ModifyPixmapHeader)(pPixmap, w, h, 0, 0, paddedWidth, NULL); - pExaPixmap->driverPriv = driver_priv; pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED; pExaPixmap->fb_ptr = NULL; } else { - pExaPixmap->driverPriv = NULL; - /* Scratch pixmaps may have w/h equal to zero, and may not be - * migrated. - */ + pExaPixmap->driverPriv = NULL; + /* Scratch pixmaps may have w/h equal to zero, and may not be + * migrated. + */ if (!w || !h) pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED; else From 3cc5ae6a4f725483612c00fc8bcc2c61607f66a8 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 18 Jun 2008 16:14:42 +0930 Subject: [PATCH 11/83] dix: don't attempt to send Enter/Leave events if we have a keyboard. Dereferencing into dev->valuator could crash the server, although it looks like I could only reproduce this by having a keyboard send an event after it was created and the WM was still replaying. Or so. --- dix/events.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dix/events.c b/dix/events.c index 4e11bda7d..7bd682526 100644 --- a/dix/events.c +++ b/dix/events.c @@ -4583,6 +4583,9 @@ DoEnterLeaveEvents(DeviceIntPtr pDev, WindowPtr toWin, int mode) { + if (!IsPointerDevice(pDev)) + return; + if (fromWin == toWin) return; if (IsParent(fromWin, toWin)) From cfcb3da75e807dec225cc7ea469e04d2db10bf73 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 18 Jun 2008 11:37:00 -0700 Subject: [PATCH 12/83] Make button down state a bitmask. Master buttons track union of slave buttons Mixing usage where some parts of the code treated this field as a bitmask and other parts as an array of card8 was wrong, and as the wire protocol wanted bitmasks, it was less invasive to switch the newer counting code use booleans. Master devices track slave buttons by waiting for all slave buttons to be released before delivering the release event to the client. This also removes the state merging code in DeepCopyDeviceClasses -- that code was changing master device state without delivering any events, violating protocol invariants. The result will be that existing slave button state which does not match the master will not be visible through the master device. Fixing this would require that we synthesize events in this function, which seems like a bad idea. Note that keyboards have the same issue. Signed-off-by: Daniel Stone Signed-off-by: Peter Hutterer --- Xi/exevents.c | 41 +++++++++++++++++++++-------------------- dix/devices.c | 2 +- include/inputstr.h | 2 +- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 4736a1284..d59a87d1a 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -587,8 +587,6 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to) if (from->button) { - int i; - DeviceIntPtr sd; if (!to->button) { classes = dixLookupPrivate(&to->devPrivates, @@ -603,20 +601,6 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to) classes->button = NULL; } - to->button->buttonsDown = 0; - memset(to->button->down, 0, MAP_LENGTH); - /* merge button states from all attached devices */ - for (sd = inputInfo.devices; sd; sd = sd->next) - { - if (sd->isMaster || sd->u.master != to) - continue; - - for (i = 0; i < MAP_LENGTH; i++) - { - to->button->down[i] += sd->button->down[i]; - to->button->buttonsDown++; - } - } #ifdef XKB if (from->button->xkb_acts) { @@ -923,8 +907,10 @@ UpdateDeviceState(DeviceIntPtr device, xEvent* xE, int count) if (!b) return DONT_PROCESS; - if (b->down[key]++ > 0) + kptr = &b->down[key >> 3]; + if ((*kptr & bit) != 0) return DONT_PROCESS; + *kptr |= bit; if (device->valuator) device->valuator->motionHintWindow = NullWindow; b->buttonsDown++; @@ -938,10 +924,25 @@ UpdateDeviceState(DeviceIntPtr device, xEvent* xE, int count) if (!b) return DONT_PROCESS; - if (b->down[key] == 0) - return DONT_PROCESS; - if (--b->down[key] > 0) + kptr = &b->down[key>>3]; + if (!(*kptr & bit)) return DONT_PROCESS; + if (device->isMaster) { + DeviceIntPtr sd; + + /* + * Leave the button down if any slave has the + * button still down. Note that this depends on the + * event being delivered through the slave first + */ + for (sd = inputInfo.devices; sd; sd = sd->next) { + if (sd->isMaster || sd->u.master != device) + continue; + if ((sd->button->down[key>>3] & bit) != 0) + return DONT_PROCESS; + } + } + *kptr &= ~bit; if (device->valuator) device->valuator->motionHintWindow = NullWindow; if (b->buttonsDown >= 1 && !--b->buttonsDown) diff --git a/dix/devices.c b/dix/devices.c index 3581cde8f..91a43f342 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -1153,7 +1153,7 @@ InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons, butc->buttonsDown = 0; butc->state = 0; butc->motionMask = 0; - bzero((char *)butc->down, MAP_LENGTH); + bzero((char *)butc->down, sizeof(butc->down)); #ifdef XKB butc->xkb_acts= NULL; #endif diff --git a/include/inputstr.h b/include/inputstr.h index 11fe031a0..4c7ec2eb9 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -186,7 +186,7 @@ typedef struct _ButtonClassRec { CARD8 buttonsDown; /* number of buttons currently down */ unsigned short state; Mask motionMask; - CARD8 down[MAP_LENGTH]; + CARD8 down[DOWN_LENGTH]; CARD8 map[MAP_LENGTH]; #ifdef XKB union _XkbAction *xkb_acts; From 219dd2d44a9da40427ad48b0f09b981fe0551f4b Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Sun, 18 May 2008 13:53:32 +0200 Subject: [PATCH 13/83] sprintf() -> snprintf() --- os/access.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/os/access.c b/os/access.c index db14380df..6b55afd84 100644 --- a/os/access.c +++ b/os/access.c @@ -1190,7 +1190,8 @@ ResetHosts (char *display) strlen(display) + 1; if (fnamelen > sizeof(fname)) FatalError("Display name `%s' is too long\n", display); - sprintf(fname, ETC_HOST_PREFIX "%s" ETC_HOST_SUFFIX, display); + snprintf(fname, sizeof(fname), ETC_HOST_PREFIX "%s" ETC_HOST_SUFFIX, + display); if ((fd = fopen (fname, "r")) != 0) { From c0d7ad9c88172d753b932069743ae65f75de3aa9 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Thu, 19 Jun 2008 16:51:18 +0200 Subject: [PATCH 14/83] Let code build with gcc 2.95 --- hw/xfree86/common/xf86Config.c | 5 +++-- hw/xfree86/modes/xf86Rotate.c | 16 ++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index eb084a5ee..e52974dd1 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -599,8 +599,9 @@ configFiles(XF86ConfFilesPtr fileconf) pathFrom = X_CONFIG; if (*f) { if (xf86Info.useDefaultFontPath) { + char *g; xf86Msg(X_DEFAULT, "Including the default font path %s.\n", defaultFontPath); - char *g = xnfalloc(strlen(defaultFontPath) + strlen(f) + 3); + g = xnfalloc(strlen(defaultFontPath) + strlen(f) + 3); strcpy(g, f); strcat(g, ","); defaultFontPath = strcat(g, defaultFontPath); @@ -1233,8 +1234,8 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) * remove the core attribute from the later ones. */ for (devs = servlayoutp->inputs; devs && *devs; devs++) { - indp = *devs; pointer opt1 = NULL, opt2 = NULL; + indp = *devs; if (indp->commonOptions && xf86CheckBoolOption(indp->commonOptions, "CorePointer", FALSE)) { opt1 = indp->commonOptions; diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index 8f34032e0..6c93066c7 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -597,6 +597,10 @@ xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation) } else { + int width, height, old_width, old_height; + void *shadowData; + PixmapPtr shadow; + PictureTransformTranslate (&crtc_to_fb, &fb_to_crtc, F(crtc->x), F(crtc->y)); PictureTransformIsInverse ("offset", &crtc_to_fb, &fb_to_crtc); @@ -605,12 +609,12 @@ xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation) * matches the mode, not the pre-rotated copy in the * frame buffer */ - int width = mode->HDisplay; - int height = mode->VDisplay; - void *shadowData = crtc->rotatedData; - PixmapPtr shadow = crtc->rotatedPixmap; - int old_width = shadow ? shadow->drawable.width : 0; - int old_height = shadow ? shadow->drawable.height : 0; + width = mode->HDisplay; + height = mode->VDisplay; + shadowData = crtc->rotatedData; + shadow = crtc->rotatedPixmap; + old_width = shadow ? shadow->drawable.width : 0; + old_height = shadow ? shadow->drawable.height : 0; /* Allocate memory for rotation */ if (old_width != width || old_height != height) From 0a81d476388c51f8aa723400dffc375e112ea97a Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Mon, 19 May 2008 02:20:44 +0200 Subject: [PATCH 15/83] Remove RCS Id. --- hw/xfree86/utils/kbd_mode/Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/xfree86/utils/kbd_mode/Makefile.am b/hw/xfree86/utils/kbd_mode/Makefile.am index 1b28411cf..087caa240 100644 --- a/hw/xfree86/utils/kbd_mode/Makefile.am +++ b/hw/xfree86/utils/kbd_mode/Makefile.am @@ -1,4 +1,3 @@ -# $Id$ # # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # From 19c7e9da55646f1f6e05c28cd71865cd8d84e1ff Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Mon, 19 May 2008 02:24:17 +0200 Subject: [PATCH 16/83] preserve errno around the SIGIO handler --- hw/xfree86/os-support/shared/sigio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c index c97f50302..f51131c6b 100644 --- a/hw/xfree86/os-support/shared/sigio.c +++ b/hw/xfree86/os-support/shared/sigio.c @@ -101,6 +101,7 @@ xf86SIGIO (int sig) int i; fd_set ready; struct timeval to; + int save_errno = errno; /* do not clobber the global errno */ int r; ready = xf86SigIOMask; @@ -117,6 +118,8 @@ xf86SIGIO (int sig) if (r > 0) { xf86Msg(X_ERROR, "SIGIO %d descriptors not handled\n", r); } + /* restore global errno */ + errno = save_errno; } static int From ce4d4b3c1b0e25f64d6f781b09528b2f3ae33207 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Mon, 19 May 2008 05:19:01 +0200 Subject: [PATCH 17/83] build fix --- hw/xfree86/os-support/bsd/bsd_axp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/os-support/bsd/bsd_axp.c b/hw/xfree86/os-support/bsd/bsd_axp.c index 51ffef148..cb10a9d40 100644 --- a/hw/xfree86/os-support/bsd/bsd_axp.c +++ b/hw/xfree86/os-support/bsd/bsd_axp.c @@ -7,7 +7,7 @@ #include "os.h" #include "xf86.h" #include "xf86Priv.h" -#include "xf86Axp.h" +#include "shared/xf86Axp.h" #include #include "xf86_OSlib.h" #include From 41a65e110409a290288180e8e1517f053f877586 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Mon, 19 May 2008 06:12:04 +0200 Subject: [PATCH 18/83] Fix ipc check on OpenBSD --- configure.ac | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.ac b/configure.ac index fec18caee..f6997e59a 100644 --- a/configure.ac +++ b/configure.ac @@ -262,6 +262,8 @@ AM_CONDITIONAL(FREEBSD_KLDLOAD, [test "x$ac_cv_sys_linker_h" = xyes]) AC_CACHE_CHECK([for SYSV IPC], ac_cv_sysv_ipc, [AC_TRY_LINK([ +#include +#include #include ],[ { From 155fcecb320dbcfb899d6bcd78048ce0993bf28b Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Mon, 19 May 2008 08:09:33 +0200 Subject: [PATCH 19/83] Various messages clean-ups. --- hw/xfree86/os-support/bsd/bsd_init.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/hw/xfree86/os-support/bsd/bsd_init.c b/hw/xfree86/os-support/bsd/bsd_init.c index 83583d5b9..cbb9e4810 100644 --- a/hw/xfree86/os-support/bsd/bsd_init.c +++ b/hw/xfree86/os-support/bsd/bsd_init.c @@ -310,8 +310,7 @@ acquire_vt: #endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ #ifdef WSCONS_SUPPORT case WSCONS: - fprintf(stderr, "xf86OpenConsole\n"); - /* xf86Info.consoleFd = open("/dev/wskbd0", 0); */ + /* Nothing to do */ break; #endif } @@ -575,8 +574,14 @@ xf86OpenPcvt() sprintf(vtname, "%s%01x", vtprefix, xf86Info.vtno - 1); if ((fd = open(vtname, PCVT_CONSOLE_MODE, 0)) < 0) { - FatalError("xf86OpenPcvt: Cannot open %s (%s)", + ErrorF("xf86OpenPcvt: Cannot open %s (%s)", vtname, strerror(errno)); + xf86Info.vtno = initialVT; + sprintf(vtname, "%s%01x", vtprefix, xf86Info.vtno - 1); + if ((fd = open(vtname, PCVT_CONSOLE_MODE, 0)) < 0) { + FatalError("xf86OpenPcvt: Cannot open %s (%s)", + vtname, strerror(errno)); + } } if (ioctl(fd, VT_GETMODE, &vtmode) < 0) { @@ -585,8 +590,8 @@ xf86OpenPcvt() xf86Info.consType = PCVT; #ifdef WSCONS_SUPPORT xf86Msg(X_PROBED, - "Using wscons driver in pcvt compatibility mode " - "(version %d.%d)\n", + "Using wscons driver on %s in pcvt compatibility mode " + "(version %d.%d)\n", vtname, pcvt_version.rmajor, pcvt_version.rminor); #else xf86Msg(X_PROBED, "Using pcvt driver (version %d.%d)\n", @@ -620,7 +625,7 @@ xf86OpenWScons() #if defined(__NetBSD__) sprintf(ttyname, "/dev/ttyE%d", i); #elif defined(__OpenBSD__) - sprintf(ttyname, "/dev/ttyC%d", i); + sprintf(ttyname, "/dev/ttyC%x", i); #endif if ((fd = open(ttyname, 2)) != -1) break; @@ -662,7 +667,7 @@ xf86CloseConsole() VT.mode = VT_AUTO; ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* dflt vt handling */ } -#if !defined(USE_DEV_IO) && !defined(USE_I386_IOPL) +#if !defined(OpenBSD) && !defined(USE_DEV_IO) && !defined(USE_I386_IOPL) if (ioctl(xf86Info.consoleFd, KDDISABIO, 0) < 0) { xf86FatalError("xf86CloseConsole: KDDISABIO failed (%s)", From b55fbca4f0705aeff1c69d3ef851c5ff5af6ed94 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 20 Jun 2008 13:27:32 -0400 Subject: [PATCH 20/83] Bug #12414: Create full-fledged pixmaps in fb24_32ReformatTile(). ... instead of creating pixmaps that only fb knows about, which will have no devPrivates for any other subsystem and thus cause havoc if (when) they leak out. --- fb/fb24_32.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fb/fb24_32.c b/fb/fb24_32.c index a03726b8d..1ebd598a8 100644 --- a/fb/fb24_32.c +++ b/fb/fb24_32.c @@ -1,5 +1,4 @@ /* - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its @@ -544,11 +543,10 @@ fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel) int oldXoff, oldYoff; int newXoff, newYoff; - pNewTile = fbCreatePixmapBpp (pScreen, - pOldTile->drawable.width, - pOldTile->drawable.height, - pOldTile->drawable.depth, - bitsPerPixel, 0); + pNewTile = pScreen->CreatePixmap(pScreen, pOldTile->drawable.width, + pOldTile->drawable.height, + pOldTile->drawable.depth, + pOldTile->usage_hint); if (!pNewTile) return 0; fbGetDrawable (&pOldTile->drawable, From c8d066a15142678041c1d82ccf530dcdb2ea74ca Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 23 Jun 2008 13:59:48 -0400 Subject: [PATCH 21/83] Implement bswap in x86emu. Yes, this is a 486+ instruction and thus not strictly legal in vm86 mode, but enough BIOSes use it (looking at you VIA) that we might as well implement it. --- hw/xfree86/x86emu/ops2.c | 63 +++++++++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 8 deletions(-) diff --git a/hw/xfree86/x86emu/ops2.c b/hw/xfree86/x86emu/ops2.c index 324de8ad8..a1eda76d7 100644 --- a/hw/xfree86/x86emu/ops2.c +++ b/hw/xfree86/x86emu/ops2.c @@ -40,6 +40,12 @@ #include "x86emu/x86emui.h" +#undef bswap_32 +#define bswap_32(x) (((x & 0xff000000) >> 24) | \ + ((x & 0x00ff0000) >> 8) | \ + ((x & 0x0000ff00) << 8) | \ + ((x & 0x000000ff) << 24)) + /*----------------------------- Implementation ----------------------------*/ /**************************************************************************** @@ -2571,6 +2577,47 @@ static void x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2)) END_OF_INSTR(); } +/* Handles opcodes 0xc8-0xcf */ +static void x86emuOp2_bswap(u8 X86EMU_UNUSED(op2)) +{ + START_OF_INSTR(); + DECODE_PRINTF("BSWAP\n"); + TRACE_AND_STEP(); + + switch (op2) { + case 0xc8: + M.x86.R_EAX = bswap_32(M.x86.R_EAX); + break; + case 0xc9: + M.x86.R_ECX = bswap_32(M.x86.R_ECX); + break; + case 0xca: + M.x86.R_EDX = bswap_32(M.x86.R_EDX); + break; + case 0xcb: + M.x86.R_EBX = bswap_32(M.x86.R_EBX); + break; + case 0xcc: + M.x86.R_ESP = bswap_32(M.x86.R_ESP); + break; + case 0xcd: + M.x86.R_EBP = bswap_32(M.x86.R_EBP); + break; + case 0xce: + M.x86.R_ESI = bswap_32(M.x86.R_ESI); + break; + case 0xcf: + M.x86.R_EDI = bswap_32(M.x86.R_EDI); + break; + default: + /* can't happen */ + break; + } + + DECODE_CLEAR_SEGOVR(); + END_OF_INSTR(); +} + /*************************************************************************** * Double byte operation code table: **************************************************************************/ @@ -2788,14 +2835,14 @@ void (*x86emu_optab2[256])(u8) = /* 0xc5 */ x86emuOp2_illegal_op, /* 0xc6 */ x86emuOp2_illegal_op, /* 0xc7 */ x86emuOp2_illegal_op, -/* 0xc8 */ x86emuOp2_illegal_op, /* TODO: bswap */ -/* 0xc9 */ x86emuOp2_illegal_op, /* TODO: bswap */ -/* 0xca */ x86emuOp2_illegal_op, /* TODO: bswap */ -/* 0xcb */ x86emuOp2_illegal_op, /* TODO: bswap */ -/* 0xcc */ x86emuOp2_illegal_op, /* TODO: bswap */ -/* 0xcd */ x86emuOp2_illegal_op, /* TODO: bswap */ -/* 0xce */ x86emuOp2_illegal_op, /* TODO: bswap */ -/* 0xcf */ x86emuOp2_illegal_op, /* TODO: bswap */ +/* 0xc8 */ x86emuOp2_bswap, +/* 0xc9 */ x86emuOp2_bswap, +/* 0xca */ x86emuOp2_bswap, +/* 0xcb */ x86emuOp2_bswap, +/* 0xcc */ x86emuOp2_bswap, +/* 0xcd */ x86emuOp2_bswap, +/* 0xce */ x86emuOp2_bswap, +/* 0xcf */ x86emuOp2_bswap, /* 0xd0 */ x86emuOp2_illegal_op, /* 0xd1 */ x86emuOp2_illegal_op, From 3b587826924c60f6736dc5faf584b964fde1b4da Mon Sep 17 00:00:00 2001 From: Jesse Ruffin Date: Mon, 23 Jun 2008 14:35:20 -0400 Subject: [PATCH 22/83] Bug #16302: Fix GLX drawable refcounting in DMX. --- hw/dmx/glxProxy/glxcmds.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c index ab7ee96b9..2365f829f 100644 --- a/hw/dmx/glxProxy/glxcmds.c +++ b/hw/dmx/glxProxy/glxcmds.c @@ -1004,8 +1004,7 @@ static int MakeCurrent(__GLXclientState *cl, prevglxc->pGlxPixmap = 0; } - if (prevglxc->pGlxReadPixmap && - prevglxc->pGlxReadPixmap != prevglxc->pGlxPixmap ) { + if (prevglxc->pGlxReadPixmap) { /* ** The previous drawable was a glx pixmap, release it. */ @@ -1023,8 +1022,7 @@ static int MakeCurrent(__GLXclientState *cl, prevglxc->pGlxWindow = 0; } - if (prevglxc->pGlxReadWindow && - prevglxc->pGlxReadWindow != prevglxc->pGlxWindow) { + if (prevglxc->pGlxReadWindow) { /* ** The previous drawable was a glx window, release it. */ @@ -1042,8 +1040,7 @@ static int MakeCurrent(__GLXclientState *cl, prevglxc->pGlxPbuffer = 0; } - if (prevglxc->pGlxReadPbuffer && - prevglxc->pGlxReadPbuffer != prevglxc->pGlxPbuffer ) { + if (prevglxc->pGlxReadPbuffer) { /* ** The previous drawable was a glx Pbuffer, release it. */ @@ -1071,7 +1068,7 @@ static int MakeCurrent(__GLXclientState *cl, pGlxPixmap->refcnt++; } - if (pReadGlxPixmap && pReadGlxPixmap != pGlxPixmap) { + if (pReadGlxPixmap) { pReadGlxPixmap->refcnt++; } @@ -1079,7 +1076,7 @@ static int MakeCurrent(__GLXclientState *cl, pGlxWindow->refcnt++; } - if (pGlxReadWindow && pGlxReadWindow != pGlxWindow) { + if (pGlxReadWindow) { pGlxReadWindow->refcnt++; } @@ -1087,7 +1084,7 @@ static int MakeCurrent(__GLXclientState *cl, pGlxPbuffer->refcnt++; } - if (pGlxReadPbuffer && pGlxReadPbuffer != pGlxPbuffer) { + if (pGlxReadPbuffer) { pGlxReadPbuffer->refcnt++; } From b622f6dc5d8d70d17be0374a85a9b16b43a62a01 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 23 Jun 2008 23:45:57 +0200 Subject: [PATCH 23/83] kdrive: fix building with --disable-xv (bug#16488) --- hw/kdrive/src/Makefile.am | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/kdrive/src/Makefile.am b/hw/kdrive/src/Makefile.am index 07ab8c859..29098c32e 100644 --- a/hw/kdrive/src/Makefile.am +++ b/hw/kdrive/src/Makefile.am @@ -12,6 +12,12 @@ KDRIVE_HW_SOURCES = \ vga.h endif +if XV +KDRIVE_XV_SOURCES = \ + kxv.c \ + kxv.h +endif + libkdrive_a_SOURCES = \ fourcc.h \ kaa.c \ @@ -31,8 +37,7 @@ libkdrive_a_SOURCES = \ koffscreen.c \ kshadow.c \ ktest.c \ - kxv.c \ - kxv.h \ + $(KDRIVE_XV_SOURCES) \ $(KDRIVE_HW_SOURCES) \ $(top_srcdir)/mi/miinitext.c From 59510a76436c739fd9421f01cc4210607d9e7f57 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 24 Jun 2008 10:40:36 -0400 Subject: [PATCH 24/83] Remove some default modes that really shouldn't be in the default set. --- hw/xfree86/common/extramodes | 6 ------ 1 file changed, 6 deletions(-) diff --git a/hw/xfree86/common/extramodes b/hw/xfree86/common/extramodes index 1d72861e4..450502670 100644 --- a/hw/xfree86/common/extramodes +++ b/hw/xfree86/common/extramodes @@ -7,18 +7,12 @@ # 832x624 @ 75Hz (74.55Hz) (fix if the official/Apple spec is different) hsync: 49.725kHz ModeLine "832x624" 57.284 832 864 928 1152 624 625 628 667 -Hsync -Vsync -# 1152x768 @ 54.8Hz (Titanium PowerBook) hsync: 44.2kHz -ModeLine "1152x768" 64.995 1152 1178 1314 1472 768 771 777 806 +hsync +vsync - # 1400x1050 @ 60Hz (VESA GTF) hsync: 65.5kHz ModeLine "1400x1050" 122.0 1400 1488 1640 1880 1050 1052 1064 1082 +hsync +vsync # 1400x1050 @ 75Hz (VESA GTF) hsync: 82.2kHz ModeLine "1400x1050" 155.8 1400 1464 1784 1912 1050 1052 1064 1090 +hsync +vsync -# 1600x1024 @ 60Hz (SGI 1600SW) hsync: 64.0kHz -Modeline "1600x1024" 106.910 1600 1620 1640 1670 1024 1027 1030 1067 -hsync -vsync - # 1920x1440 @ 85Hz (VESA GTF) hsync: 128.5kHz Modeline "1920x1440" 341.35 1920 2072 2288 2656 1440 1441 1444 1512 -hsync +vsync From 4c4e06af7950df509fa02099788be66cf37a4d01 Mon Sep 17 00:00:00 2001 From: Paul Bender Date: Tue, 24 Jun 2008 10:44:47 -0400 Subject: [PATCH 25/83] Bug #15665: Fix building without Composite. --- hw/xfree86/xaa/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/xfree86/xaa/Makefile.am b/hw/xfree86/xaa/Makefile.am index 58c8e885f..bd8267ad8 100644 --- a/hw/xfree86/xaa/Makefile.am +++ b/hw/xfree86/xaa/Makefile.am @@ -9,7 +9,9 @@ MSB_3_FIXED = mf3-xaaBitmap.c mf3-xaaStipple.c POLYSEG = s-xaaLine.c s-xaaDashLine.c libxaa_la_LDFLAGS = -avoid-version +if COMPOSITE libxaa_la_LIBADD = $(top_builddir)/miext/cw/libcw.la +endif module_LTLIBRARIES = libxaa.la libxaa_la_SOURCES = xaaInit.c xaaGC.c xaaInitAccel.c xaaFallback.c \ From 100afae578e59e31b65a6264c281ba7deea5ac39 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 24 Jun 2008 10:52:31 -0400 Subject: [PATCH 26/83] Bug #15586: (Correctly) refuse to redirect the root window. --- composite/compalloc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composite/compalloc.c b/composite/compalloc.c index 0372b9bfa..19c7db0b3 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -82,6 +82,9 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) return Success; } + if (!pWin->parent) + return BadMatch; + /* * Only one Manual update is allowed */ From 574c62e305e5380bb1b0f4bfec4f7cc3e3f03ada Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Tue, 24 Jun 2008 12:40:47 -0400 Subject: [PATCH 27/83] Bug #15369: Don't reduce Over to Src for transform + RepeatNone. Only do no-src-alpha optimizations for a RepeatNone source if we can easily probe that we won't sample outside the edges of the source. --- render/picture.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/render/picture.c b/render/picture.c index 2fbd09e8b..b7874bb64 100644 --- a/render/picture.c +++ b/render/picture.c @@ -1548,12 +1548,24 @@ FreePictFormat (pointer pPictFormat, * being careful to avoid these cases. */ static CARD8 -ReduceCompositeOp (CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst) +ReduceCompositeOp (CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, + INT16 xSrc, INT16 ySrc, CARD16 width, CARD16 height) { Bool no_src_alpha, no_dst_alpha; + /* Sampling off the edge of a RepeatNone picture introduces alpha + * even if the picture itself doesn't have alpha. We don't try to + * detect every case where we don't sample off the edge, just the + * simplest case where there is no transform on the source + * picture. + */ no_src_alpha = PICT_FORMAT_COLOR(pSrc->format) && PICT_FORMAT_A(pSrc->format) == 0 && + (pSrc->repeatType != RepeatNone || + (!pSrc->transform && + xSrc >= 0 && ySrc >= 0 && + xSrc + width <= pSrc->pDrawable->width && + ySrc + height <= pSrc->pDrawable->height)) && pSrc->alphaMap == NULL && pMask == NULL; no_dst_alpha = PICT_FORMAT_COLOR(pDst->format) && @@ -1655,7 +1667,7 @@ CompositePicture (CARD8 op, ValidatePicture (pMask); ValidatePicture (pDst); - op = ReduceCompositeOp (op, pSrc, pMask, pDst); + op = ReduceCompositeOp (op, pSrc, pMask, pDst, xSrc, ySrc, width, height); if (op == PictOpDst) return; From d34430414ac0e77eec61ab0ac9ef427b236eb639 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 24 Jun 2008 13:32:55 -0400 Subject: [PATCH 28/83] Remove xorgconfig. Use X -configure instead. --- hw/xfree86/utils/Makefile.am | 3 +- hw/xfree86/utils/xorgconfig/.gitignore | 1 - hw/xfree86/utils/xorgconfig/Cards | 3135 ----------------- hw/xfree86/utils/xorgconfig/Cards98 | 647 ---- hw/xfree86/utils/xorgconfig/Makefile.am | 70 - hw/xfree86/utils/xorgconfig/cards.c | 278 -- hw/xfree86/utils/xorgconfig/cards.h | 30 - hw/xfree86/utils/xorgconfig/xorgconfig.c | 2890 --------------- .../utils/xorgconfig/xorgconfig.man.pre | 22 - 9 files changed, 1 insertion(+), 7075 deletions(-) delete mode 100644 hw/xfree86/utils/xorgconfig/.gitignore delete mode 100644 hw/xfree86/utils/xorgconfig/Cards delete mode 100644 hw/xfree86/utils/xorgconfig/Cards98 delete mode 100644 hw/xfree86/utils/xorgconfig/Makefile.am delete mode 100644 hw/xfree86/utils/xorgconfig/cards.c delete mode 100644 hw/xfree86/utils/xorgconfig/cards.h delete mode 100644 hw/xfree86/utils/xorgconfig/xorgconfig.c delete mode 100644 hw/xfree86/utils/xorgconfig/xorgconfig.man.pre diff --git a/hw/xfree86/utils/Makefile.am b/hw/xfree86/utils/Makefile.am index e3e7a6177..62705d2fc 100644 --- a/hw/xfree86/utils/Makefile.am +++ b/hw/xfree86/utils/Makefile.am @@ -3,5 +3,4 @@ SUBDIRS = \ cvt \ ioport \ kbd_mode \ - xorgcfg \ - xorgconfig + xorgcfg diff --git a/hw/xfree86/utils/xorgconfig/.gitignore b/hw/xfree86/utils/xorgconfig/.gitignore deleted file mode 100644 index 6f3cabd65..000000000 --- a/hw/xfree86/utils/xorgconfig/.gitignore +++ /dev/null @@ -1 +0,0 @@ -xorgconfig.1 diff --git a/hw/xfree86/utils/xorgconfig/Cards b/hw/xfree86/utils/xorgconfig/Cards deleted file mode 100644 index b95928c37..000000000 --- a/hw/xfree86/utils/xorgconfig/Cards +++ /dev/null @@ -1,3135 +0,0 @@ -# $XConsortium: Cards /main/27 1996/10/28 05:43:53 kaleb $ -# This is the database of card definitions used by xf86config. -# Each definition should have a NAME entry, CHIPSET (descriptive) and -# SERVER (one of Mono, VGA16, SVGA, S3, 8514, Mach8, Mach32, Mach64, AGX, -# P9000, W32, I128). -# A reference to another definition is made with SEE (already defined -# entries are not overridden). -# Optional entries are RAMDAC (identifier), CLOCKCHIP (identifier), -# DACSPEED, NOCLOCKPROBE (advises never to probe clocks), UNSUPPORTED -# (indicates card that is not yet properly supported by a dedicated -# server). A LINE entry adds a line of text to be included in the -# Device section (can include options or comments). -# There's no CLOCKS option (although a Clocks line can be included -# with LINE), as it is very undesirable to have a Clocks line that -# is incorrect. The idea is that the Clocks are probed for to be -# sure (a commented suggested Clocks line can be included). -# -# The majority of entries are just a binding of a model name to a -# chipset/server and untested. -# -# $XFree86: xc/programs/Xserver/hw/xfree86/xf86config/Cards,v 3.79 2002/10/16 01:31:05 dawes Exp $ - -# VGA - -NAME * Generic VGA compatible -SERVER VGA16 -DRIVER vga - -NAME * Generic VESA compatible -SERVER VGA16 -DRIVER vesa - -NAME * Unsupported VGA compatible -SERVER VGA16 -DRIVER vga -UNSUPPORTED - - -# # -# generic # -# # - -NAME ** Alliance Pro Motion (generic) [apm] -#CHIPSET apm -SERVER SVGA -DRIVER apm -LINE #Option "no_accel" - -NAME ** Ark Logic (generic) [ark] -#CHIPSET ark -SERVER SVGA -DRIVER ark - -NAME ** ASPEED Technology (generic) [ast] -#CHIPSET ast -SERVER SVGA -DRIVER ast - -NAME ** ATI (generic) [ati] -#CHIPSET ati -SERVER SVGA -DRIVER ati - -NAME ** ATI Rage 128 based (generic) [r128] -#CHIPSET r128 -SERVER SVGA -DRIVER r128 - -NAME ** ATI Radeon (generic) [radeon] -#CHIPSET radeon -SERVER SVGA -DRIVER radeon - -NAME ** Chips and Technologies (generic) [chips] -#CHIPSET chips -SERVER SVGA -DRIVER chips -LINE # Option "suspend_hack" -LINE # Option "STN" -LINE # Option "no_stretch" -LINE # Option "no_center" -LINE # Option "use_modeline" -LINE # Option "fix_panel_size" -LINE # videoram 512 -LINE # Option "noaccel" -LINE # Option "no_bitblt" -LINE # Option "xaa_no_color_exp" -LINE # Option "xaa_benchmark" -LINE # Option "hw_cursor" -LINE # Option "nolinear" -LINE # MemBase 0x03b00000 -LINE # Option "hw_clocks" -LINE # Textclockfreq 25.175 - -NAME ** Cirrus Logic (generic) [cirrus] -#CHIPSET cirrus -SERVER SVGA -DRIVER cirrus -LINE # MemBase 0x00e00000 # ISA card that maps to 14Mb -LINE # MemBase 0x04000000 # VLB card that maps to 64Mb -LINE # MemBase 0x80000000 # VLB card that maps to 2048Mb -LINE # MemBase 0x02000000 # VLB card that maps to 32Mb -LINE # Option "linear" -LINE # Option "fifo_conservative" - -NAME ** Cyrix MediaGX (generic) [cyrix] -#CHIPSET cyrix -SERVER SVGA -DRIVER cyrix - -NAME ** Linux framebuffer (generic) [fbdev] -#CHIPSET fbdev -SERVER SVGA -DRIVER fbdev - -NAME ** 3DLabs, TI (generic) [glint] -#CHIPSET glint -SERVER SVGA -DRIVER glint -LINE #Option "no_accel" - -NAME ** Number Nine I128 (generic) [i128] -#CHIPSET i128 -SERVER SVGA -DRIVER i128 - -NAME ** Intel i740 (generic) [i740] -#CHIPSET i740 -SERVER SVGA -DRIVER i740 - -NAME ** Intel i810 (generic) [i810] -#CHIPSET i810 -SERVER SVGA -DRIVER i810 - -NAME ** Matrox Graphics (generic) [mga] -#CHIPSET mga -SERVER SVGA -DRIVER mga -LINE # Option "mga_sdram" - -NAME ** NeoMagic (generic) [neomagic] -#CHIPSET neomagic -SERVER SVGA -DRIVER neomagic -LINE # Chipset "NM2160" -LINE # IOBase 0xfea00000 -LINE # MemBase 0xfd000000 -LINE # VideoRam 2048 -LINE # DacSpeed 90 -LINE # Option "linear" -LINE # Option "nolinear" -LINE # Option "sw_cursor" -LINE # Option "hw_cursor" -LINE # Option "no_accel" -LINE # Option "intern_disp" -LINE # Option "extern_disp" -LINE # Option "mmio" -LINE # Option "no_mmio" -LINE # Option "lcd_center" -LINE # Option "no_stretch" - -NAME ** NVIDIA (generic) [nv] -#CHIPSET nv -SERVER SVGA -DRIVER nv - -NAME ** Rendition (generic) [rendition] -#CHIPSET rendition -SERVER SVGA -DRIVER rendition -LINE # Option "sw_cursor" - -NAME ** S3 (not ViRGE or Savage) (generic) [s3] -#CHIPSET s3 -SERVER SVGA -DRIVER s3 - -NAME ** S3 ViRGE (generic) [s3virge] -#CHIPSET s3virge -SERVER SVGA -DRIVER s3virge -LINE # Option "xaa_benchmark" -LINE # Option "fifo_moderate" -LINE # Option "pci_burst_on" -LINE # Option "pci_retry" -LINE # Option "lcd_center" -LINE # Set_LCDClk - -NAME ** S3 Savage (generic) [savage] -#CHIPSET savage -SERVER SVGA -DRIVER savage - -NAME ** Silicon Motion (generic) [siliconmotion] -#CHIPSET siliconmotion -SERVER SVGA -DRIVER siliconmotion - -NAME ** SiS (generic) [sis] -#CHIPSET sis -SERVER SVGA -DRIVER sis -LINE # Option "no_accel" -LINE # Option "fifo_moderate" -LINE # Option "fifo_conserv" -LINE # Option "fifo_aggressive" -LINE # Option "no_BitBlt" -LINE # Option "fast_vram" -LINE # Option "pci_burst_on" -LINE # Option "xaa_benchmark" -LINE # Option "ext_eng_queue" - -NAME ** 3Dfx (generic) [tdfx] -#CHIPSET tdfx -SERVER SVGA -DRIVER tdfx - -NAME ** DEC TGA (generic) [tga] -#CHIPSET tga -SERVER SVGA -DRIVER tga - -NAME ** Trident (generic) [trident] -#CHIPSET trident -SERVER SVGA -DRIVER trident - -NAME ** Tseng Labs (generic) [tseng] -#CHIPSET tseng -SERVER SVGA -DRIVER tseng -LINE # Option "linear" -LINE # Option "noaccel" -LINE # Option "power_saver" -LINE # Option "fast_dram" -LINE # Option "pci_retry" -LINE # Option "hibit_high" -LINE # Option "hibit_low" -LINE # MemBase 0x3C00000 - -NAME ** VMWare guest OS (generic) [vmware] -#CHIPSET vmware -SERVER SVGA -DRIVER vmware - - -#Chips & Technologies - -#untested -NAME Chips & Technologies CT65520 -CHIPSET ct65520 -SERVER SVGA -DRIVER chips -LINE # Device section for C&T cards. -LINE # Option "suspend_hack" -LINE # Option "STN" -LINE # Option "no_stretch" -LINE # Option "no_center" -LINE # Option "use_modeline" -LINE # Option "fix_panel_size" -LINE # videoram 512 - -NAME Chips & Technologies CT65525 -CHIPSET ct65525 -LINE # Option "nolinear" -LINE # MemBase 0x03b00000 -SEE Chips & Technologies CT65520 - -NAME Chips & Technologies CT65530 -CHIPSET ct65530 -SEE Chips & Technologies CT65525 - -NAME Chips & Technologies CT65535 -CHIPSET ct65535 -NOCLOCKPROBE -LINE # Option "hw_clocks" -LINE # Textclockfreq 25.175 -SEE Chips & Technologies CT65530 - -NAME Chips & Technologies CT65540 -CHIPSET ct65540 -NOCLOCKPROBE -LINE # Option "use_18bit_bus" -SEE Chips & Technologies CT65535 - -NAME Chips & Technologies CT65545 -CHIPSET ct65545 -NOCLOCKPROBE -LINE # Option "noaccel" -LINE # Option "no_bitblt" -LINE # Option "xaa_no_color_exp" -LINE # Option "xaa_benchmark" -LINE # Option "hw_cursor" -LINE # Option "mmio" -SEE Chips & Technologies CT65540 - -NAME Chips & Technologies CT65546 -CHIPSET ct65546 -SEE Chips & Technologies CT65545 - -NAME Chips & Technologies CT65548 -CHIPSET ct65548 -SEE Chips & Technologies CT65545 - -NAME Chips & Technologies CT65550 -CHIPSET ct65550 -NOCLOCKPROBE -LINE # Option "noaccel" -LINE # Option "no_bitblt" -LINE # Option "xaa_no_color_exp" -LINE # Option "xaa_benchmark" -LINE # Option "hw_cursor" -LINE # Option "sync_on_green" -LINE # Option "fast_dram" -LINE # Option "use_vclk1" -LINE # Textclockfreq 25.175 -SEE Chips & Technologies CT65530 - -NAME Chips & Technologies CT65554 -CHIPSET ct65554 -SEE Chips & Technologies CT65550 - -NAME Chips & Technologies CT65555 -CHIPSET ct65555 -SEE Chips & Technologies CT65550 - -NAME Chips & Technologies CT68554 -CHIPSET ct68554 -SEE Chips & Technologies CT65550 - -NAME Chips & Technologies CT69000 -CHIPSET ct69000 -SEE Chips & Technologies CT65550 - -NAME Chips & Technologies CT69030 -CHIPSET ct69030 -SEE Chips & Technologies CT65550 - -NAME Chips & Technologies CT64200 -CHIPSET ct64200 -SERVER SVGA -DRIVER chips -LINE # Device section for C&T cards. -LINE # videoram 1024 - -NAME Chips & Technologies CT64300 -CHIPSET ct64300 -SERVER SVGA -DRIVER chips -LINE # Option "noaccel" -LINE # Option "no_bitblt" -LINE # Option "xaa_no_color_exp" -LINE # Option "xaa_benchmark" -LINE # Option "hw_cursor" -LINE # Option "nolinear" -LINE # MemBase 0x03b00000 -LINE # Option "hw_clocks" -LINE # Textclockfreq 25.175 -SEE Chips & Technologies CT64200 - -# Cirrus Logic - -#tested -NAME Cirrus Logic GD542x -SERVER SVGA -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE -LINE # Device section for Cirrus Logic GD5420/2/4/6/8/9-based cards. -LINE #MemBase 0x00e00000 -LINE #MemBase 0x04e00000 -LINE #Option "linear" - -#tested -NAME Cirrus Logic GD543x -CHIPSET CL-GD5430/5434/5436 -SERVER SVGA -DRIVER cirrus -NOCLOCKPROBE -LINE # Device section for Cirrus Logic GD5430/34-based cards. -LINE #MemBase 0x00e00000 # ISA card that maps to 14Mb -LINE #MemBase 0x04000000 # VLB card that maps to 64Mb -LINE #MemBase 0x80000000 # VLB card that maps to 2048Mb -LINE #MemBase 0x02000000 # VLB card that maps to 32Mb -LINE #Option "linear" - -NAME Cirrus Logic GD544x -CHIPSET CL-GD544x -SERVER SVGA -DRIVER cirrus -NOCLOCKPROBE - -NAME Creative Labs Graphics Blaster MA201 -SEE Cirrus Logic GD544x - -NAME Creative Labs Graphics Blaster MA202 -SEE Cirrus Logic GD544x - -#tested -NAME Cirrus Logic GD5462 -CHIPSET CL-GD5462 -SERVER SVGA -DRIVER cirrus -NOCLOCKPROBE -LINE #Option "fifo_conservative" - -#tested -NAME Cirrus Logic GD5464 -CHIPSET CL-GD5464 -SERVER SVGA -DRIVER cirrus -NOCLOCKPROBE -LINE #Option "fifo_conservative" - -#tested -NAME Cirrus Logic GD5465 -CHIPSET CL-GD5465 -SERVER SVGA -DRIVER cirrus -NOCLOCKPROBE -LINE #Option "fifo_conservative" - -NAME Creative Labs Graphics Blaster MA302 -CHIPSET CL-GD5462 -SEE Cirrus Logic GD5462 - -NAME Creative Labs Graphics Blaster MA334 -CHIPSET CL-GD5464 -SEE Cirrus Logic GD5464 - -NAME Creative Labs Graphics Blaster 3D -CHIPSET CL-GD5464 -SEE Cirrus Logic GD5464 - -#tested -NAME Cirrus Logic GD5480 -CHIPSET CL-GD5480 -SERVER SVGA -DRIVER cirrus -NOCLOCKPROBE - -#tested -NAME Diamond SpeedStar 64 -CHIPSET CL-GD5434 -SEE Cirrus Logic GD543x - -NAME Diamond SpeedStar64 Graphics 2000/2200 -CHIPSET CL-GD5434 -SEE Cirrus Logic GD543x - -NAME Diamond SpeedStar Pro SE (CL-GD5430/5434) -SEE Cirrus Logic GD543x - -NAME Diamond SpeedStar Pro 1100 -SEE Cirrus Logic GD542x - -NAME Orchid Kelvin 64 VLB Rev A -CHIPSET CL-GD5434 -SERVER SVGA -DRIVER cirrus -NOCLOCKPROBE -LINE # Device section for Orchid Kelvin 64 VLB Rev A -LINE # Linear framebuffer maps at 2048Mb. Some motherboards make linear addressing -LINE # impossible. Some cards map at 32Mb. -LINE #MemBase 0x02000000 # VLB card that maps to 32Mb -LINE #MemBase 0x04000000 # VLB card that maps to 64Mb -LINE MemBase 0x80000000 # VLB card that maps to 2048Mb -LINE #Option "linear" - -NAME Orchid Kelvin 64 VLB Rev B -CHIPSET CL-GD5434 -SERVER SVGA -DRIVER cirrus -NOCLOCKPROBE -LINE # Device section for Orchid Kelvin 64 VLB Rev B -LINE # Linear framebuffer maps at 32Mb. Some motherboards make linear addressing -LINE # impossible. Some cards map at 2048Mb. -LINE MemBase 0x02000000 # VLB card that maps to 32Mb -LINE #MemBase 0x04000000 # VLB card that maps to 64Mb -LINE #MemBase 0x80000000 # VLB card that maps to 2048Mb -LINE #Option "linear" - -NAME Orchid Kelvin 64 -CHIPSET CL-GD5434 -SEE Cirrus Logic GD543x - -NAME Intel 5430 -CHIPSET CL-GD5430 -SEE Cirrus Logic GD543x - -NAME STB Nitro (64) -CHIPSET CL-GD5434 -SEE Cirrus Logic GD543x - -NAME STB Nitro 64 Video -CHIPSET CL-GD5446 -SEE Cirrus Logic GD544x - -NAME STB Horizon -CHIPSET CL-GD5426/28 -SEE Cirrus Logic GD542x - -NAME STB Horizon Video -CHIPSET CL-GD5440 -SEE Cirrus Logic GD544x - -NAME Genoa 8500VL(-28) -CHIPSET CL-GD5426/28 -SEE Cirrus Logic GD542x - -NAME Diamond SpeedStar Pro (not SE) -CHIPSET CL-GD5426/28 -SEE Cirrus Logic GD542x - -NAME ALG-5434(E) -CHIPSET CL-GD5434 -SEE Cirrus Logic GD543x - -NAME Actix ProStar -CHIPSET CL-GD5426/5428 -SEE Cirrus Logic GD542x - -NAME Actix ProStar 64 -CHIPSET CL-GD5434 -SEE Cirrus Logic GD543x - -#tested -NAME Acumos AVGA3 -SEE Cirrus Logic GD542x - -NAME DFI-WG1000 -SEE Cirrus Logic GD542x - -NAME Spider VLB Plus -CHIPSET CL-GD5428 -SEE Cirrus Logic GD542x - -NAME VI720 -CHIPSET CL-GD5434 -SEE Cirrus Logic GD543x - -NAME Cirrus Logic GD62xx (laptop) -CHIPSET CL-GD6205/15/25/35 -SERVER SVGA -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE - -NAME Cirrus Logic GD64xx (laptop) -CHIPSET CL-GD6420/6440 -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME Cirrus Logic GD754x (laptop) -CHIPSET CL-GD7541/42/43/48 -SERVER SVGA -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE - -NAME Techworks Ultimate 3D -CHIPSET CL-GD5464 -SEE Cirrus Logic GD5464 - -NAME VideoLogic GrafixStar 550 -CHIPSET CL-GD5464 -SEE Cirrus Logic GD5464 - -NAME Jaton Video-70P -CHIPSET CL-GD5464 -SEE Cirrus Logic GD5464 - -NAME PixelView Combo TV Pro (Prolink) -CHIPSET CL-GD5480, 4MB -SERVER SVGA -DRIVER vga -UNSUPPORTED -LINE # COMMENT on card TV Tuner -NOCLOCKPROBE - -NAME PixelView Combo TV 3D AGP (Prolink) -CHIPSET CL-GD5465, 4MB -SERVER SVGA -DRIVER vga -UNSUPPORTED -LINE # COMMENT on card TV+FM Tuner -NOCLOCKPROBE - -NAME Creative Labs Graphics Blaster Eclipse (OEM Model CT6510) -SEE Cirrus Logic GD5465 - -NAME VideoLogic GrafixStar 560 (PCI/AGP) -SEE Cirrus Logic GD5465 - -NAME Cirrus Logic GD5446 (noname card) -CHIPSET CL-GD5446, 1MB (upgradable to 2MB). -SERVER SVGA -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE - -NAME Octek VL-VGA-26 -CHIPSET CL-GD5426 -SEE Cirrus Logic GD542x - -NAME Octek VL-VGA-28 -CHIPSET CL-GD5428 -SEE Cirrus Logic GD542x - -NAME Octek Combo-26 -CHIPSET CL-GD5426 -SEE Cirrus Logic GD542x - -NAME Octek Combo-28 -CHIPSET CL-GD5428 -SEE Cirrus Logic GD542x - -NAME Octek AVGA-20 -SEE Cirrus Logic GD542x - -# S3 801/805 - -NAME S3 801/805 (generic) -CHIPSET S3 801/805 -SERVER S3 -DRIVER vga -UNSUPPORTED - -NAME S3 86C801 (generic) -SEE S3 801/805 (generic) - -NAME S3 86C805 (generic) -SEE S3 801/805 (generic) - -#tested -NAME S3 801/805 with ATT20c490 RAMDAC -CHIPSET S3 801/805 -SERVER S3 -DRIVER vga -UNSUPPORTED -RAMDAC att20c490 -LINE #Option "dac_8_bit" # Not supported by some 20c490 clones - -NAME S3 801/805 with SC1148{2,3,4} RAMDAC -CHIPSET S3 801/805 -SERVER S3 -DRIVER vga -UNSUPPORTED -RAMDAC sc11482 - -NAME S3 801/805 with SC1148{5,7,9} RAMDAC -CHIPSET S3 801/805 -SERVER S3 -DRIVER vga -UNSUPPORTED -RAMDAC sc11485 - -NAME S3 801/805 with S3 GenDAC -CHIPSET S3 801/805 -SERVER S3 -DRIVER vga -UNSUPPORTED -RAMDAC s3gendac -CLOCKCHIP s3gendac - -NAME S3 801/805 with ATT20c490 RAMDAC and ICD2061A -CHIPSET S3 801/805 -SERVER S3 -DRIVER vga -UNSUPPORTED -RAMDAC att20c490 -CLOCKCHIP icd2061a -LINE #Option "dac_8_bit" # Not supported by some 20c490 clones - -NAME S3 801/805 with Chrontel 8391 -CHIPSET S3 801/805 -SERVER S3 -DRIVER vga -UNSUPPORTED -RAMDAC att20c490 -CLOCKCHIP ch8391 -LINE Option "dac_8_bit" - -#tested -NAME Actix GE32+ 2MB -CHIPSET S3 801/805 -SERVER S3 -DRIVER vga -UNSUPPORTED -RAMDAC att20c490 -LINE #Option "dac_8_bit" - -NAME Actix GE32i -CHIPSET S3 805i -SERVER S3 -DRIVER vga -UNSUPPORTED - -NAME Orchid Fahrenheit VA -CHIPSET S3 801/805 -SERVER S3 -DRIVER vga -UNSUPPORTED -RAMDAC att20c490 - -NAME Orchid Fahrenheit 1280 -CHIPSET S3 801 -SERVER S3 -DRIVER vga -UNSUPPORTED -LINE #Probable clocks: -LINE #Clocks 25.20 28.32 32.50 0.00 40.00 44.90 50.40 65.00 -LINE #Clocks 78.00 56.70 63.10 75.10 80.00 89.90 100.90 31.50 - -NAME Orchid Fahrenheit-1280+ -CHIPSET S3 801/805 -SERVER S3 -DRIVER vga -UNSUPPORTED -RAMDAC att20C490 -LINE Dacspeed 110 -LINE Option "dac_8_bit" -LINE #Option "nolinear" # VLB card may require this -LINE #Probable clocks: -LINE #Clocks 25.20 28.32 40.0 0.0 50.10 77.0 36.10 45.0 -LINE #Clocks 130.0 120.20 80.0 31.50 110.30 65.0 75.0 94.60 - -NAME Diamond Stealth 24 -CHIPSET S3 801/805 -SERVER S3 -DRIVER vga -UNSUPPORTED -CLOCKCHIP icd2061a -LINE #Option "nolinear" -LINE #Ramdac "att20c490" # The Diamond RAMDAC is reportedly compatible for 15bpp - -NAME Miro Crystal 8S -SEE S3 801/805 (generic) - -NAME Miro Crystal 10SD with GenDAC -SEE S3 801/805 with S3 GenDAC - -NAME Dell S3 805 -SEE S3 801/805 (generic) - -NAME STB Powergraph X-24 -SEE S3 801/805 with ATT20c490 RAMDAC and ICD2061A - -NAME JAX 8241 -SEE S3 801/805 with Chrontel 8391 - -NAME VL-41 -SEE S3 801/805 with Chrontel 8391 - -NAME SPEA Mirage -SEE S3 801/805 with Chrontel 8391 - -# S3 864/Trio64/Trio32/868 - -NAME S3 864 (generic) -SERVER S3 -DRIVER vga -UNSUPPORTED - -NAME S3 86C864 (generic) -SEE S3 864 (generic) - -NAME S3 Vision864 (generic) -SEE S3 864 (generic) - -NAME S3 864 with SDAC (86C716) -CHIPSET S3 864 -SERVER S3 -DRIVER vga -UNSUPPORTED -RAMDAC s3_sdac -CLOCKCHIP s3_sdac -NOCLOCKPROBE - -NAME S3 864 with ATT 20C498 or 21C498 -CHIPSET S3 864 -SERVER S3 -DRIVER vga -UNSUPPORTED -RAMDAC att20c498 - -NAME S3 864 with STG1703 -CHIPSET S3 864 -SERVER S3 -DRIVER vga -UNSUPPORTED -RAMDAC stg1703 -NOCLOCKPROBE - -NAME S3 868 (generic) -CHIPSET S3 868 -SERVER S3 -DRIVER vga -UNSUPPORTED - -NAME S3 86C868 (generic) -SEE S3 868 (generic) - -NAME S3 Vision868 (generic) -SEE S3 868 (generic) - -NAME S3 868 with SDAC (86C716) -CHIPSET S3 868 -SERVER S3 -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE - -NAME S3 868 with ATT 20C498 or 21C498 -CHIPSET S3 868 -SERVER S3 -DRIVER vga -UNSUPPORTED -RAMDAC att20c498 - -NAME S3 868 with ATT 20C409 -CHIPSET S3 868 -SERVER S3 -DRIVER vga -UNSUPPORTED -RAMDAC att20c409 -NOCLOCKPROBE - -NAME Number Nine FX Motion 531 -CLOCKCHIP icd2061a -SEE S3 868 with ATT 20C498 or 21C498 - -NAME S3 Trio64 (generic) -SERVER S3 -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE - -NAME S3 86C764 (generic) -SEE S3 Trio64 (generic) - -NAME S3 Trio64V+ (generic) -SERVER S3 -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE - -NAME S3 86C765 (generic) -SEE S3 Trio64V+ (generic) - -NAME S3 Trio32 (generic) -CHIPSET S3 Trio32 -SERVER S3 -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE - -NAME Genoa Phantom 64i with S3 SDAC -DACSPEED 135 -SEE S3 864 with SDAC (86C716) - -NAME Number Nine GXE64 -CHIPSET S3 864 -SERVER S3 -DRIVER vga -UNSUPPORTED -CLOCKCHIP icd2061a -LINE Option "number_nine" - -NAME Number Nine GXE64 with S3 Trio64 -SEE S3 Trio64 (generic) - -NAME Diamond Stealth 64 DRAM with S3 SDAC -DACSPEED 135 -SEE S3 864 with SDAC (86C716) - -NAME Diamond Stealth64 Graphics 2xx0 series (864 + SDAC) -DACSPEED 135 -SEE S3 864 with SDAC (86C716) - -NAME Diamond Stealth 64 DRAM with S3 Trio64 -SEE S3 Trio64 (generic) - -NAME Diamond Stealth64 Graphics 2xx0 series (Trio64) -SEE S3 Trio64 (generic) - -NAME Diamond Stealth 64 DRAM SE -SEE S3 Trio32 (generic) - -NAME Diamond Stealth64 Video 2001 series (2121/2201) -SEE S3 Trio64V+ (generic) - -NAME Actix GE64 -CLOCKCHIP icd2061a -SEE S3 864 (generic) - -NAME ELSA Winner 1000PRO with S3 SDAC -SEE S3 864 with SDAC (86C716) - -NAME ELSA Winner 1000PRO with STG1700 or AT&T RAMDAC -CHIPSET S3 864 -SERVER S3 -DRIVER vga -UNSUPPORTED -CLOCKCHIP icd2061a - -NAME ELSA Winner 1000PRO/X -SEE S3 868 with SDAC (86C716) - -NAME ELSA Winner 1000ISA -CHIPSET S3 805i -SERVER S3 -DRIVER vga -UNSUPPORTED -CLOCKCHIP icd2061a -LINE Option "dac_8_bit" -LINE # the following settings should be detected and set automatically by XF86_S3 -LINE # if the serial number of the ELSA card is printed correctly: -LINE #ClockChip "icd2061a" - -NAME Cardex Trio64 -SEE S3 Trio64 (generic) - -NAME Cardex Trio64Pro -SEE S3 Trio64 (generic) - -NAME Miro Crystal 12SD -SEE S3 Trio32 (generic) - -NAME Miro Crystal 22SD -SEE S3 Trio64 (generic) - -NAME Miro Crystal 20SD with ICS2494 (BIOS 1.xx) -SEE S3 864 with ATT 20C498 or 21C498 - -NAME Miro Crystal 20SD with ICD2061A (BIOS 2.xx) -CLOCKCHIP icd2061a -SEE S3 864 with ATT 20C498 or 21C498 - -NAME Miro Crystal 20SD VLB with S3 SDAC (BIOS 3.xx) -SEE S3 864 with SDAC (86C716) - -NAME Miro Crystal 20SD PCI with S3 SDAC -SEE S3 868 with SDAC (86C716) - -NAME ELSA Winner 1000AVI (SDAC version) -SEE S3 868 with SDAC (86C716) - -NAME ELSA Winner 1000AVI (AT&T 20C409 version) -SEE S3 868 with ATT 20C409 - -NAME Diamond Stealth Video DRAM -SEE S3 868 with SDAC (86C716) - -NAME Diamond Stealth64 Video 2120/2200 -SEE S3 868 with SDAC (86C716) - -NAME SPEA/V7 Mirage P64 -CLOCKCHIP ics2595 -SEE S3 864 (generic) - -NAME SPEA/V7 Mirage P64 with S3 Trio64 -SEE S3 Trio64 (generic) - -NAME Number Nine FX Vision 330 -SEE S3 Trio64 (generic) - -NAME Number Nine FX Motion 331 -SEE S3 Trio64V+ (generic) - -NAME ASUS Video Magic PCI V864 -SEE S3 864 (generic) - -NAME ASUS Video Magic PCI VT64 -SEE S3 Trio64 (generic) - -NAME VidTech FastMax P20 -SEE S3 864 (generic) - -NAME VideoLogic GrafixStar 500 -SEE S3 868 with SDAC (86C716) - -NAME VideoLogic GrafixStar 400 -SEE S3 Trio64V+ (generic) - -NAME VideoLogic GrafixStar 300 -SEE S3 Trio64 (generic) - -NAME 2 the Max MAXColor S3 Trio64V+ -SEE S3 Trio64V+ (generic) - -NAME DataExpert DSV3365 -SEE S3 Trio64V+ (generic) - -NAME ExpertColor DSV3365 -SEE S3 Trio64V+ (generic) - -NAME DSV3326 -SEE S3 Trio64V+ (generic) - -# S3 Trio64V2 - -NAME S3 Trio64V2 (generic) -SERVER S3 -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE - -NAME S3 Trio64V2/DX (generic) -SEE S3 Trio64V2 (generic) - -NAME S3 Trio64V2/GX (generic) -SEE S3 Trio64V2 (generic) - -NAME S3 86C775 (generic) -SEE S3 Trio64V2/DX (generic) - -NAME S3 86C785 (generic) -SEE S3 Trio64V2/GX (generic) - -NAME ELSA WINNER 1000/T2D -SEE S3 Trio64V2/DX (generic) - - -# S3 Aurora64V+ - -NAME S3 Aurora64V+ (generic) -CHIPSET S3 Aurora64V+ -SERVER S3 -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE -LINE # Option "lcd_center" -LINE # Set_LCDClk - -NAME S3 86CM65 -SEE S3 Aurora64V+ (generic) - -NAME SHARP 9080 -SEE S3 Aurora64V+ (generic) - -NAME SHARP 9090 -SEE S3 Aurora64V+ (generic) - -NAME COMPAQ Armada 7730MT -SEE S3 Aurora64V+ (generic) - -NAME COMPAQ Armada 7380DMT -SEE S3 Aurora64V+ (generic) - - -# S3 964/968 - -NAME S3 964 (generic) -CHIPSET S3 964 -SERVER S3 -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE - -NAME S3 86C964 (generic) -SEE S3 964 (generic) - -NAME S3 Vision964 (generic) -SEE S3 964 (generic) - -NAME S3 968 (generic) -CHIPSET S3 968 -SERVER S3 -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE - -NAME S3 86C968 (generic) -SEE S3 968 (generic) - -NAME S3 Vision968 (generic) -SEE S3 968 (generic) - -NAME Number Nine GXE64 Pro -CHIPSET S3 964 -SERVER S3 -DRIVER vga -UNSUPPORTED -RAMDAC ti3025 -LINE Option "number_nine" - -NAME Diamond Stealth 64 VRAM -CLOCKCHIP icd2061a -LINE #Option "slow_vram" -SEE S3 964 (generic) - -NAME Diamond Stealth64 Video 3200 -CHIPSET S3 968 -LINE #Option "slow_vram" -SEE S3 968 (generic) - -NAME Diamond Stealth 64 Video VRAM (TI RAMDAC) -CHIPSET S3 968 -LINE #Option "slow_vram" -LINE #DacSpeed 220 -SEE S3 968 (generic) - -NAME Diamond Stealth64 Video 3240/3400 (TI RAMDAC) -CHIPSET S3 968 -LINE #Option "slow_vram" -LINE #DacSpeed 220 -SEE S3 968 (generic) - -NAME Diamond Stealth64 Video 3240/3400 (IBM RAMDAC) -CHIPSET S3 968 -LINE #Option "slow_vram" -RAMDAC ibm_rgb526 -LINE DacSpeed 220 -SEE S3 968 (generic) - -NAME Genoa VideoBlitz III AV -CHIPSET S3 968 -LINE #s3RefClk 50 -LINE #DACspeed 170 -SEE S3 968 (generic) - -NAME STB Velocity 64 Video -CHIPSET S3 968 -LINE #s3RefClk 24 -LINE #DACspeed 220 -SEE S3 968 (generic) - -NAME STB Powergraph 64 Video -SEE S3 Trio64V+ (generic) - -NAME STB Powergraph 64 -SEE S3 Trio64 (generic) - -NAME ELSA Winner 1000TRIO -SEE S3 Trio64 (generic) - -NAME ELSA Winner 1000TRIO/V -SEE S3 Trio64V+ (generic) - -NAME Hercules Graphite Terminator 64 -LINE Option "slow_vram" -LINE #s3RefClk 50 -LINE #DACspeed 170 -SEE S3 964 (generic) - -NAME Hercules Terminator 64/Video -SEE S3 Trio64V+ (generic) - -NAME Hercules Graphite Terminator 64/DRAM -SEE S3 Trio64 (generic) - -NAME Hercules Graphite Terminator Pro 64 -LINE #s3RefClk 16 -LINE #DACspeed 220 -SEE S3 968 (generic) - -NAME Number Nine FX Motion 771 -LINE #s3RefClk 16 -SEE S3 968 (generic) - -NAME Spider Tarantula 64 -SEE S3 964 (generic) - -NAME Miro Crystal 20SV -CHIPSET S3 964 -SERVER S3 -DRIVER vga -UNSUPPORTED -CLOCKCHIP icd2061a - -NAME Miro Crystal 40SV -CHIPSET S3 964 -SERVER S3 -DRIVER vga -UNSUPPORTED -CLOCKCHIP ti3025 - -NAME Miro Crystal 80SV -CHIPSET S3 968 -SERVER S3 -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE - -NAME Miro Video 20SV -CHIPSET S3 968 -SERVER S3 -DRIVER vga -UNSUPPORTED -RAMDAC att20c505 -LINE #DacSpeed 150 -CLOCKCHIP ics9161a - -NAME SPEA Mercury 64 -CHIPSET S3 964 -SERVER S3 -DRIVER vga -UNSUPPORTED -CLOCKCHIP ics9161a -LINE #Option "spea_mercury" - -NAME ELSA Winner 2000PRO-2 -CHIPSET S3 964 -SERVER S3 -DRIVER vga -UNSUPPORTED -LINE #Option "ELSA_w2000pro" -NOCLOCKPROBE - -NAME ELSA Winner 2000PRO-4 -CHIPSET S3 964 -SERVER S3 -DRIVER vga -UNSUPPORTED -LINE #Option "ELSA_w2000pro" -NOCLOCKPROBE - -NAME ELSA Winner 2000PRO/X-2 -CHIPSET S3 968 -SERVER S3 -DRIVER vga -UNSUPPORTED -LINE #Option "sync_on_green" -NOCLOCKPROBE - -NAME ELSA Winner 2000PRO/X-4 -CHIPSET S3 968 -SERVER S3 -DRIVER vga -UNSUPPORTED -LINE #Option "sync_on_green" -NOCLOCKPROBE - -NAME ELSA Winner 2000PRO/X-8 -CHIPSET S3 968 -SERVER S3 -DRIVER vga -UNSUPPORTED -LINE #Option "sync_on_green" -NOCLOCKPROBE - -NAME ELSA Winner 2000AVI -CHIPSET S3 968 -SERVER S3 -DRIVER vga -UNSUPPORTED -LINE #Option "sync_on_green" -NOCLOCKPROBE - -NAME ELSA Gloria-4 -CHIPSET S3 968 -SERVER S3 -DRIVER vga -UNSUPPORTED -LINE #Option "sync_on_green" -NOCLOCKPROBE - -NAME ELSA Gloria-8 -CHIPSET S3 968 -SERVER S3 -DRIVER vga -UNSUPPORTED -LINE #Option "sync_on_green" -NOCLOCKPROBE - -NAME VideoLogic GrafixStar 700 -CHIPSET S3 968 -SERVER S3 -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE - -NAME LeadTek WinFast S430 -CHIPSET S3 968 -SERVER S3 -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE - -NAME WinFast S430 -SEE LeadTek WinFast S430 - -NAME LeadTek WinFast S510 -CHIPSET S3 968 -SERVER S3 -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE - -NAME WinFast S510 -SEE LeadTek WinFast S510 - -# S3 928 - -NAME S3 928 (generic) -CHIPSET S3 928 -SERVER S3 -DRIVER vga -UNSUPPORTED - -NAME S3 86C928 (generic) -SEE S3 928 (generic) - -NAME Actix Ultra -CHIPSET S3 928 -SERVER S3 -DRIVER vga -UNSUPPORTED -RAMDAC att20c490 -LINE #Option "dac_8_bit" - -NAME Diamond Stealth Pro -CHIPSET S3 928 -SERVER S3 -DRIVER vga -UNSUPPORTED -CLOCKCHIP icd2061a -LINE #Ramdac "att20c490" # The Diamond RAMDAC is reportedly compatible for 15bpp -LINE #Option "no_linear" # Some VLB machines may require this - -NAME ELSA Winner 1000VL -CHIPSET S3 928 -SERVER S3 -DRIVER vga -UNSUPPORTED -LINE # the following settings should be detected and set automatically by XF86_S3 -LINE # if the serial number of the ELSA card is printed correctly: -LINE #ClockChip "icd2061a" -LINE #Membase 0xf8000000 - -NAME ELSA Winner 1000TwinBus -SEE ELSA Winner 1000VL - -NAME ELSA Winner 2000 -SEE S3 928 (generic) - -NAME Miro Crystal 16S -SEE S3 928 (generic) - -NAME SPEA/V7 Mercury -CHIPSET S3 928 -SERVER S3 -DRIVER vga -UNSUPPORTED -CLOCKCHIP sc11412 -LINE Option "spea_mercury" - -NAME STB Pegasus -CHIPSET S3 928 -SERVER S3 -DRIVER vga -UNSUPPORTED -RAMDAC bt485 -CLOCKCHIP icd2061a -LINE Option "stb_pegasus" -LINE #Option "sync_on_green" - -NAME Number Nine GXE Level 14/16 -CHIPSET S3 928 -SERVER S3 -DRIVER vga -UNSUPPORTED -DACSPEED 200 -CLOCKCHIP icd2061a -LINE Option "number_nine" -LINE #Option "nolinear" -LINE #Option "nomemaccess" - -NAME Number Nine GXE Level 10/11/12 -CHIPSET S3 928 -SERVER S3 -DRIVER vga -UNSUPPORTED -CLOCKCHIP icd2061a -LINE Option "number_nine" - -NAME 928Movie -CHIPSET S3 928 -SERVER S3 -DRIVER vga -UNSUPPORTED -CLOCKCHIP icd2595 -RAMDAC bt485 -LINE # pixel multiplexing not supported - -# S3 911/924 - -NAME S3 911/924 (generic) -CHIPSET S3 911/924 -SERVER S3 -DRIVER vga -UNSUPPORTED - -NAME S3 86C911 (generic) -SEE S3 911/924 (generic) - -NAME S3 86C924 (generic) -SEE S3 911/924 (generic) - -NAME Diamond Stealth VRAM -CHIPSET S3 911/924 -SERVER S3 -DRIVER vga -UNSUPPORTED -CLOCKCHIP icd2061a - -#NAME Orchid Fahrenheit 1280 -#SEE S3 911/924 (generic) - -NAME S3 924 with SC1148 DAC -CHIPSET S3 924 -SERVER S3 -DRIVER vga -UNSUPPORTED -LINE #Probable clocks: -LINE #Clocks 25.2 28.3 39.7 1.7 49.9 76.7 35.7 44 -LINE #Clocks 130.2 119.5 79.4 31.2 110.0 65.2 74.9 71.3 - -# S3 ViRGE,/DX,/GX and ViRGE/VX - -NAME S3 ViRGE (old S3V server) -CHIPSET S3 ViRGE -SERVER S3V -DRIVER s3virge -NOCLOCKPROBE - -NAME S3 ViRGE (generic) -CHIPSET S3 ViRGE -SERVER SVGA -DRIVER s3virge -NOCLOCKPROBE -LINE #Option "xaa_benchmark" -LINE #Option "fifo_moderate" -LINE #Option "pci_burst_on" -LINE #Option "pci_retry" - -NAME S3 ViRGE/DX (generic) -CHIPSET S3 ViRGE/DX -SERVER SVGA -DRIVER s3virge -NOCLOCKPROBE -LINE #Option "xaa_benchmark" -LINE #Option "fifo_moderate" -LINE #Option "pci_burst_on" -LINE #Option "pci_retry" - -NAME S3 ViRGE/GX (generic) -CHIPSET S3 ViRGE/GX -SERVER SVGA -DRIVER s3virge -NOCLOCKPROBE -LINE #Option "xaa_benchmark" -LINE #Option "fifo_moderate" -LINE #Option "pci_burst_on" -LINE #Option "pci_retry" - - -NAME S3 ViRGE/GX2 (generic) -CHIPSET S3 ViRGE/GX2 -SERVER SVGA -DRIVER s3virge -NOCLOCKPROBE -LINE #Option "xaa_benchmark" -LINE #Option "fifo_moderate" -LINE #Option "pci_burst_on" -LINE #Option "pci_retry" - -NAME S3 ViRGE/MX (generic) -CHIPSET S3 ViRGE/MX -SERVER SVGA -DRIVER s3virge -NOCLOCKPROBE -LINE #Option "lcd_center" -LINE #Set_LCDClk -LINE #Option "xaa_benchmark" -LINE #Option "fifo_moderate" -LINE #Option "pci_burst_on" -LINE #Option "pci_retry" - -NAME S3 ViRGE/MX+ (generic) -SEE S3 ViRGE/MX (generic) - - - - -NAME S3 86C325 (generic) -SEE S3 ViRGE (generic) - -NAME S3 86C375 (generic) -SEE S3 ViRGE/DX (generic) - -NAME S3 86C385 (generic) -SEE S3 ViRGE/GX (generic) - -NAME S3 86C357 (generic) -SEE S3 ViRGE/GX2 (generic) - -NAME S3 86C260 (generic) -SEE S3 ViRGE/MX (generic) - -NAME S3 86C280 (generic) -SEE S3 ViRGE/MX+ (generic) - - -NAME ELSA Victory 3D -SEE S3 ViRGE (generic) - -NAME ELSA Victory 3DX -SEE S3 ViRGE/DX (generic) - -NAME ELSA Winner 3000-S -SEE S3 ViRGE (generic) - -NAME Number Nine Visual 9FX Reality 332 -SEE S3 ViRGE (generic) - -NAME Number Nine FX Motion 332 -SEE S3 ViRGE (generic) - -NAME Diamond Stealth 3D 2000 -SEE S3 ViRGE (generic) - -NAME Diamond Stealth 3D 2000 PRO -SEE S3 ViRGE/DX (generic) - -NAME Diamond Multimedia Stealth 3D 2000 -SEE S3 ViRGE (generic) - -NAME Diamond Multimedia Stealth 3D 2000 PRO -SEE S3 ViRGE/DX (generic) - -NAME Canopus Co. Power Window 3DV -SEE S3 ViRGE (generic) - -NAME DataExpert DSV3325 -SEE S3 ViRGE (generic) - -NAME ExpertColor DSV3325 -SEE S3 ViRGE (generic) - -NAME DSV3325 -SEE S3 ViRGE (generic) - -NAME Hercules Terminator 64/3D -SEE S3 ViRGE (generic) - -NAME Hercules Terminator 3D/DX -SEE S3 ViRGE/DX (generic) - -NAME LeadTek WinFast 3D S600 -SEE S3 ViRGE (generic) - -NAME WinFast 3D S600 -SEE LeadTek WinFast 3D S600 - -NAME LeadTek WinFast 3D S680 -SEE S3 ViRGE/GX2 (generic) - -NAME Miro MiroMedia 3D -SEE S3 ViRGE (generic) - -NAME Orchid Technology Fahrenheit Video 3D -SEE S3 ViRGE (generic) - -NAME STB Systems Powergraph 3D -SEE S3 ViRGE (generic) - -NAME STB Nitro 3D -CHIPSET S3 ViRGE/GX -SEE S3 ViRGE/GX (generic) - -NAME MELCO WGP-VG4S -LINE #DACSpeed 191 162 111 83 -LINE #SetMClck 75 -SEE S3 ViRGE (generic) - - - -NAME S3 ViRGE/VX (generic) -CHIPSET S3 ViRGE/VX -SERVER SVGA -DRIVER s3virge -NOCLOCKPROBE -LINE #Option "xaa_benchmark" -LINE #Option "fifo_moderate" -LINE #Option "pci_burst_on" -LINE #Option "pci_retry" - - -NAME S3 86C988 (generic) -SEE S3 ViRGE/VX (generic) - -NAME ELSA Winner 3000 -SEE S3 ViRGE/VX (generic) - -NAME ELSA Winner 3000-M-22 -SEE S3 ViRGE/VX (generic) - -NAME ELSA Winner 3000-L-42 -SEE S3 ViRGE/VX (generic) - -NAME ELSA Winner 2000AVI/3D -SEE S3 ViRGE/VX (generic) - -NAME Diamond Stealth 3D 3000 -SEE S3 ViRGE/VX (generic) - -NAME STB Systems Velocity 3D -SEE S3 ViRGE/VX (generic) - -NAME MELCO WGP-VX8 -SEE S3 ViRGE/VX (generic) - -NAME Diamond Stealth 3D 4000 -SEE S3 ViRGE/GX2 (generic) - -NAME Toshiba Tecra 750CDT -SEE S3 ViRGE/MX (generic) - -NAME Toshiba Tecra 750DVD -SEE S3 ViRGE/MX (generic) - -NAME Toshiba Tecra 540CDT -SEE S3 ViRGE/MX (generic) - -NAME Toshiba Tecra 550CDT -SEE S3 ViRGE/MX (generic) - -# currently unsupported S3 - -NAME S3 86C365 (Trio3D) -SEE * Unsupported VGA compatible - -NAME S3 86C391 (Savage3D) -SEE * Unsupported VGA compatible - -NAME S3 Trio3D -SEE * Unsupported VGA compatible - -NAME S3 Savage3D -SEE * Unsupported VGA compatible - -NAME S3 Savage4 -SERVER SVGA -DRIVER vga -UNSUPPORTED - -# ET4000/ET6000 - -NAME ET3000 (generic) -CHIPSET ET3000 -SERVER SVGA -DRIVER tseng - -NAME Genoa 5400 -SEE ET3000 (generic) - -NAME ET4000 (generic) -CHIPSET ET4000 -SERVER SVGA -DRIVER tseng - -NAME ET4000/W32 (generic) -CHIPSET ET4000/W32 -SERVER W32 -DRIVER tseng - -NAME ET4000 W32i, W32p (generic) -CHIPSET ET4000/W32(i/p) -SERVER SVGA -DRIVER tseng -LINE #Option "linear" # for linear mode at 8bpp -LINE #Option "noaccel" # when problems with accelerator -LINE #Option "power_saver" # enable VESA DPMS -LINE #Option "fast_dram" -LINE #Option "pci_retry" # faster, but problematic for ISA DMA -LINE #Option "hibit_high" # see README.tseng -- most cards need this -LINE #Option "hibit_low" # see README.tseng -- mostly for older ET4000 cards -LINE #MemBase 0x3C00000 # when automatic MemBase detection doesn't work -LINE # -- see README.tseng for more (important) information on MemBase - -NAME ET6000 (generic) -CHIPSET ET6000 -SERVER SVGA -DRIVER tseng -NOCLOCKPROBE -LINE #videoram 2304 # 2.25 MB, when memory probe is incorrect -LINE #Option "linear" # for linear mode at 8bpp -LINE #Option "noaccel" # when problems with accelerator -LINE #Option "power_saver" # enable VESA DPMS -LINE #Option "pci_retry" # faster, but problematic for ISA DMA -LINE #Option "hw_cursor" # Use hardware cursor (see docs for limitations) -LINE #Option "xaa_no_color_exp" # When text (or bitmap) is not rendered correctly - -NAME ET6100 (generic) -CHIPSET ET6100 -SEE ET6000 (generic) - -NAME Diamond Stealth 32 -CLOCKCHIP icd2061a -NOCLOCKPROBE -SEE ET4000 W32i, W32p (generic) - -NAME Cardex Cobra -SEE ET4000 W32i, W32p (generic) - -NAME Cardex Challenger (Pro) -SEE ET4000 W32i, W32p (generic) - -NAME Colorgraphic Dual Lightning -SEE ET4000 W32i, W32p (generic) - -NAME Dell onboard ET4000 -SEE ET4000 (generic) - -NAME DFI-WG5000 -SEE ET4000 W32i, W32p (generic) - -NAME Diamond SpeedStar (Plus) -SEE ET4000 (generic) - -NAME Diamond SpeedStar 24 -SEE ET4000 (generic) - -NAME Diamond SpeedStar HiColor -SEE ET4000 (generic) - -NAME Genoa 8900 Phantom 32i -SEE ET4000 W32i, W32p (generic) - -NAME Hercules Dynamite -SEE ET4000/W32 (generic) - -NAME Hercules Dynamite Power -SEE ET4000 W32i, W32p (generic) - -NAME Hercules Dynamite Pro -SEE ET4000 W32i, W32p (generic) - -NAME Integral FlashPoint -SEE ET4000 W32i, W32p (generic) - -NAME LeadTek WinFast S200 -SEE ET4000 W32i, W32p (generic) - -NAME Matrox Comet -SEE ET4000 W32i, W32p (generic) - -NAME Matrox Marvel II -SEE ET4000 W32i, W32p (generic) - -NAME Miro MiroVideo 20TD -SEE ET4000 W32i, W32p (generic) - -NAME WinFast S200 -SEE LeadTek WinFast S200 - -NAME Sigma Concorde -SEE ET4000/W32 (generic) - -NAME Sigma Legend -SEE ET4000 (generic) - -NAME SPEA/V7 ShowTime Plus -SEE ET4000 W32i, W32p (generic) - -NAME STB LightSpeed -SEE ET4000 W32i, W32p (generic) - -NAME STB MVP-2 -SEE ET4000 (generic) - -NAME STB MVP-2 PCI -SEE ET4000 W32i, W32p (generic) - -NAME STB MVP-2X -SEE ET4000 W32i, W32p (generic) - -NAME STB MVP-4 PCI -SEE ET4000 W32i, W32p (generic) - -NAME STB MVP-4X -SEE ET4000 W32i, W32p (generic) - -NAME TechWorks Thunderbolt -SEE ET4000/W32 (generic) - -NAME ViewTop PCI -SEE ET4000 W32i, W32p (generic) - -NAME SNI PC5H W32 -CLOCKCHIP stg1703 -NOCLOCKPROBE -SEE ET4000 W32i, W32p (generic) - -NAME SNI Scenic W32 -CLOCKCHIP stg1703 -NOCLOCKPROBE -SEE ET4000 W32i, W32p (generic) - -NAME Hercules Dynamite 128/Video -SEE ET6000 (generic) - -NAME STB LightSpeed 128 -SEE ET6000 (generic) - -NAME VideoLogic GrafixStar 600 -SEE ET6000 (generic) - -NAME Jazz Multimedia G-Force 128 -SEE ET6000 (generic) - -NAME Mirage Z-128 -SEE ET6000 (generic) - -NAME California Graphics SunTracer 6000 -SEE ET6000 (generic) - -NAME Binar Graphics AnyView -SEE ET6000 (generic) - -NAME MediaVision Proaxcel 128 -SEE ET6000 (generic) - -NAME ATrend ATC-2165A -SEE ET6000 (generic) - -NAME Interay PMC Viper -SEE ET6000 (generic) - -NAME 2-the-Max MAXColor 6000 -SEE ET6000 (generic) - -NAME Gainward Challenger EV -SEE ET6000 (generic) - -NAME MachSpeed VGA ET6000 -SEE ET6000 (generic) - -NAME KouTech KeyVision 128 EV -SEE ET6000 (generic) - -NAME Jaton Video-58P -SEE ET6000 (generic) - -# ATI - -NAME ATI Rage 128 -CHIPSET ati -SERVER SVGA -DRIVER ati - -NAME ATI 8514 Ultra (no VGA) -CHIPSET ati -SERVER Mach8 -DRIVER vga -UNSUPPORTED - -NAME ATI Graphics Ultra -CHIPSET ati -SERVER Mach8 -DRIVER ati - -NAME ATI Graphics Ultra Pro -CHIPSET ati -SERVER Mach32 -DRIVER ati - -NAME ATI Wonder SVGA -CHIPSET ati -SERVER SVGA -DRIVER ati - -NAME ATI Ultra Plus -CHIPSET ati -SERVER Mach32 -DRIVER ati - -NAME ATI Mach32 -CHIPSET ati -SERVER Mach32 -DRIVER ati - -NAME ATI Mach64 -CHIPSET ati -SERVER Mach64 -DRIVER ati -NOCLOCKPROBE - -NAME ATI Mach64 CT (264CT) -SEE ATI Mach64 - -NAME ATI Mach64 VT (264VT) -SEE ATI Mach64 - -NAME ATI Mach64 GT (264GT), aka 3D RAGE -SEE ATI Mach64 - -NAME ATI Mach64 3D RAGE II -SEE ATI Mach64 - -NAME ATI Mach64 3D RAGE II+DVD -SEE ATI Mach64 - -NAME ATI Mach64 3D Rage IIC -SEE ATI Mach64 - -NAME ATI Mach64 3D Rage Pro -SEE ATI Mach64 - -NAME ATI 3D Pro Turbo -SEE ATI Mach64 - -NAME ATI 3D Pro Turbo PC2TV -SEE ATI Mach64 - -NAME ATI 3D Xpression -SEE ATI Mach64 - -NAME ATI 3D Xpression+ -SEE ATI Mach64 - -NAME ATI 3D Xpression+ PC2TV -SEE ATI Mach64 - -NAME ATI All-in-Wonder -SEE ATI Mach64 - -NAME ATI All-in-Wonder Pro -SEE ATI Mach64 - -NAME ATI Graphics Pro Turbo -SEE ATI Mach64 - -NAME ATI Graphics Pro Turbo 1600 -SEE ATI Mach64 - -NAME ATI Graphics Xpression -SEE ATI Mach64 - -NAME ATI Video Boost -SEE ATI Mach64 - -NAME ATI Video Charger -SEE ATI Mach64 - -NAME ATI Video Xpression -SEE ATI Mach64 - -NAME ATI Video Xpression+ -SEE ATI Mach64 - -NAME ATI WinBoost -SEE ATI Mach64 - -NAME ATI WinCharger -SEE ATI Mach64 - -NAME ATI WinTurbo -SEE ATI Mach64 - -NAME ATI Xpert 98 -SEE ATI Mach64 - -NAME ATI Xpert XL -SEE ATI Mach64 - -NAME ATI Xpert@Play -SEE ATI Mach64 - -NAME ATI Xpert@Play 98 -SEE ATI Mach64 - -NAME ATI Xpert@Work -SEE ATI Mach64 - -NAME ATI integrated on Intel Maui MU440EX motherboard -SEE ATI Mach64 - -NAME ASUS PCI-V264CT -SEE ATI Mach64 - -NAME ASUS PCI-AV264CT -SEE ATI Mach64 - -# AGX - -NAME AGX (generic) -CHIPSET AGX-014/15/16 -SERVER AGX -DRIVER vga -UNSUPPORTED - -NAME Boca Vortex (Sierra RAMDAC) -CHIPSET AGX-015 -SERVER AGX -DRIVER vga -UNSUPPORTED -RAMDAC sc15025 -LINE Option "dac_8_bit" -LINE Option "no_wait_state" -LINE #Option "fifo_moderate" # 2x bus bw - may result in random pixels - -NAME EIZO (VRAM) -SEE AGX (generic) - -NAME Orchid Celsius (AT&T RAMDAC) -CHIPSET AGX-015 -SERVER AGX -DRIVER vga -UNSUPPORTED -RAMDAC att20c490 -LINE Option "dac_8_bit" -LINE Option "no_wait_state" -LINE #Option "fifo_moderate" # 2x bus bw - may result in random pixels - -NAME Orchid Celsius (Sierra RAMDAC) -CHIPSET AGX-015 -SERVER AGX -DRIVER vga -UNSUPPORTED -RAMDAC sc15025 -LINE Option "dac_8_bit" -LINE Option "no_wait_state" -LINE #Option "fifo_moderate" # 2x bus bw - may result in random pixels - - -NAME Spider Black Widow -CHIPSET AGX-015 -SERVER AGX -DRIVER vga -UNSUPPORTED -RAMDAC sc15025 -LINE Option "dac_8_bit" -LINE Option "no_wait_state" -LINE #Option "fifo_moderate" # 2x bus bw - may result in random pixels - - -NAME Spider Black Widow Plus -CHIPSET AGX-016 -SERVER AGX -DRIVER vga -UNSUPPORTED -RAMDAC sc15025 -LINE Option "dac_8_bit" -LINE Option "no_wait_state" -LINE #Option "fifo_moderate" # 2x bus bw - may result in random pixels -LINE #Option "fifo_aggressive" # 3x bus bw - may result in random pixels -LINE #Probable clocks: -LINE #Clocks 25.2 28.3 39.9 72.2 50.0 76.9 36.1 44.8 -LINE #Clocks 89.0 119.8 79.9 31.5 110.0 64.9 74.9 94.9 - -NAME Hercules Graphite HG210 -CHIPSET AGX-014 -SERVER AGX -DRIVER vga -UNSUPPORTED -RAMDAC bt482 -DACSPEED 85 -LINE Chipset "AGX-014" -LINE Option "dac_8_bit" -LINE Option "no_wait_state" -LINE #Probable clocks: -LINE #Clocks 25.0 28.0 32.0 36.0 40.0 45.0 50.0 65.0 -LINE #Clocks 70.0 75.0 80.0 85.0 90.0 95.0 100.0 110.0 - -NAME Hercules Graphite Pro -CHIPSET AGX-015 -SERVER AGX -DRIVER vga -UNSUPPORTED -# Card specific DAC, doesn't appear in ramdac menu -LINE Ramdac "herc_dual_dac" -LINE Chipset "AGX-015" -LINE Option "dac_8_bit" -LINE Option "no_wait_state" -LINE #Option "fifo_moderate" # 2x bus bw - may result in random pixels -LINE #Probable clocks: -LINE #Clocks 25.0 28.0 32.0 36.0 40.0 45.0 50.0 65.0 -LINE #Clocks 70.0 75.0 80.0 85.0 90.0 95.0 100.0 110.0 - -NAME Hercules Graphite Power -CHIPSET AGX-016 -SERVER AGX -DRIVER vga -UNSUPPORTED -# Card specific DAC, doesn't appear in ramdac menu -# The glue logic state machine for RAMDAC switching doesn't work as -# documented, for now we're stuck with the small RAMDAC -LINE Ramdac "herc_small_dac" -LINE Chipset "AGX-016" -LINE Option "dac_8_bit" -LINE Option "no_wait_state" -LINE #Option "fifo_moderate" # 2x bus bw - may result in random pixels -LINE #Option "fifo_aggressive" # 3x bus bw - may result in random pixels -LINE #Probable clocks: -LINE #Clocks 25.0 28.0 32.0 36.0 40.0 45.0 50.0 65.0 -LINE #Clocks 70.0 75.0 80.0 85.0 90.0 95.0 100.0 110.0 - -NAME XGA-2 (ISA bus) -CHIPSET XGA-2 -SERVER AGX -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE -LINE #Instance 7 # XGA instance 0-7 -LINE #COPbase 0xC8F00 # XGA memory-mapped register address -LINE #POSbase 0 # Disable probing if above are specified - -NAME XGA-1 (ISA bus) -CHIPSET XGA-1 -SERVER AGX -DRIVER vga -UNSUPPORTED -LINE #Instance 7 # XGA instance 0-7 -LINE #COPbase 0xC8F00 # XGA memory-mapped register address -LINE #POSbase 0 # Disable probing if above are specified - -# WD - -NAME Paradise/WD 90CXX -CHIPSET WD90CXX -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME DFI-WG6000 -CHIPSET WD90C33 -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME Diamond SpeedStar 24X (not fully supported) -CHIPSET WD90C31 -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME WD 90C24 (laptop) -CHIPSET WD90C24 -SERVER SVGA -DRIVER vga -UNSUPPORTED -LINE #Chipset "wd90c24" -LINE #Option "noaccel" # Use this if acceleration is causing problems -LINE #Clocks 25.175 28.322 65 36 # These are not programmable -LINE #Clocks 29.979 77.408 62.195 59.957 # These are programmable -LINE #Clocks 31.5 35.501 75.166 50.114 # These are not programmable -LINE #Clocks 39.822 72.038 44.744 80.092 # These are programmable -LINE #Clocks 44.297 # Must match Mclk - - -NAME WD 90C24A or 90C24A2 (laptop) -CHIPSET WD90C24A -SERVER SVGA -DRIVER vga -UNSUPPORTED -LINE #Chipset "wd90c24" -LINE #Clocks 25.175 28.322 65 36 # These are not programmable -LINE #Clocks 29.979 77.408 62.195 59.957 # These are programmable -LINE #Clocks 31.5 35.501 75.166 50.114 # These are not programmable -LINE #Clocks 39.822 72.038 44.744 80.092 # These are programmable -LINE #Clocks 44.297 # Must match Mclk - -# Avance Logic - -NAME Avance Logic 2101 -CHIPSET Avance Logic -LINE #chipset "al2101" -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME Avance Logic 2228 -CHIPSET Avance Logic -LINE #chipset "ali2228" -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME Avance Logic 2301 -CHIPSET Avance Logic -LINE #chipset "ali2301" -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME Avance Logic 2302 -CHIPSET Avance Logic -LINE #chipset "ali2302" -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME Avance Logic 2308 -CHIPSET Avance Logic -LINE #chipset "ali2308" -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME Avance Logic 2401 -CHIPSET Avance Logic -LINE #chipset "ali2401" -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME Hercules Stingray -CHIPSET ALG-2228/2301/2302 -LINE #chipset "ali2228" -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME SPEA/V7 Mirage VEGA Plus -CHIPSET ALG-2228 -LINE #chipset "ali2228" -SERVER SVGA -DRIVER vga -UNSUPPORTED - -# ARK Logic - -NAME Ark Logic ARK1000PV (generic) -CHIPSET ARK1000PV -SERVER SVGA -DRIVER vga -UNSUPPORTED - -# For now, treat the VL as a PV. This may be changed later -NAME Ark Logic ARK1000VL (generic) -CHIPSET ARK1000VL -LINE Chipset "ark1000pv" -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME Ark Logic ARK2000PV (generic) -CHIPSET ARK1000PV -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME Ark Logic ARK2000MT (generic) -CHIPSET ARK1000MT -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME Hercules Stingray Pro -SEE Ark Logic ARK1000PV (generic) - -NAME Hercules Stingray Pro/V -SEE Ark Logic ARK1000PV (generic) - -NAME Ocean (octek) VL-VGA-1000 -RAMDAC att20c490 -SEE Ark Logic ARK1000VL (generic) - -NAME Hercules Stingray 64/V with ZoomDAC -SEE Ark Logic ARK2000PV (generic) - -NAME Hercules Stingray 64/V with ICS5342 -CHIPSET ARK2000MT -RAMDAC ics5342 -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME Diamond Stealth64 Graphics 2001 series -CHIPSET ARK2000PV -RAMDAC ics5342 -SERVER SVGA -DRIVER vga -UNSUPPORTED - -# Oak - -NAME Oak ISA Card (generic) -CHIPSET Oak OTI-067/77 -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME Oak 87 VLB (generic) -CHIPSET Oak OTI-087 -SERVER SVGA -DRIVER vga -UNSUPPORTED -LINE Option "fifo_aggressive" # Comment this if you experience streaks. -LINE Option "no_wait" # Comment this if you find problems. -LINE #Option "enable_bitblt" # You may enable this and see if it works (see README.Oak file) - -NAME Oak 87 ISA (generic) -CHIPSET Oak OTI-087 -SERVER SVGA -DRIVER vga -UNSUPPORTED -LINE Option "noaccel" # ISA cards seem to have Color Expansion support broken -LINE #Option "enable_bitblt" # This should work on ISA, but lets not make it default just in case. - -NAME Paradise Accelerator Value -SEE Oak 87 ISA (generic) - -# P9000 - -NAME Diamond Viper VLB 2Mb -CHIPSET Weitek 9000 -SERVER P9000 -DRIVER vga -UNSUPPORTED -LINE #Clocks must match the mode clocks (XFree86 3.1 P9000 server) -LINE #Versions later than 3.1 do not require a clocks line -LINE Chipset "vipervlb" # Required for some cards which autodetect as PCI -LINE Videoram 2048 # Required -LINE Membase 0x80000000 # Optional (0x80000000 is default) -NOCLOCKPROBE - -NAME Diamond Viper PCI 2Mb -CHIPSET Weitek 9000 -SERVER P9000 -DRIVER vga -UNSUPPORTED -LINE #Clocks must match the mode clocks (XFree86 3.1 P9000 server) -LINE #Versions later than 3.1 do not require a clocks line -LINE Videoram 2048 # Required -LINE #Membase 0x80000000 # Use scanpci to get the correct Membase -NOCLOCKPROBE - -NAME Orchid P9000 VLB -CHIPSET Weitek 9000 -SERVER P9000 -DRIVER vga -UNSUPPORTED -LINE Chipset "orchid_p9000" -LINE Membase 0xE0000000 -NOCLOCKPROBE - -# P9100 - -NAME Weitek P9100 (generic) -CHIPSET Weitek P9100 -SERVER SVGA -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE - -NAME Diamond Viper Pro Video -SEE Weitek P9100 (generic) - -# Trident - -NAME Trident 8900/9000 (generic) -CHIPSET TVGA8900/9000 -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME Trident 8900D (generic) -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME Trident TVGA9200CXr (generic) -CHIPSET TVGA9200CXr -SERVER SVGA -DRIVER vga -UNSUPPORTED - -NAME Trident TGUI9400CXi (generic) -CHIPSET TGUI9400CXi -SERVER SVGA -DRIVER trident - -NAME Trident TGUI9420DGi (generic) -CHIPSET TGUI9420DGi -SERVER SVGA -DRIVER trident - -NAME Trident TGUI9430DGi (generic) -CHIPSET TGUI9430DGi -SERVER SVGA -DRIVER trident - -NAME Trident TGUI9420 (generic) -CHIPSET TGUI9420 -DRIVER trident -NOCLOCKPROBE - -NAME Trident TGUI9440 (generic) -CHIPSET TGUI9440 -DRIVER trident -NOCLOCKPROBE - -NAME Trident TGUI9660 (generic) -CHIPSET TGUI9660 -DRIVER trident -NOCLOCKPROBE - -NAME Trident TGUI9680 (generic) -CHIPSET TGUI9680 -DRIVER trident -NOCLOCKPROBE - -NAME Trident TGUI9682 (generic) -CHIPSET TGUI9682 -SERVER SVGA -DRIVER trident -NOCLOCKPROBE - -NAME Trident TGUI9685 (generic) -CHIPSET TGUI9685 -SERVER SVGA -DRIVER trident -NOCLOCKPROBE - -NAME Trident Cyber 9320 (generic) -CHIPSET Cyber9320 -DRIVER trident -NOCLOCKPROBE - -NAME Trident Cyber 9382 (generic) -CHIPSET Cyber9382 -SERVER SVGA -DRIVER trident -NOCLOCKPROBE - -NAME Trident Cyber 9385 (generic) -CHIPSET Cyber9385 -SERVER SVGA -DRIVER trident -NOCLOCKPROBE - -NAME Trident Cyber 9388 (generic) -CHIPSET Cyber9388 -SERVER SVGA -DRIVER trident -NOCLOCKPROBE - -NAME Trident Cyber 939a (generic) -CHIPSET Cyber939a -DRIVER trident -NOCLOCKPROBE - -NAME Trident Cyber 9397 (generic) -CHIPSET Cyber9397 -SERVER SVGA -DRIVER trident -NOCLOCKPROBE - -NAME Trident Cyber 9520 (generic) -CHIPSET Cyber9520 -DRIVER trident -NOCLOCKPROBE - -NAME Trident 3DImage975 (generic) -CHIPSET 3dimage975 -SERVER SVGA -DRIVER trident -NOCLOCKPROBE - -NAME Trident 3DImage975 AGP (generic) -CHIPSET 3dimage975 -SERVER SVGA -DRIVER trident -NOCLOCKPROBE - -NAME Trident 3DImage985 (generic) -CHIPSET 3dimage985 -SERVER SVGA -DRIVER trident -NOCLOCKPROBE - -NAME Trident Providia 9682 (generic) -CHIPSET Providia9682 -DRIVER trident -NOCLOCKPROBE - -NAME Trident Providia 9685 (generic) -CHIPSET Providia9685 -DRIVER trident -NOCLOCKPROBE - -NAME Trident TVGA 8800BR -SEE * Generic VGA compatible - -NAME Trident TVGA 8800CS -SEE * Generic VGA compatible - -NAME Trident CyberBlade (generic) -CHIPSET CyberBlade -SERVER SVGA -DRIVER trident -NOCLOCKPROBE - -NAME Trident Blade3D (generic) -CHIPSET Blade3D -SERVER SVGA -DRIVER trident -NOCLOCKPROBE - -# SiS - -NAME SiS 530 -CHIPSET SIS530 -SERVER SVGA -DRIVER sis - -NAME SiS 620 -CHIPSET SIS620 -SERVER SVGA -DRIVER sis - -NAME SiS SG86C201 -CHIPSET SIS86C201 -SERVER SVGA -DRIVER sis - -NAME SiS SG86C205 -CHIPSET SIS86C205 -SERVER SVGA -DRIVER sis -LINE # Option "no_accel" # Use this if acceleration is causing problems -LINE # Option "fifo_moderate" -LINE # Option "fifo_conserv" -LINE # Option "fifo_aggressive" -NOCLOCKPROBE - -NAME SiS SG86C215 -CHIPSET SIS86C215 -SERVER SVGA -DRIVER sis -LINE # This is a cheap version of 86c205. I am not sure if acceleration works -LINE # Option "no_accel" # Use this if acceleration is causing problems -LINE # Option "no_BitBlt" # Use this if acceleration is causing problems -LINE # Option "fifo_moderate" -LINE # Option "fifo_conserv" -LINE # Option "fifo_aggressive" -NOCLOCKPROBE - -NAME SiS SG86C225 -CHIPSET SIS86C225 -SERVER SVGA -DRIVER sis -LINE # Option "no_accel" # Use this if acceleration is causing problems -LINE # Option "fifo_moderate" -LINE # Option "fifo_conserv" -LINE # Option "fifo_aggressive" -NOCLOCKPROBE - -NAME SiS 5597 -CHIPSET SiS5597 -SERVER SVGA -DRIVER sis -LINE # Option "no_accel" # Use this if acceleration is causing problems -LINE # Option "fifo_moderate" -LINE # Option "fifo_conserv" -LINE # Option "fifo_aggressive" -LINE # Option "fast_vram" -LINE # Option "pci_burst_on" -LINE # Option "xaa_benchmark" # DON'T use with "ext_eng_queue" !!! -LINE # Option "ext_eng_queue" # Turbo-queue. This can cause drawing -LINE # errors, but gives some accel -NOCLOCKPROBE - -NAME SiS 5598 -CHIPSET SIS5598 -SERVER SVGA -DRIVER sis -LINE # Option "no_accel" # Use this if acceleration is causing problems -LINE # Option "fifo_moderate" -LINE # Option "fifo_conserv" -LINE # Option "fifo_aggressive" -LINE # Option "fast_vram" -LINE # Option "pci_burst_on" -LINE # Option "xaa_benchmark" # DON'T use with "ext_eng_queue" !!! -LINE # Option "ext_eng_queue" # Turbo-queue. This can cause drawing -LINE # errors, but gives some accel -NOCLOCKPROBE - -NAME SiS 6326 -CHIPSET SiS6326 -SERVER SVGA -DRIVER sis -LINE # Option "no_accel" # Use this if acceleration is causing problems -LINE # Option "fifo_moderate" -LINE # Option "fifo_conserv" -LINE # Option "fifo_aggressive" -LINE # Option "fast_vram" -LINE # Option "pci_burst_on" -LINE # Option "xaa_benchmark" # DON'T use with "ext_eng_queue" !!! -LINE # Option "ext_eng_queue" # Turbo-queue. This can cause drawing -LINE # errors, but gives some accel -NOCLOCKPROBE - -NAME MSI MS-4417 -SEE SiS 6326 - -NAME SiS 3D PRO AGP -SEE SiS 6326 - -NAME Miro Crystal DVD -SEE SiS 6326 - -NAME PC-Chips M567 Mainboard -SEE SiS 5597 - -NAME Diamond SpeedStar A50 -SEE SiS 6326 - -# Cyrix - -NAME MediaGX -CHIPSET mediagx -SERVER SVGA -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE - -# Alliance ProMotion - -NAME Alliance ProMotion 6422 -CHIPSET AP6422 -SERVER SVGA -DRIVER vga -UNSUPPORTED - -# Number 9 I128 - -NAME Number Nine Imagine I-128 -CHIPSET I128 -SERVER I128 -DRIVER i128 -NOCLOCKPROBE - -NAME Number Nine Imagine I-128 Series 2 -CHIPSET I128 -SERVER I128 -DRIVER i128 -NOCLOCKPROBE - -NAME Number Nine Revolution 3D (T2R) -CHIPSET I128 -SERVER I128 -DRIVER i128 -NOCLOCKPROBE - -NAME Number Nine Imagine-128 Revolution IV (T2R4) -CHIPSET I128 -SERVER I128 -DRIVER i128 -NOCLOCKPROBE - -# Matrox - -NAME Matrox Millennium 2MB -CHIPSET mga2064w -SERVER SVGA -DRIVER mga -LINE VideoRam 2048 -NOCLOCKPROBE - -NAME Matrox Millennium 4MB -CHIPSET mga2064w -SERVER SVGA -DRIVER mga -LINE VideoRam 4096 -NOCLOCKPROBE - -NAME Matrox Millennium 8MB -CHIPSET mga2064w -SERVER SVGA -DRIVER mga -LINE VideoRam 8192 -NOCLOCKPROBE - -NAME Matrox Millennium II 4MB -CHIPSET mga2164w -SERVER SVGA -DRIVER mga -LINE VideoRam 4096 -NOCLOCKPROBE - -NAME Matrox Millennium II 8MB -CHIPSET mga2164w -SERVER SVGA -DRIVER mga -LINE VideoRam 8192 -NOCLOCKPROBE - -NAME Matrox Millennium II 16MB -CHIPSET mga2164w -SERVER SVGA -DRIVER mga -LINE VideoRam 16384 -NOCLOCKPROBE - -NAME Matrox Millennium G200 4MB -CHIPSET mgag200 -SERVER SVGA -DRIVER mga -LINE VideoRam 4096 -NOCLOCKPROBE - -NAME Matrox Millennium G200 8MB -CHIPSET mgag200 -SERVER SVGA -DRIVER mga -LINE VideoRam 8192 -NOCLOCKPROBE - -NAME Matrox Millennium G200 16MB -CHIPSET mgag200 -SERVER SVGA -DRIVER mga -LINE VideoRam 16384 -NOCLOCKPROBE - -NAME Matrox Millennium G200 SD 4MB -CHIPSET mgag200 -SERVER SVGA -DRIVER mga -LINE VideoRam 4096 -LINE # Option "mga_sdram" -NOCLOCKPROBE - -NAME Matrox Millennium G200 SD 8MB -CHIPSET mgag200 -SERVER SVGA -DRIVER mga -LINE VideoRam 8192 -LINE # Option "mga_sdram" -NOCLOCKPROBE - -NAME Matrox Millennium G200 SD 16MB -CHIPSET mgag200 -SERVER SVGA -DRIVER mga -LINE VideoRam 16384 -LINE # Option "mga_sdram" -NOCLOCKPROBE - -NAME Matrox Mystique -CHIPSET mga1064sg -SERVER SVGA -DRIVER mga -NOCLOCKPROBE - -NAME Matrox Mystique G200 4MB -CHIPSET mgag200 -SERVER SVGA -DRIVER mga -LINE VideoRam 4096 -NOCLOCKPROBE - -NAME Matrox Mystique G200 8MB -CHIPSET mgag200 -SERVER SVGA -DRIVER mga -LINE VideoRam 8192 -NOCLOCKPROBE - -NAME Matrox Millennium G400 -CHIPSET mgag400 -SERVER SVGA -DRIVER mga -NOCLOCKPROBE - -NAME Matrox Mystique G200 16MB -CHIPSET mgag200 -SERVER SVGA -DRIVER mga -LINE VideoRam 16384 -NOCLOCKPROBE - -NAME Matrox Productiva G100 4MB -CHIPSET mgag100 -SERVER SVGA -DRIVER mga -LINE VideoRam 4096 -NOCLOCKPROBE - -NAME Matrox Productiva G100 8MB -CHIPSET mgag100 -SERVER SVGA -DRIVER mga -LINE VideoRam 8192 -NOCLOCKPROBE - -# NVIDIA - -NAME Diamond Edge 3D -CHIPSET nv1 -SERVER SVGA -DRIVER vga -UNSUPPORTED -NOCLOCKPROBE - -NAME RIVA128 -CHIPSET RIVA128 -SERVER SVGA -DRIVER nv -NOCLOCKPROBE - -NAME RIVA TNT -CHIPSET RIVATNT -SERVER SVGA -DRIVER nv -NOCLOCKPROBE - -NAME RIVA TNT2 -CHIPSET RIVATNT2 -SERVER SVGA -DRIVER nv -NOCLOCKPROBE - -NAME NVIDIA GeForce -CHIPSET GeForce -SERVER SVGA -DRIVER nv -NOCLOCKPROBE - -NAME ELSA VICTORY ERAZOR -SEE RIVA128 - -NAME ELSA Winner 1000 R3D -SEE RIVA128 - -NAME ELSA ERAZOR II -SEE RIVA TNT - -NAME Diamond Viper 330 -SEE RIVA128 - -NAME Diamond Viper 550 -SEE RIVA TNT - -NAME Diamond Viper 770 -SEE RIVA TNT2 - -NAME STB Velocity 128 -SEE RIVA128 - -NAME STB nvidia 128 -SEE RIVA128 - -NAME STB Velocity 4400 -SEE RIVA TNT - -NAME ASUS 3Dexplorer -SEE RIVA128 - -NAME Guillemot Maxi Gamer Xentor -SEE RIVA TNT2 - -NAME Guillemot Maxi Gamer Xentor 32 -SEE RIVA TNT2 - -NAME Creative Graphics Blaster TNT -SEE RIVA TNT - -NAME Creative Graphics Blaster TNT2 -SEE RIVA TNT2 - -# 3Dfx -NAME Voodoo Banshee (generic) -SERVER SVGA -CHIPSET 3dfx Banshee -DRIVER tdfx - -NAME Voodoo3 (generic) -SERVER SVGA -CHIPSET 3dfx Voodoo3 -DRIVER tdfx - -NAME Elsa Victory II -SEE Voodoo Banshee (generic) - -NAME Diamond Monster Fusion -SEE Voodoo Banshee (generic) - -NAME AOpen PA2010 -SEE Voodoo Banshee (generic) - -NAME Chaintech Desperado 3F10 -SEE Voodoo Banshee (generic) - -# 3DLabs - -NAME ELSA GLoria-L/MX -CHIPSET GLINT MX -SERVER 3DLabs -DRIVER glint -LINE #Option "no_accel" -NOCLOCKPROBE - -NAME ELSA GLoria-L -CHIPSET GLINT 500TX -SERVER 3DLabs -DRIVER glint -NOCLOCKPROBE - -NAME ELSA GLoria-XL -CHIPSET GLINT MX -SERVER 3DLabs -DRIVER glint -NOCLOCKPROBE - -NAME Diamond Fire GL 3000 -CHIPSET GLINT 500TX -SERVER 3DLabs -DRIVER glint -LINE Option "firegl_3000" -NOCLOCKPROBE - -NAME ELSA GLoria-S -CHIPSET PERMEDIA -SERVER 3DLabs -DRIVER glint -LINE #Option "no_accel" -LINE #VideoRam 8192 -NOCLOCKPROBE - -NAME Diamond Fire GL 1000 -CHIPSET PERMEDIA -SERVER 3DLabs -DRIVER glint -LINE #Option "no_accel" -LINE #VideoRam 8192 -NOCLOCKPROBE - -NAME ELSA GLoria Synergy -CHIPSET PERMEDIA 2 -SERVER 3DLabs -DRIVER glint -LINE #Option "no_accel" -NOCLOCKPROBE - -NAME ELSA Winner 2000/Office -CHIPSET PERMEDIA 2 -SERVER 3DLabs -DRIVER glint -LINE #Option "no_accel" -NOCLOCKPROBE - -NAME Diamond Fire GL 1000 PRO -CHIPSET PERMEDIA 2 -SERVER 3DLabs -DRIVER glint -LINE #Option "no_accel" -NOCLOCKPROBE - -NAME Creative Blaster Exxtreme -CHIPSET PERMEDIA 2 -SERVER 3DLabs -DRIVER glint -LINE #Option "no_accel" -NOCLOCKPROBE - -NAME AccelStar Permedia II AGP -CHIPSET PERMEDIA 2 -SERVER 3DLabs -DRIVER glint -LINE #Option "no_accel" -NOCLOCKPROBE - -NAME Leadtek WinFast 2300 -CHIPSET PERMEDIA 2 -SERVER 3DLabs -DRIVER glint -NOCLOCKPROBE - -NAME 3DLabs Oxygen GMX -CHIPSET PERMEDIA 2 -SERVER 3DLabs -DRIVER glint -LINE #Option "no_accel" -NOCLOCKPROBE - -NAME Appian Jeronimo 2000 -CHIPSET PERMEDIA 3 -SERVER 3DLabs -DRIVER glint -NOCLOCKPROBE - -# Alliance Semiconductor - -NAME Diamond Stealth Video 2500 -CHIPSET Alliance AT24 -SERVER SVGA -DRIVER apm -NOCLOCKPROBE - -NAME AT3D -CHIPSET Alliance AT3D -SERVER SVGA -DRIVER apm -NOCLOCKPROBE -LINE #Option "no_accel" - -NAME AT25 -SEE AT3D - -NAME Hercules Stingray 128 3D -SEE AT3D - -# NeoMagic - -NAME NeoMagic (laptop/notebook) -CHIPSET MagicGraph 128 series -SERVER SVGA -DRIVER neomagic -LINE # Chipset "NM2160" -LINE # IOBase 0xfea00000 -LINE # MemBase 0xfd000000 -LINE # VideoRam 2048 -LINE # DacSpeed 90 -LINE # Option "linear" -LINE # Option "nolinear" -LINE # Option "sw_cursor" -LINE # Option "hw_cursor" -LINE # Option "no_accel" -LINE # Option "intern_disp" -LINE # Option "extern_disp" -LINE # Option "mmio" -LINE # Option "no_mmio" -LINE # Option "lcd_center" -LINE # Option "no_stretch" - -# Epson SPC8110 - -NAME EPSON SPC8110 (CardPC) -CHIPSET SPC8110 -SERVER SVGA -DRIVER vga -UNSUPPORTED -LINE # Chipset "spc8110" -LINE # MemBase 0x03e00000 -LINE # VideoRam 1024 -LINE # Option "nolinear" -LINE # Option "sw_cursor" -LINE # Option "noaccel" -LINE # Option "fifo_moderate" -LINE # Option "fifo_conservative" - -# Silicon Motion, Inc. - -NAME Silicon Motion Lynx family -CHIPSET Lynx -SERVER SVGA -DRIVER siliconmotion -NOCLOCKPROBE - -# Rendition - -NAME Rendition Verite 1000 -CHIPSET Verite 1000 -SERVER SVGA -DRIVER vga -UNSUPPORTED -LINE # Option "sw_cursor" - -NAME Rendition Verite 2x00 -CHIPSET Verite 2x00 -SERVER SVGA -DRIVER vga -UNSUPPORTED -LINE # Option "sw_cursor" - -NAME Creative Labs 3D Blaster PCI (Verite 1000) -SEE Rendition Verite 1000 - -NAME Canopus Total-3D -SEE Rendition Verite 1000 - -NAME Sierra Screaming 3D -SEE Rendition Verite 1000 - -NAME Miro CRYSTAL VRX -SEE Rendition Verite 1000 - -NAME Diamond Stealth II S220 -CHIPSET Verite 2100 -SEE Rendition Verite 2x00 - -NAME Hercules Thriller3D -CHIPSET Verite 2200 -SEE Rendition Verite 2x00 - -# Digital - -NAME Digital 8-plane TGA (UDB/Multia) -CHIPSET TGA -SERVER TGA -DRIVER tga -RAMDAC Bt485 - -NAME Digital 8-plane TGA (ZLXp-E1) -CHIPSET TGA -SERVER TGA -DRIVER tga -RAMDAC Bt485 - -NAME Digital 24-plane TGA (ZLXp-E2) -CHIPSET TGA -SERVER TGA -DRIVER tga -RAMDAC Bt463 - -NAME Digital 24-plane+3D TGA (ZLXp-E3) -CHIPSET TGA -SERVER TGA -DRIVER tga -RAMDAC Bt463 - -# i810 - -NAME Intel 810 -SERVER SVGA -DRIVER i810 - -# i740 - -NAME Intel 740 (generic) -SERVER SVGA -DRIVER i740 - -# Misc - -END diff --git a/hw/xfree86/utils/xorgconfig/Cards98 b/hw/xfree86/utils/xorgconfig/Cards98 deleted file mode 100644 index ef14a0345..000000000 --- a/hw/xfree86/utils/xorgconfig/Cards98 +++ /dev/null @@ -1,647 +0,0 @@ -# $XFree86: xc/programs/Xserver/hw/xfree98/xf86config/Cards98,v 1.7 1998/06/04 16:43:45 hohndel Exp $ -# -# -# -# $XConsortium: Cards /main/27 1996/10/28 05:43:53 kaleb $ -# This is the database of card definitions used by xf86config. -# Each definition should have a NAME entry, CHIPSET (descriptive) and -# SERVER (one of EGC, GANBWAP, PEGC, NKVNEC, WABS, WABEP, WSNA, TGUI, -# MGA, SVGA, NECS3, PWSKB, PWLB, GA968). -# A reference to another definition is made with SEE (already defined -# entries are not overridden). -# Optional entries are RAMDAC (identifier), CLOCKCHIP (identifier), -# DACSPEED, NOCLOCKPROBE (advises never to probe clocks), UNSUPPORTED -# (indicates card that is not yet properly supported by a dedicated -# server). A LINE entry adds a line of text to be included in the -# Device section (can include options or comments). -# There's no CLOCKS option (although a Clocks line can be included -# with LINE), as it is very undesirable to have a Clocks line that -# is incorrect. The idea is that the Clocks are probed for to be -# sure (a commented suggested Clocks line can be included). -# -# The majority of entries are just a binding of a model name to a -# chipset/server and untested. -# - -# EGC - -NAME EGC16 -CHIPSET EGC -SERVER EGC -LINE Chipset "vga" - -# PEGC - -NAME PEGC -CHIPSET PEGC -SERVER PEGC -LINE VideoRam 512 -LINE Clocks 31.5 -LINE # Virtual resolution for 640x400 -LINE # Clocks 28.322 - -# GANBWAP - -NAME GA-98NBI -CHIPSET CL-GD5434 -SERVER GANBWAP -LINE ClockChip "cirrus" -LINE Option "ga98nb1" -LINE Option "no_mmio" -LINE # Option "sw_cursor" - -NAME GA-98NBII -CHIPSET CL-GD5434 -SERVER GANBWAP -LINE ClockChip "cirrus" -LINE Option "ga98nb2" -LINE Option "no_mmio" -LINE # Option "sw_cursor" - -NAME GA-98NBIV -CHIPSET CL-GD5434 -SERVER GANBWAP -LINE ClockChip "cirrus" -LINE Option "ga98nb4" -LINE Option "no_mmio" -LINE # Option "sw_cursor" - -NAME WAP-2000/4000 -CHIPSET CL-GD5434 -SERVER GANBWAP -LINE Option "wap" -LINE Option "no_mmio" -LINE # Option "epsonmemwin" - -# NKVNEC - -NAME PCNKV/PCNKV2/NEC_CIRRUS -CHIPSET CL-GD5428/5429/5430 -SERVER NKVNEC -LINE # Option "fast_dram" -LINE VideoRam 1024 - -NAME PC9821Bf/U8W -LINE Option "nec_cirrus" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Bp/U8W/U7W -LINE Option "nec_cirrus" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Bs/U7W -LINE Option "nec_cirrus" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Be/U7W -LINE Option "nec_cirrus" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821BA3/U2/W -LINE Option "nec_cirrus" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821BX3/U2/W -LINE Option "nec_cirrus" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821BX4/U2 -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Cb -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Ce -LINE Option "nec_cirrus" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Cf -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Ce2 -LINE Option "nec_cirrus" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Cs -LINE Option "nec_cirrus" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Cs2 -LINE Option "nec_cirrus" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Cx -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Cx2 -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Es -LINE Option "nec_cirrus" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Nd -LINE Option "nec_cirrus" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Ne2 -LINE Option "nec_cirrus" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Nf -LINE Option "nec_cirrus" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Np -LINE Option "nec_cirrus" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Ns -LINE Option "nec_cirrus" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821V7/C -LINE Chipset "clgd5430" -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821V10/C,S -LINE Chipset "clgd5430" -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821V12/S -LINE Chipset "clgd5430" -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821V13/S -LINE Chipset "clgd5430" -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821V16/S -LINE Chipset "clgd5430" -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821V16/S5V,P -LINE Chipset "clgd5446" -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821V20/S7 -LINE Chipset "clgd5430" -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Xb10 -LINE Chipset "clgd5430" -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Xc13/S5 -LINE Chipset "clgd5446" -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Xc16/M,S -LINE Chipset "clgd5446" -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Xc200/M,S -LINE Chipset "clgd5446" -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Xa7e -LINE Chipset "clgd5430" -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Xe -LINE Chipset "clgd5430" -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC9821Xe10 -LINE Chipset "clgd5430" -LINE Option "nec_cirrus" -LINE Option "no_mmio" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC486MR -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC486MS -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC486MU -LINE Chipset "clgd5429" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC486MV -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC586MV -SEE PCNKV/PCNKV2/NEC_CIRRUS - -NAME PC586RV -LINE Chipset "clgd5429" -SEE PCNKV/PCNKV2/NEC_CIRRUS - -# WABS - -NAME WAB-S -CHIPSET CL-GD5426/5428 -SERVER WABS -LINE VideoRam 1024 -LINE # VideoRam 2048 - -NAME WAB-1000/2000 -CHIPSET CL-GD5428 -SERVER WABS -LINE VideoRam 1024 -LINE # VideoRam 2048 - -NAME WSR-E/G -SEE WAB-1000/2000 - -# WABEP - -NAME WAB-EP -CHIPSET CL-GD5428 -SERVER WABEP -LINE Option "med_dram" - -# WSNA - -NAME WSN-A2F -CHIPSET CL-GD5434 -SERVER WSNA -LINE Option "no_mmio" -LINE Option "med_dram" - -# TGUI - -NAME NEC Trident -CHIPSET TGUI9680/9682 -SERVER TGUI -LINE Option "xaa_no_color_exp" -LINE # Option "noaccel" -LINE # Option "Linear" -LINE # Option "med_dram" -LINE # Option "hw_cursor" - -NAME PC9821Ra20/N -SEE NEC Trident - -NAME PC9821RaII23/N,W -SEE NEC Trident - -NAME PC9821Ra266/N,W -SEE NEC Trident - -NAME PC9821Rs20/B20 -SEE NEC Trident - -NAME PC9821RsII26/B40 -SEE NEC Trident - -NAME PC9821V13/M7 -SEE NEC Trident - -NAME PC9821V16/M7 -SEE NEC Trident - -NAME PC9821V20/M7 -SEE NEC Trident - -NAME PC9821Xa7/C,K -SEE NEC Trident - -NAME PC9821Xa9/C,K -SEE NEC Trident - -NAME PC9821Xa10/C,K -SEE NEC Trident - -NAME PC9821Xa12/C,K -SEE NEC Trident - -NAME PC9821Xa13/C,K,W -SEE NEC Trident - -NAME PC9821Xa16/R,W -SEE NEC Trident - -NAME PC9821Xa20/W -SEE NEC Trident - -NAME PC9821Xc13/M,S -SEE NEC Trident - -NAME PC9821Xv13/R -SEE NEC Trident - -NAME GA-DRV/98 -CHIPSET TGUI9680 -SERVER TGUI -LINE Option "noaccel" -LINE # Option "med_dram" -LINE # Option "hw_cursor" - -# MGA - -NAME MGA Millennium -CHIPSET MGA2064W -SERVER MGA - -NAME PC9821Xt13 -SEE MGA Millennium - -NAME PC9821Xt16 -SEE MGA Millennium - -NAME PC9821Xv13/W -SEE MGA Millennium - -NAME PC9821Xv20/W -SEE MGA Millennium - -NAME PC9821St15 -SEE MGA Millennium - -NAME PC9821St20 -SEE MGA Millennium - -NAME PC9821RvII26/N20 -SEE MGA Millennium - -NAME NEC FC-WAB-X2 -SEE MGA Millennium - -NAME MGA Mystique -CHIPSET MGA1064SG -SERVER MGA - -NAME PC9821V166/S -LINE VideoRam 2048 -SEE MGA Mystique - -NAME PC9821V200/S -LINE VideoRam 2048 -SEE MGA Mystique - -NAME PC9821V200/M -LINE VideoRam 4096 -SEE MGA Mystique - -NAME PC9821V233/M7 -LINE VideoRam 2048 -SEE MGA Mystique - -NAME PC9821V233/M7V -LINE VideoRam 4096 -SEE MGA Mystique - -# SVGA - -NAME NEC Cirrus 755x -CHIPSET CL-GD7555 -LINE Chipset "clgd7555" -LINE # VideoRam 2048 -LINE # Option "no_bitblt" -LINE # Option "fast_dram" -LINE Option "linear" -LINE Option "noaccel" -SERVER SVGA - -NAME PC9821Nr12 -SEE NEC Cirrus 755x - -NAME PC9821Nr13 -SEE NEC Cirrus 755x - -NAME PC9821La13 -SEE NEC Cirrus 755x - -NAME PC9821Ls12 -SEE NEC Cirrus 755x - -NAME PC9821Ls13 -SEE NEC Cirrus 755x - -NAME PC9821Ls150 -SEE NEC Cirrus 755x - -# NECS3 - -NAME NEC WAB-A/B -CHIPSET S3 928 -SERVER NECS3 -LINE Chipset "s3_generic" -LINE Dacspeed 110 -LINE Ramdac "sc15025" -LINE Option "dac_8_bit" -LINE # Option "necwab" -LINE # Option "nomemaccess" -LINE Clocks 25.0 28.0 40.0 0.0 50.0 77.0 36.0 45.0 -LINE Clocks 130.0 120.0 80.0 31.0 110.0 65.0 75.0 94.0 - -NAME NEC FC-WAB-A/B -CHIPSET S3 928 -SERVER NECS3 -LINE Chipset "s3_generic" -LINE Dacspeed 110 -LINE Ramdac "bt485" -LINE Option "necwab" -LINE Option "nomemaccess" -LINE Option "noinit" -LINE Option "nolinear" -LINE Clocks 25.0 28.0 40.0 0.0 50.0 77.0 36.0 45.0 -LINE Clocks 130.0 120.0 80.0 31.0 110.0 65.0 75.0 94.0 - -NAME PC9821Af/U9W E09? -SEE NEC WAB-A/B - -NAME PC9821An/U8W -SEE NEC WAB-A/B - -NAME PC9821Ap2/U8W/C9W -SEE NEC WAB-A/B - -NAME PC9821As2/U7W/U8W -SEE NEC WAB-A/B - -NAME NEC 864 -CHIPSET S3 864 -SERVER NECS3 -LINE Chipset "s3_generic" -LINE Option "necwab" -LINE Ramdac "s3_sdac" -LINE ClockChip "s3_sdac" - -NAME PC9821Ap3 -SEE NEC 864 - -NAME PC9821As3 -SEE NEC 864 - -NAME PC9821Xp -SEE NEC 864 - -NAME PC9821Xs -SEE NEC 864 - -# PWSKB - -NAME PowerWindow 928/801 -CHIPSET S3 928 -SERVER PWSKB -LINE Chipset "s3_generic" -LINE # Chipset "mmio_928" -LINE Ramdac "sc15025" -LINE Dacspeed 110 -LINE Option "dac_8_bit" -LINE # Option "epsonmemwin" -LINE # Option "nomemaccess" -LINE ClockChip "icd2061a" - -NAME PowerWindow 928II -CHIPSET S3 928 -SERVER PWSKB -LINE Chipset "s3_generic" -LINE # Chipset "mmio_928" -LINE Ramdac "att20c505" -LINE # Ramdac "bt485" -LINE Dacspeed 110 -LINE Option "dac_8_bit" -LINE # Option "pw_mux" -LINE Option "bt485_curs" -LINE # Option "epsonmemwin" -LINE # Option "nomemaccess" -LINE ClockChip "icd2061a" - -NAME PowerWindow 805i -CHIPSET S3 805 -SERVER PWSKB -LINE Chipset "s3_generic" -LINE Ramdac "s3gendac" -LINE Dacspeed 110 -LINE Option "dac_8_bit" -LINE # Option "pw805i" -LINE # Option "epsonmemwin" -LINE # Option "nomemaccess" -LINE ClockChip "s3_sdac" - -NAME PowerWindow 928G -CHIPSET S3 928 -SERVER PWSKB -LINE Chipset "s3_generic" -LINE # Chipset "mmio_928" -LINE Ramdac "sc15025" -LINE Dacspeed 110 -LINE Option "dac_8_bit" -LINE # Option "nomemaccess" -LINE # Option "nolinear" -LINE ClockChip "icd2061a" - -NAME PCSKB/PCSKB2 -CHIPSET S3 911/924 -SERVER PWSKB -LINE Chipset "s3_generic" -LINE Ramdac "sc15025" -LINE Dacspeed 110 -LINE Option "dac_8_bit" -LINE # Option "nomemaccess" -LINE Option "pcskb" -LINE Clocks 25.0 28.0 40.0 0.0 50.0 77.0 36.0 45.0 -LINE Clocks 130.0 120.0 80.0 31.0 110.0 65.0 75.0 94.0 - -NAME PCSKB3/PCSKB4/PCPKB4 -CHIPSET S3 928 -SERVER PWSKB -LINE Chipset "s3_generic" -LINE Ramdac "sc15025" -LINE # Ramdac "att20c498" -LINE Dacspeed 110 -LINE Option "dac_8_bit" -LINE Option "nomemaccess" -LINE Option "pcskb4" -LINE Clocks 25.0 28.0 40.0 0.0 50.0 77.0 36.0 45.0 -LINE Clocks 130.0 120.0 80.0 31.0 110.0 65.0 75.0 94.0 - -# PWLB - -NAME PowerWindow 928GLB -CHIPSET S3 928 -SERVER PWLB -LINE Chipset "s3_generic" -LINE # Chipset "mmio_928" -LINE Ramdac "sc15025" -LINE Dacspeed 110 -LINE Option "dac_8_bit" -LINE # Option "pw_localbus" -LINE # Option "nomemaccess" -LINE # Option "nolinear" -LINE ClockChip "icd2061a" - -NAME PowerWindow 928IILB -CHIPSET S3 928 -SERVER PWLB -LINE Chipset "s3_generic" -LINE # Chipset "mmio_928" -LINE Ramdac "att20c505" -LINE # Ramdac "bt485" -LINE Dacspeed 110 -LINE Option "dac_8_bit" -LINE Option "bt485_curs" -LINE Option "pw_localbus" -LINE # Option "pw_mux" -LINE # Option "nomemaccess" -LINE # Option "nolinear" -LINE ClockChip "icd2061a" - -NAME PowerWindow 964LB -CHIPSET S3 964 -SERVER PWLB -LINE Chipset "s3_generic" -LINE Option "pw_localbus" -LINE Option "number_nine" -LINE Ramdac "ti3025" -LINE ClockChip "ti3025" -LINE VideoRam 4096 - -# GA968 - -NAME GA-968V4/PCI -CHIPSET S3 968 -SERVER GA968 -LINE Chipset "s3_generic" -LINE # Chipset "mmio_928" -LINE VideoRam 4096 diff --git a/hw/xfree86/utils/xorgconfig/Makefile.am b/hw/xfree86/utils/xorgconfig/Makefile.am deleted file mode 100644 index dabfc3214..000000000 --- a/hw/xfree86/utils/xorgconfig/Makefile.am +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, and/or sell copies of the Software, and to permit persons -# to whom the Software is furnished to do so, provided that the above -# copyright notice(s) and this permission notice appear in all copies of -# the Software and that both the above copyright notice(s) and this -# permission notice appear in supporting documentation. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL -# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING -# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, -# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION -# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -# Except as contained in this notice, the name of a copyright holder -# shall not be used in advertising or otherwise to promote the sale, use -# or other dealings in this Software without prior written authorization -# of the copyright holder. -# - -bin_PROGRAMS = xorgconfig - -X11dir = $(libdir)/X11 -dist_X11_DATA = Cards - -xorgconfig_CFLAGS = @XORGCONFIG_DEP_CFLAGS@ \ - -DCARD_DATABASE_FILE='"$(X11dir)/Cards"' \ - -DPROJECTROOT='"$(PROJECTROOT)"' \ - -DFILEMANSUFFIX='"$(FILE_MAN_SUFFIX)"' \ - -DXVERSIONSTRING='"$(PACKAGE_STRING)"' - -xorgconfig_LDADD = @XORGCONFIG_DEP_LIBS@ - -xorgconfig_SOURCES = \ - cards.c \ - cards.h \ - xorgconfig.c - -# Man page -include $(top_srcdir)/cpprules.in - -appmandir = $(APP_MAN_DIR) - -appman_PRE = xorgconfig.man -appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) - -EXTRAMANDEFS = \ - -D__XCONFIGFILE__=$(__XCONFIGFILE__) \ - -D__XSERVERNAME__=$(XSERVERNAME) - -BUILT_SOURCES = $(appman_PRE) -CLEANFILES = $(appman_PRE) $(appman_DATA) - -SUFFIXES += .$(APP_MAN_SUFFIX) .man - -.man.$(APP_MAN_SUFFIX): - -rm -f $@ - $(LN_S) $< $@ - -EXTRA_DIST = \ - Cards98 \ - xorgconfig.man.pre diff --git a/hw/xfree86/utils/xorgconfig/cards.c b/hw/xfree86/utils/xorgconfig/cards.c deleted file mode 100644 index 8116f0a03..000000000 --- a/hw/xfree86/utils/xorgconfig/cards.c +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Functions to manipulate card database. - */ - -#include -#include -#include - -#include "cards.h" - -/* Some vars to make path names in texts more flexible. */ -#ifndef PROJECTROOT -# define PROJECTROOT "/usr" -#endif -#define TREEROOT PROJECTROOT -#define TREEROOTLX TREEROOT "/lib/X11" -#define TREEROOTCFG TREEROOT "/etc/X11" -#ifdef XDOCDIR -# define TREEROOTDOC XDOCDIR -#else -# define TREEROOTDOC TREEROOTLX "/doc" -#endif - -/* - * Database format: - * - * NAME - * CHIPSET - * SERVER - * DRIVER - * - * Optional keywords: - * RAMDAC - * CLOCKCHIP - * DACSPEED - * NOCLOCKPROBE - * UNSUPPORTED - * - * SEE refers to another card definition; parameters that - * are already defined are not overridden. - * - * is one of Mono, VGA16, SVGA, S3, Mach32, Mach8, 8514, - * P9000, AGX, W32. - * - * A useful additional keywords may be CLOCKS. - */ - - - -/* Database vars. */ - -int lastcard; - -Card card[MAX_CARDS]; - - -static int -getnextline(FILE *f, char *l) -{ - if (fgets(l, 128, f) == NULL) - return -1; - return 0; -} - -static void -appendstring(char **destp, char *src) -{ - char *newstr; - newstr = malloc(strlen(*destp) + strlen(src) + 1); - strcpy(newstr, *destp); - strcat(newstr, src); - if (strlen(*destp) > 0) - free(*destp); - *destp = newstr; -} - -int -lookupcard(char *name) { - int i; - for (i = 0; i <= lastcard; i++) - if (strcmp(name, card[i].name) == 0) - return i; - return -1; -} - -static char *s3_comment = -"# Use Option \"nolinear\" if the server doesn't start up correctly\n" -"# (this avoids the linear framebuffer probe). If that fails try\n" -"# option \"nomemaccess\".\n" -"#\n" -"# Refer to " TREEROOTDOC "/README.S3, and the XF86_S3 man page.\n"; - -static char *cirrus_comment = -"# Use Option \"no_bitblt\" if you have graphics problems. If that fails\n" -"# try Option \"noaccel\".\n" -"# Refer to " TREEROOTDOC "/README.cirrus.\n" -"# To allow linear addressing, uncomment the Option line and the\n" -"# address that the card maps the framebuffer to.\n"; - -int parse_database() { - FILE *f; - char buf[128]; - int i, lineno; - char filename[128]; - - strcpy(filename, CARD_DATABASE_FILE); - f = fopen(filename, "r"); - if (f == NULL) - return -1; - - lastcard = -1; - lineno = 0; - - for (;;) { - if (getnextline(f, buf)) - break; - lineno++; - if (buf[0] == '#') - /* Comment. */ - continue; - if (strncmp(buf, "END", 3) == 0) - /* End of database. */ - break; - if (strncmp(buf, "LINE", 4) == 0 && lastcard>=0) { - /* Line of Device comment. */ - /* Append to existing lines. */ - appendstring(&card[lastcard].lines, buf + 5); - continue; - } - /* - * The following keywords require the trailing newline - * to be deleted. - */ - i = strlen(buf); - buf[--i] = '\0'; - - /* remove trailing spaces or tabs */ - for(--i; i>=0 && (buf[i] == ' ' || buf[i] == '\011'); i--) ; - if (i>=0) - buf[i+1] = '\0'; - else - continue; /* skip empty lines */ - - if (strncmp(buf, "NAME", 4) == 0) { - /* New entry. */ - lastcard++; - card[lastcard].name = malloc(strlen(buf + 5) + 1); - strcpy(card[lastcard].name, buf + 5); - card[lastcard].chipset = NULL; - card[lastcard].server = NULL; - card[lastcard].driver = NULL; - card[lastcard].ramdac = NULL; - card[lastcard].clockchip = NULL; - card[lastcard].dacspeed = NULL; - card[lastcard].flags = 0; - card[lastcard].lines = ""; - continue; - } - if (lastcard < 0) /* no NAME line found yet */ - continue; - if (strncmp(buf, "SEE", 3) == 0) { - /* Reference to another entry. */ - int i; - i = lookupcard(buf + 4); - if (i == -1) { - printf("Error in database, invalid reference: %s.\n", - buf + 4); - free(card[lastcard].name); - lastcard--; - continue; - } - if (card[lastcard].chipset == NULL) - card[lastcard].chipset = card[i].chipset; - if (card[lastcard].server == NULL) - card[lastcard].server = card[i].server; - if (card[lastcard].driver == NULL) - card[lastcard].driver = card[i].driver; - if (card[lastcard].ramdac == NULL) - card[lastcard].ramdac = card[i].ramdac; - if (card[lastcard].clockchip == NULL) - card[lastcard].clockchip = card[i].clockchip; - if (card[lastcard].dacspeed == NULL) - card[lastcard].dacspeed = card[i].dacspeed; - card[lastcard].flags |= card[i].flags; - appendstring(&card[lastcard].lines, card[i].lines); - continue; - } - if (strncmp(buf, "CHIPSET", 7) == 0) { - /* Chipset description. */ - card[lastcard].chipset = malloc(strlen(buf + 8) + 1); - strcpy(card[lastcard].chipset, buf + 8); - continue; - } - if (strncmp(buf, "SERVER", 6) == 0) { - /* Server identifier. */ - card[lastcard].server = malloc(strlen(buf + 7) + 1); - strcpy(card[lastcard].server, buf + 7); - continue; - } - if (strncmp(buf, "DRIVER", 6) == 0) { - /* Driver identifier. */ - card[lastcard].driver = malloc(strlen(buf + 7) + 1); - strcpy(card[lastcard].driver, buf + 7); - continue; - } - if (strncmp(buf, "RAMDAC", 6) == 0) { - /* Ramdac indentifier. */ - card[lastcard].ramdac = malloc(strlen(buf + 7) + 1); - strcpy(card[lastcard].ramdac, buf + 7); - continue; - } - if (strncmp(buf, "CLOCKCHIP", 9) == 0) { - /* Clockchip indentifier. */ - card[lastcard].clockchip = malloc(strlen(buf + 10) + 1); - strcpy(card[lastcard].clockchip, buf + 10); - card[lastcard].flags |= NOCLOCKPROBE; - continue; - } - if (strncmp(buf, "DACSPEED", 8) == 0) { - /* Clockchip indentifier. */ - card[lastcard].dacspeed = malloc(strlen(buf + 9) + 1); - strcpy(card[lastcard].dacspeed, buf + 9); - continue; - } - if (strncmp(buf, "NOCLOCKPROBE", 12) == 0) { - card[lastcard].flags |= NOCLOCKPROBE; - continue; - } - if (strncmp(buf, "UNSUPPORTED", 12) == 0) { - card[lastcard].flags |= UNSUPPORTED; - continue; - } - /* test for missing required fields */ - if (card[lastcard].driver == NULL) { - fprintf(stderr, "Warning DRIVER specification missing " - "in Card database entry %s (line %d).\n", - card[lastcard].name, lineno); - keypress(); - card[lastcard].driver = "unknown"; - } - if (card[lastcard].chipset == NULL) { - fprintf(stderr, "Warning CHIPSET specification missing " - "in Card database entry %s (line %d).\n", - card[lastcard].name, lineno); - keypress(); - card[lastcard].chipset = "unknown"; - } - } - - fclose(f); - - /* - * Add general comments. - */ - for (i = 0; i <= lastcard; i++) { - if (card[i].server && strcmp(card[i].server, "S3") == 0) - appendstring(&card[i].lines, s3_comment); - if (card[i].chipset && - strncmp(card[i].chipset, "CL-GD", 5) == 0) - appendstring(&card[i].lines, cirrus_comment); - } - - sort_database(); - - return 0; -} - -static int -compare_card(const void *e1, const void *e2) -{ - return strcmp(((Card *)e1)->name, ((Card *)e2)->name); -} - -void -sort_database() { - /* Each element is a bunch of words, but nothing too bad. */ - qsort(card, lastcard + 1, sizeof(Card), compare_card); -} diff --git a/hw/xfree86/utils/xorgconfig/cards.h b/hw/xfree86/utils/xorgconfig/cards.h deleted file mode 100644 index 7e1438db8..000000000 --- a/hw/xfree86/utils/xorgconfig/cards.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef CARD_DATABASE_FILE -#define CARD_DATABASE_FILE "Cards" -#endif - -#define MAX_CARDS 1000 - -typedef struct { - char *name; /* Name of the card. */ - char *chipset; /* Chipset (decriptive). */ - char *server; /* Server identifier. */ - char *driver; /* Driver identifier. */ - char *ramdac; /* Ramdac identifier. */ - char *clockchip; /* Clockchip identifier. */ - char *dacspeed; /* DAC speed rating. */ - int flags; - char *lines; /* Additional Device section lines. */ -} Card; - -/* Flags: */ -#define NOCLOCKPROBE 0x1 /* Never probe clocks of the card. */ -#define UNSUPPORTED 0x2 /* Card is not supported (only VGA). */ - -extern int lastcard; - -extern Card card[MAX_CARDS]; - -extern int lookupcard ( char *name ); -extern int parse_database ( void ); -extern void sort_database ( void ); -extern void keypress ( void ); diff --git a/hw/xfree86/utils/xorgconfig/xorgconfig.c b/hw/xfree86/utils/xorgconfig/xorgconfig.c deleted file mode 100644 index 30eb83182..000000000 --- a/hw/xfree86/utils/xorgconfig/xorgconfig.c +++ /dev/null @@ -1,2890 +0,0 @@ -/* - * This is a configuration program that will create a base XF86Config - * file based on menu choices. Its main feature is that clueless users - * may be less inclined to select crazy sync rates way over monitor spec, - * by presenting a menu with standard monitor types. Also some people - * don't read docs unless an executable that they can run tells them to. - * - * It assumes a 24-line or bigger text console. - * - * Revision history: - * 25Sep94 Initial version. - * 27Sep94 Fix hsync range of monitor types to match with best possible mode. - * Remove 'const'. - * Tweak descriptions. - * 28Sep94 Fixes from J"org Wunsch: - * Don't use gets(). - * Add mouse device prompt. - * Fix lines overrun for 24-line console. - * Increase buffer size for probeonly output. - * 29Sep94 Fix bad bug with old XF86Config preserving during probeonly run. - * Add note about vertical refresh in interlaced modes. - * Name gets() replacement getstring(). - * Add warning about binary paths. - * Fixes from David Dawes: - * Don't use 'ln -sf'. - * Omit man path reference in comment. - * Generate only a generic 320x200 SVGA section for accel cards. - * Only allow writing to /usr/X11R6/lib/X11 if root, and use - * -xf86config for the -probeonly phase (root only). - * Fix bug that forces screen type to accel in some cases. - * 30Sep94 Continue after clocks probe fails. - * Note about programmable clocks. - * Rename to 'xf86config'. Not to be confused with XF86Config - * or the -xf86config option. - * 07Oct94 Correct hsync in standard mode timings comments, and include - * the proper +/-h/vsync flags. - * 11Oct94 Skip 'numclocks:' and 'pixel clocks:' lines when probing for - * clocks. - * 18Oct94 Add check for existence of /usr/X11R6. - * Add note about ctrl-alt-backspace. - * 06Nov94 Add comment above standard mode timings in XF86Config. - * 24Dec94 Add low-resolution modes using doublescan. - * 29Dec94 Add note in horizontal sync range selection. - * Ask about ClearDTR/RTS option for Mouse Systems mice. - * Ask about writing to /etc/XF86Config. - * Allow link to be set in /var/X11R6/bin. - * Note about X -probeonly crashing. - * Add keyboard Alt binding option for non-ASCII characters. - * Add card database selection. - * Write temporary XF86Config for clock probing in /tmp instead - * of /usr/X11R6/lib/X11. - * Add RAMDAC and Clockchip menu. - * 27Mar99 Modified for XFree86 4.0 config file format - * 06Sep02 Write comment block about 'DontVTSwitch'. - * - * Possible enhancements: - * - Add more standard mode timings (also applies to README.Config). Missing - * are 1024x768 @ 72 Hz, 1152x900 modes, and 1280x1024 @ ~70 Hz. - * I suspect there is a VESA standard for 1024x768 @ 72 Hz with 77 MHz dot - * clock, and 1024x768 @ 75 Hz with 78.7 MHz dot clock. New types of - * monitors probably work better with VESA 75 Hz timings. - * - Add option for creation of clear, minimal XF86Config. - * - The card database doesn't include most of the entries in previous - * databases. - * - * Send comments to H.Hanemaayer@inter.nl.net. - * - * Things to keep up-to-date: - * - Accelerated server names. - * - Ramdac and Clockchip settings. - * - The card database. - * - */ -/* Oct2000 - * New 'Configuration of XKB' section. - * Author: Ivan Pascal The XFree86 Project. - */ -/* - * Nov2002 - * Some enhancements: - * - Add new PS/2 mouse protocol. - * "IMPS/2","ExplorerPS/2","ThinkingMousePS/2","MouseManPlusPS/2", - * "GlidePointPS/2","NetMousePS/2" and "NetScrollPS/2". - * - Add mouse-speed setting for PS/2 mouse. - * - Fix seg.fault problem on Solaris. - * - Add modestring "1400x1050"(for ATI Mobile-Rage). - * - Add videomemory 8192, 16384, 32768, 65536, 131072 and 262144. - * - Ready to DRI. - * - Load xtt module instead of freetype module. - * - Add font path "/TrueType/" and "/freefont/". - * Chisato Yamauchi(cyamauch@phyas.aichi-edu.ac.jp) - */ - -#ifdef HAVE_CONFIG_H -# include "xorg-server.h" -# include "xkb-config.h" -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#define MAX_XKBOPTIONS 5 - -#include "cards.h" - - -/* - * Define the following to 310 to remove references to XFree86 features that - * have been added since XFree86 3.1 (e.g. DoubleScan modes). - * or to 311 to remove certain new modelines - */ -#define XFREE86_VERSION 400 - -/* - * Define this to have /etc/X11/XF86Config prompted for as the default - * location to write the XF86Config file to. - */ -#define PREFER_XF86CONFIG_IN_ETC - -/* - * Define this to force the user to go through XKB configuration section. - * - */ -#define FORCE_XKB_DIALOG - -/* - * Configuration variables. - */ - -#define MAX_CLOCKS_LINES 16 - -#define DUMBCONFIG2 "dumbconfig.2" -#define DUMBCONFIG3 "dumbconfig.3" - -/* some more vars to make path names in texts more flexible. OS/2 users - * may be more irritated than Unix users - */ -#ifndef PROJECTROOT -#define PROJECTROOT "/usr" -#endif -#define TREEROOT PROJECTROOT -#define TREEROOTLX TREEROOT "/lib/X11" -#define TREEROOTCFG TREEROOT "/etc/X11" -#define TREEROOTSHARE TREEROOT "/share/X11" -#ifdef XDOCDIR -# define TREEROOTDOC XDOCDIR -#else -# define TREEROOTDOC TREEROOTLX "/doc" -#endif -#ifdef XFONTDIR -# define TREEROOTFONT XFONTDIR -#else -# define TREEROOTFONT TREEROOTLX "/fonts" -#endif -#define MODULEPATH TREEROOT "/lib/modules" - -#define XSERVERNAME_FOR_PROBE "X" - -#ifndef XCONFIGFILE -#define XCONFIGFILE "xorg.conf" -#endif -#define CONFIGNAME XCONFIGFILE - -/* - * This is the filename of the temporary XF86Config file that is written - * when the program is told to probe clocks (which can only happen for - * root). - */ -#define TEMPORARY_XF86CONFIG_DIR_PREFIX "/tmp/."XCONFIGFILE -#define TEMPORARY_XF86CONFIG_FILENAME XCONFIGFILE".tmp" - -#ifndef XF86_VERSION_MAJOR -#ifdef XVERSION -#if XVERSION > 40000000 -#define XF86_VERSION_MAJOR (XVERSION / 10000000) -#else -#define XF86_VERSION_MAJOR (XVERSION / 1000) -#endif -#else -#define XF86_VERSION_MAJOR 4 -#endif -#endif - - -int config_mousetype; /* Mouse. */ -int config_emulate3buttons; -int config_chordmiddle; -int config_cleardtrrts; -char *config_pointerdevice; -int config_altmeta; /* Keyboard. */ -int config_monitortype; /* Monitor. */ -char *config_hsyncrange; -char *config_vsyncrange; -char *config_monitoridentifier; -int config_videomemory; /* Video card. */ -int config_screentype; /* mono, vga16, svga, accel */ -char *config_deviceidentifier; -int config_numberofclockslines; -char *config_clocksline[MAX_CLOCKS_LINES]; -char *config_modesline8bpp; -char *config_modesline16bpp; -char *config_modesline24bpp; -int config_virtual; /* 1 (yes) or 0 (no) */ -int config_virtualx8bpp, config_virtualy8bpp; -int config_virtualx16bpp, config_virtualy16bpp; -int config_virtualx24bpp, config_virtualy24bpp; -char *config_ramdac; -char *config_dacspeed; -char *config_clockchip; -#if defined(__OpenBSD__) && defined(WSCONS_SUPPORT) && !defined(PCVT_SUPPORT) -char *config_keyboard_dev = "/dev/wskbd0"; -#endif -int config_xkbdisable = 0; -char *config_xkbrules; -char *config_xkbmodel = "pc105"; -char *config_xkblayout = "us"; -char *config_xkbvariant = (char *) 0; -char *config_xkboptions = (char *) 0; -char *config_depth; - -char *temp_dir = ""; - -/* - * These are from the selected card definition. Parameters from the - * definition are offered during the questioning about the video card. - */ - -int card_selected; /* Card selected from database. */ - - -static int write_XF86Config(char *filename); - - -/* - * This is the initial intro text that appears when the program is started. - */ - -static char *intro_text = -"\n" -"This program will create a basic " CONFIGNAME " file, based on menu selections\n" -"you make. It will ask for a pathname when it is ready to write the file.\n" -"\n" -"The " CONFIGNAME " file usually resides in /etc/X11 or " TREEROOTCFG ". If\n" -"no " CONFIGNAME " file is present there, " __XSERVERNAME__" will probe the system to\n" -"autoconfigure itself. You can run " __XSERVERNAME__ " -configure to generate a " CONFIGNAME "\n" -"file based on the results of autoconfiguration, or let this program\n" -"produce a base " CONFIGNAME " file for your configuration, and fine-tune it.\n" -"A sample " CONFIGNAME " file is also supplied with "__XSERVERNAME__"; it is configured \n" -"for a standard VGA card and monitor with 640x480 resolution.\n" -"\n" -"There are also many chipset and card-specific options and settings available,\n" -"but this program does not know about these. On some configurations some of\n" -"these settings must be specified. Refer to the X driver man pages and the\n" -"chipset-specific READMEs in " TREEROOTDOC " for further details.\n" -#if 0 -" Refer to " TREEROOTDOC "/README.Config\n" -"for a detailed overview of the configuration process.\n" -"\n" -"(what should we change this section to?)\n" -"For accelerated servers (including accelerated drivers in the SVGA server),\n" -"there are many chipset and card-specific options and settings. This program\n" -"does not know about these. On some configurations some of these settings must\n" -"be specified. Refer to the server man pages and chipset-specific READMEs.\n" -#endif -"\n" -"Before continuing with this program, make sure you know what video card\n" -"you have, and preferably also the chipset it uses and the amount of video\n" -"memory on your video card, as well as the specifications of your monitor.\n" -"\n" -; - -static char *finalcomment_text = -"File has been written. Take a look at it before starting an X server. Note that\n" -"the " CONFIGNAME " file must be in one of the directories searched by the server\n" -"(e.g. /etc/X11) in order to be used. Within the server press\n" -"ctrl, alt and '+' simultaneously to cycle video resolutions. Pressing ctrl,\n" -"alt and backspace simultaneously immediately exits the server (use if\n" -"the monitor doesn't sync for a particular mode).\n" -"\n" -"For further configuration, refer to the " XCONFIGFILE "(" FILEMANSUFFIX ") manual page.\n" -"\n"; - -static void * -Malloc(int i) { - void *p; - - p = malloc(i); - if (p == NULL) { - printf("Fatal malloc error\n"); - exit(-1); - } - return p; -} - -static char * -Strdup(const char *s){ - char *d; - - d = Malloc(strlen(s) + 1); - strcpy(d, s); - return d; -} - -static void -createtmpdir(void) { - /* length of prefix + 20 (digits in 2**64) + 1 (slash) + 1 */ - temp_dir = Malloc(strlen(TEMPORARY_XF86CONFIG_DIR_PREFIX) + 22); - sprintf(temp_dir, "%s%ld", TEMPORARY_XF86CONFIG_DIR_PREFIX, - (long)getpid()); - if (mkdir(temp_dir, 0700) != 0) { - printf("Cannot create directory %s\n", temp_dir); - exit(-1); - } - /* append a slash */ - strcat(temp_dir, "/"); -} - - -void -keypress(void) { - printf("Press enter to continue, or ctrl-c to abort."); - getchar(); - printf("\n"); -} - -static void -emptylines(void) { - int i; - for (i = 0; i < 50; i++) - printf("\n"); -} - -static int -answerisyes(char *s) -{ - if (s[0] == '\'') /* For fools that type the ' literally. */ - return tolower(s[1]) == 'y'; - return tolower(s[0]) == 'y'; -} - -/* - * This is a replacement for gets(). Limit is 80 chars. - * The 386BSD descendants scream about using gets(), for good reason. - */ - -static void -getstring(char *s) -{ - char *cp; - if (fgets(s, 80, stdin) == NULL) - exit(1); - cp = strchr(s, '\n'); - if (cp) - *cp=0; -} - -/* - * Mouse configuration. - */ - -int M_OSMOUSE, M_WSMOUSE, M_AUTO, - M_SYSMOUSE, M_MOUSESYSTEMS, M_PS2, - M_MICROSOFT, M_BUSMOUSE, M_IMPS2, - M_EXPLORER_PS2, M_GLIDEPOINT_PS2, M_MOUSEMANPLUS_PS2, - M_NETMOUSE_PS2, M_NETSCROLL_PS2, M_THINKINGMOUSE_PS2, - M_ACECAD, M_GLIDEPOINT, M_INTELLIMOUSE, - M_LOGITECH, M_MMHITTAB, M_MMSERIES, - M_MOUSEMAN, M_THINKINGMOUSE, M_VUID; - -struct { - char *name; - int *ident; - char *desc; -} mouse_info[] = { -#if defined(QNX4) -#define DEF_PROTO_STRING "OSMOUSE" - {"OSMOUSE", &M_OSMOUSE, - "OSMOUSE" - }, -#endif -#ifdef WSCONS_SUPPORT -#define WS_MOUSE_STRING "wsmouse" -#define DEF_PROTO_STRING WS_MOUSE_STRING - {WS_MOUSE_STRING, &M_WSMOUSE, - "wsmouse protocol" - }, -#endif -#ifndef DEF_PROTO_STRING -#define DEF_PROTO_STRING "Auto" -#endif - {"Auto", &M_AUTO, - "Auto detect" - }, -#ifdef sun - {"VUID", &M_VUID, - "Solaris VUID protocol (SPARC, USB, or virtual mouse)" - }, -#endif - {"SysMouse", &M_SYSMOUSE, - "SysMouse" - }, -#define M_MOUSESYSTEMS_STRING "MouseSystems" - {M_MOUSESYSTEMS_STRING, &M_MOUSESYSTEMS, - "Mouse Systems (3-button protocol)" - }, - {"PS/2", &M_PS2, - "PS/2 Mouse" - }, -#define M_MICROSOFT_STRING "Microsoft" - {M_MICROSOFT_STRING, &M_MICROSOFT, - "Microsoft compatible (2-button protocol)" - }, - {"Busmouse", &M_BUSMOUSE, - "Bus Mouse" - }, -#ifndef __FreeBSD__ - {"IMPS/2", &M_IMPS2, - "IntelliMouse PS/2" - }, - {"ExplorerPS/2", &M_EXPLORER_PS2, - "Explorer PS/2" - }, - {"GlidePointPS/2", &M_GLIDEPOINT_PS2, - "GlidePoint PS/2" - }, - {"MouseManPlusPS/2", &M_MOUSEMANPLUS_PS2, - "MouseManPlus PS/2" - }, - {"NetMousePS/2", &M_NETMOUSE_PS2, - "NetMouse PS/2" - }, - {"NetScrollPS/2", &M_NETSCROLL_PS2, - "NetScroll PS/2" - }, - {"ThinkingMousePS/2", &M_THINKINGMOUSE_PS2, - "ThinkingMouse PS/2" - }, -#endif - {"AceCad", &M_ACECAD, - "AceCad" - }, - {"GlidePoint", &M_GLIDEPOINT, - "GlidePoint" - }, - {"IntelliMouse", &M_INTELLIMOUSE, - "Microsoft IntelliMouse" - }, - {"Logitech", &M_LOGITECH, - "Logitech Mouse (serial, old type, Logitech protocol)" - }, - {"MMHitTab", &M_MMHITTAB, - "MM HitTablet" - }, - {"MMSeries", &M_MMSERIES, - "MM Series" /* XXXX These descriptions should be improved. */ - }, - {"MouseMan", &M_MOUSEMAN, - "Logitech MouseMan (Microsoft compatible)" - }, - {"ThinkingMouse", &M_THINKINGMOUSE, - "ThinkingMouse" - }, -}; - -#ifdef WSCONS_SUPPORT -# define DEF_MOUSEDEV "/dev/wsmouse"; -#elif defined(__FreeBSD__) || defined(__DragonFly__) -# define DEF_MOUSEDEV "/dev/sysmouse"; -#elif defined(__linux__) -# define DEF_MOUSEDEV "/dev/input/mice"; -#else -# define DEF_MOUSEDEV "/dev/mouse"; -#endif - -static char *mouseintro_text = -"First specify a mouse protocol type. Choose one from the following list:\n" -"\n"; - -static char *mousedev_text = -"Now give the full device name that the mouse is connected to, for example\n" -"/dev/tty00. Just pressing enter will use the default, %s.\n" -"\n"; - -static char *mousecomment_text = -"The recommended protocol is " DEF_PROTO_STRING ". If you have a very old mouse\n" -"or don't want OS support or auto detection, and you have a two-button\n" -"or three-button serial mouse, it is most likely of type " M_MICROSOFT_STRING ".\n" -#ifdef WSCONS_SUPPORT -"\n" -"If your system uses the wscons console driver, with a PS/2 type mouse,\n" -"select " WS_MOUSE_STRING ".\n" -#endif -"\n"; - -static char *twobuttonmousecomment_text = -"You have selected a two-button mouse protocol. It is recommended that you\n" -"enable Emulate3Buttons.\n"; - -static char *threebuttonmousecomment_text = -"You have selected a three-button mouse protocol. It is recommended that you\n" -"do not enable Emulate3Buttons, unless the third button doesn't work.\n"; - -static char *unknownbuttonsmousecomment_text = -"If your mouse has only two buttons, it is recommended that you enable\n" -"Emulate3Buttons.\n"; - -static char *microsoftmousecomment_text = -"You have selected a Microsoft protocol mouse. If your mouse was made by\n" -"Logitech, you might want to enable ChordMiddle which could cause the\n" -"third button to work.\n"; - -static char *mousesystemscomment_text = -"You have selected a Mouse Systems protocol mouse. If your mouse is normally\n" -"in Microsoft-compatible mode, enabling the ClearDTR and ClearRTS options\n" -"may cause it to switch to Mouse Systems mode when the server starts.\n"; - -static char *logitechmousecomment_text = -"You have selected a Logitech protocol mouse. This is only valid for old\n" -"Logitech mice.\n"; - -static char *mousemancomment_text = -"You have selected a Logitech MouseMan type mouse. You might want to enable\n" -"ChordMiddle which could cause the third button to work.\n"; - -static void -mouse_configuration(void) { - -#if !defined(QNX4) - int i, j; - char s[80]; - char *def_mousedev = DEF_MOUSEDEV; - -#define MOUSETYPE_COUNT sizeof(mouse_info)/sizeof(mouse_info[0]) - for (i = 0; i < MOUSETYPE_COUNT; i++) - *(mouse_info[i].ident) = i; - - for (i=0;;) { - emptylines(); - printf("%s", mouseintro_text); - for (j = i; j < i + 14 && j < MOUSETYPE_COUNT; j++) - printf("%2d. %s [%s]\n", j + 1, - mouse_info[j].name, mouse_info[j].desc); - printf("\n"); - printf("%s", mousecomment_text); - printf("Enter a protocol number: "); - getstring(s); - if (strlen(s) == 0) { - i += 14; - if (i >= MOUSETYPE_COUNT) - i = 0; - continue; - } - config_mousetype = atoi(s) - 1; - if (config_mousetype >= 0 && config_mousetype < MOUSETYPE_COUNT) - break; - } - printf("\n"); - - if (config_mousetype == M_LOGITECH) { - /* Logitech. */ - printf("%s", logitechmousecomment_text); - printf("\n"); - printf("Please answer the following question with either 'y' or 'n'.\n"); - printf("Are you sure it's really not a Microsoft compatible one? "); - getstring(s); - if (!answerisyes(s)) - config_mousetype = M_MICROSOFT; - printf("\n"); - } - - config_chordmiddle = 0; - if (config_mousetype == M_MICROSOFT || config_mousetype == M_MOUSEMAN) { - /* Microsoft or MouseMan. */ - if (config_mousetype == M_MICROSOFT) - printf("%s", microsoftmousecomment_text); - else - printf("%s", mousemancomment_text); - printf("\n"); - printf("Please answer the following question with either 'y' or 'n'.\n"); - printf("Do you want to enable ChordMiddle? "); - getstring(s); - if (answerisyes(s)) - config_chordmiddle = 1; - printf("\n"); - } - - config_cleardtrrts = 0; - if (config_mousetype == M_MOUSESYSTEMS) { - /* Mouse Systems. */ - printf("%s", mousesystemscomment_text); - printf("\n"); - printf("Please answer the following question with either 'y' or 'n'.\n"); - printf("Do you want to enable ClearDTR and ClearRTS? "); - getstring(s); - if (answerisyes(s)) - config_cleardtrrts = 1; - printf("\n"); - } - - if (config_mousetype == M_MICROSOFT) { - if (config_chordmiddle) - printf("%s", threebuttonmousecomment_text); - else - printf("%s", twobuttonmousecomment_text); - } - else if (config_mousetype == M_MOUSESYSTEMS || - config_mousetype == M_INTELLIMOUSE) { - printf("%s", threebuttonmousecomment_text); - } - else { - printf("%s", unknownbuttonsmousecomment_text); - } - - printf("\n"); - - printf("Please answer the following question with either 'y' or 'n'.\n"); - printf("Do you want to enable Emulate3Buttons? "); - getstring(s); - if (answerisyes(s)) - config_emulate3buttons = 1; - else - config_emulate3buttons = 0; - printf("\n"); - -#if (defined(sun) && (defined(__i386) || defined(__x86))) - /* SPARC & USB mice (VUID or AUTO protocols) default to /dev/mouse, - but PS/2 mice default to /dev/kdmouse */ - if ((config_mousetype != M_AUTO) && (config_mousetype != M_VUID)) { - def_mousedev = "/dev/kdmouse"; - } -#endif - - printf(mousedev_text, def_mousedev); - printf("Mouse device: "); - getstring(s); - if (strlen(s) == 0) { - config_pointerdevice = def_mousedev; - } else { - config_pointerdevice = Malloc(strlen(s) + 1); - strcpy(config_pointerdevice, s); - } - printf("\n"); - -#else - /* set some reasonable defaults for OS/2 */ - config_mousetype = M_OSMOUSE; - config_chordmiddle = 0; - config_cleardtrrts = 0; - config_emulate3buttons = 0; - config_pointerdevice = "QNXMOUSE"; -#endif -} - - -/* - * Keyboard configuration. - */ - -/* - * Configuration of XKB - */ -static char *xkbmodeltext = -"Please select one of the following keyboard types that is the better\n" -"description of your keyboard. If nothing really matches,\n" -"choose \"Generic 104-key PC\"\n\n"; - -static char *xkblayouttext = -"Please select the layout corresponding to your keyboard\n"; - -static char *xkbvarianttext = -"Please enter a variant name for '%s' layout. Or just press enter\n" -"for default variant\n\n"; - -static char *xkboptionstext = -"Please answer the following question with either 'y' or 'n'.\n" -"Do you want to select additional XKB options (group switcher,\n" -"group indicator, etc.)? "; - -#if defined(__OpenBSD__) && defined(WSCONS_SUPPORT) && !defined(PCVT_SUPPORT) -static char *kbdevtext = -"Please enter the device name for your keyboard or just press enter\n" -"for the default of wskbd0\n\n"; -#endif - -static void -keyboard_configuration(void) -{ - int i, j; - char s[80]; - char *rulesfile; - int number, options[MAX_XKBOPTIONS], num_options; - XkbRF_RulesPtr rules; - -#if defined(__OpenBSD__) && defined(WSCONS_SUPPORT) && !defined(PCVT_SUPPORT) - printf(kbdevtext); - getstring(s); - if (strlen(s) != 0) { - config_keyboard_dev = Malloc(strlen(s) + 1); - strcpy(config_keyboard_dev, s); - } -#endif - -#ifndef XKB_RULES_DIR -# define XKB_RULES_DIR XKB_BASE_DIRECTORY "/rules" -#endif - -#ifdef XFREE98_XKB - config_xkbrules = "xfree98"; /* static */ - rulesfile = XKB_RULES_DIR "/xfree98"; -#else - config_xkbrules = __XKBDEFRULES__; /* static */ - rulesfile = XKB_RULES_DIR "/" __XKBDEFRULES__; -#endif - - rules = XkbRF_Load(rulesfile, "", True, False); - emptylines(); - - if (!rules) { - printf("XKB rules file '%s' not found\n", rulesfile); - printf("Keyboard XKB options will be set to default values.\n"); - keypress(); - return; - } - - number = -1; - for (i=0;;) { - emptylines(); - printf(xkbmodeltext); - for (j = i; j < i + 16 && j < rules->models.num_desc; j++) - printf("%3d %-50s\n", j+1, rules->models.desc[j].desc); - printf("\nEnter a number to choose the keyboard.\n\n"); - if (rules->models.num_desc >= 16) - printf("Press enter for the next page\n"); - getstring(s); - if (strlen(s) == 0) { - i += 16; - if (i > rules->models.num_desc) - i = 0; - continue; - } - number = atoi(s) - 1; - if (number >= 0 && number < rules->models.num_desc) - break; - } - - i = strlen(rules->models.desc[number].name) + 1; - config_xkbmodel = Malloc(i); - sprintf(config_xkbmodel,"%s", rules->models.desc[number].name); - - emptylines(); - printf(xkblayouttext); - - number = -1; - for (i=0;;) { - emptylines(); - for (j = i; j < i + 18 && j < rules->layouts.num_desc; j++) - printf("%3d %-50s\n", j+1, - rules->layouts.desc[j].desc); - printf("\n"); - printf("Enter a number to choose the country.\n"); - if (rules->layouts.num_desc >= 18) - printf("Press enter for the next page\n"); - printf("\n"); - getstring(s); - if (strlen(s) == 0) { - i += 18; - if (i > rules->layouts.num_desc) - i = 0; - continue; - } - number = atoi(s) - 1; - if (number >= 0 && number < rules->layouts.num_desc) - break; - } - config_xkblayout = Malloc(strlen(rules->layouts.desc[number].name)+1); - sprintf(config_xkblayout,"%s", rules->layouts.desc[number].name); - - emptylines(); - printf(xkbvarianttext, config_xkblayout); - getstring(s); - if (strlen(s) != 0) { - config_xkbvariant = Malloc(strlen(s) + 1); - strcpy(config_xkbvariant, s); - } - - emptylines(); - printf(xkboptionstext); - getstring(s); - if (!answerisyes(s)) - return; - - num_options = 0; - for (j=0,i=0;;) { - if (!strchr(rules->options.desc[i].name, ':')) { - emptylines(); - printf(" %s\n\n", rules->options.desc[i].desc); - j = i; - } else { - printf("%3d %-50s\n", i - j, rules->options.desc[i].desc); - } - i++; - if ( i == rules->options.num_desc || - !strchr(rules->options.desc[i].name, ':')) { - printf("\nPlease select the option or just press enter if none\n"); - getstring(s); - if (strlen(s) != 0) { - number = atoi(s); - if (number && (num_options < MAX_XKBOPTIONS)) { - options[num_options++] = number + j; - } - } - } - if (i == rules->options.num_desc) - break; - } - - if (!num_options) - return; - - for (j=0,i=0; ioptions.desc[options[i]].name); - } - config_xkboptions = Malloc(j + num_options); - for (j=0,i=0; ioptions.desc[options[i]].name); - } - return; -} - - - -/* - * Monitor configuration. - */ - -static char *monitorintro_text = -"Now we want to set the specifications of the monitor. The two critical\n" -"parameters are the vertical refresh rate, which is the rate at which the\n" -"the whole screen is refreshed, and most importantly the horizontal sync rate,\n" -"which is the rate at which scanlines are displayed.\n" -"\n" -"The valid range for horizontal sync and vertical sync should be documented\n" -"in the manual of your monitor.\n" -"\n"; - -static char *hsyncintro_text = -"You must indicate the horizontal sync range of your monitor. You can either\n" -"select one of the predefined ranges below that correspond to industry-\n" -"standard monitor types, or give a specific range.\n" -"\n" -"It is VERY IMPORTANT that you do not specify a monitor type with a horizontal\n" -"sync range that is beyond the capabilities of your monitor. If in doubt,\n" -"choose a conservative setting.\n" -"\n"; - -static char *customhsync_text = -"Please enter the horizontal sync range of your monitor, in the format used\n" -"in the table of monitor types above. You can either specify one or more\n" -"continuous ranges (e.g. 15-25, 30-50), or one or more fixed sync frequencies.\n" -"\n"; - -static char *vsyncintro_text = -"You must indicate the vertical sync range of your monitor. You can either\n" -"select one of the predefined ranges below that correspond to industry-\n" -"standard monitor types, or give a specific range. For interlaced modes,\n" -"the number that counts is the high one (e.g. 87 Hz rather than 43 Hz).\n" -"\n" -" 1 50-70\n" -" 2 50-90\n" -" 3 50-100\n" -" 4 40-150\n" -" 5 Enter your own vertical sync range\n"; - -static char *monitordescintro_text = -"You must now enter a few identification/description strings, namely an\n" -"identifier, a vendor name, and a model name. Just pressing enter will fill\n" -"in default names.\n" -"\n"; - -#define NU_MONITORTYPES 10 - -static char *monitortype_range[NU_MONITORTYPES] = { - "31.5", - "31.5 - 35.1", - "31.5, 35.5", - "31.5, 35.15, 35.5", - "31.5 - 37.9", - "31.5 - 48.5", - "31.5 - 57.0", - "31.5 - 64.3", - "31.5 - 79.0", - "31.5 - 82.0" -}; - -static char *monitortype_name[NU_MONITORTYPES] = { - "Standard VGA, 640x480 @ 60 Hz", - "Super VGA, 800x600 @ 56 Hz", - "8514 Compatible, 1024x768 @ 87 Hz interlaced (no 800x600)", - "Super VGA, 1024x768 @ 87 Hz interlaced, 800x600 @ 56 Hz", - "Extended Super VGA, 800x600 @ 60 Hz, 640x480 @ 72 Hz", - "Non-Interlaced SVGA, 1024x768 @ 60 Hz, 800x600 @ 72 Hz", - "High Frequency SVGA, 1024x768 @ 70 Hz", - "Monitor that can do 1280x1024 @ 60 Hz", - "Monitor that can do 1280x1024 @ 74 Hz", - "Monitor that can do 1280x1024 @ 76 Hz" -}; - -static void -monitor_configuration(void) { - int i; - char s[80]; - printf("%s", monitorintro_text); - - keypress(); - emptylines(); - - printf("%s", hsyncintro_text); - - printf(" hsync in kHz; monitor type with characteristic modes\n"); - for (i = 0; i < NU_MONITORTYPES; i++) - printf("%2d %s; %s\n", i + 1, monitortype_range[i], - monitortype_name[i]); - - printf("%2d Enter your own horizontal sync range\n", - NU_MONITORTYPES + 1); - printf("\n"); - - printf("Enter your choice (1-%d): ", NU_MONITORTYPES + 1); - getstring(s); - config_monitortype = atoi(s) - 1; - if (config_monitortype < 0) - config_monitortype = 0; - - printf("\n"); - - if (config_monitortype < NU_MONITORTYPES) - config_hsyncrange = monitortype_range[config_monitortype]; - else { - /* Custom hsync range option selected. */ - printf("%s", customhsync_text); - printf("Horizontal sync range: "); - getstring(s); - config_hsyncrange = Malloc(strlen(s) + 1); - strcpy(config_hsyncrange, s); - printf("\n"); - } - - printf("%s", vsyncintro_text); - printf("\n"); - - printf("Enter your choice: "); - getstring(s); - printf("\n"); - switch (atoi(s)) { - case 0 : - case 1 : - config_vsyncrange = "50-70"; - break; - case 2 : - config_vsyncrange = "50-90"; - break; - case 3 : - config_vsyncrange = "50-100"; - break; - case 4 : - config_vsyncrange = "40-150"; - break; - case 5 : - /* Custom vsync range option selected. */ - printf("Vertical sync range: "); - getstring(s); - config_vsyncrange = Malloc(strlen(s) + 1); - strcpy(config_vsyncrange, s); - printf("\n"); - break; - } - printf("%s", monitordescintro_text); - printf("The strings are free-form, spaces are allowed.\n"); - printf("Enter an identifier for your monitor definition: "); - getstring(s); - if (strlen(s) == 0) - config_monitoridentifier = "My Monitor"; - else { - config_monitoridentifier = Malloc(strlen(s) + 1); - strcpy(config_monitoridentifier, s); - } -} - - -/* - * Card database. - */ - -static char *cardintro_text = -"Now we must configure video card specific settings. At this point you can\n" -"choose to make a selection out of a database of video card definitions.\n" -"Because there can be variation in Ramdacs and clock generators even\n" -"between cards of the same model, it is not sensible to blindly copy\n" -"the settings (e.g. a Device section). For this reason, after you make a\n" -"selection, you will still be asked about the components of the card, with\n" -"the settings from the chosen database entry presented as a strong hint.\n" -"\n" -"The database entries include information about the chipset, what driver to\n" -"run, the Ramdac and ClockChip, and comments that will be included in the\n" -"Device section. However, a lot of definitions only hint about what driver\n" -"to run (based on the chipset the card uses) and are untested.\n" -"\n" -"If you can't find your card in the database, there's nothing to worry about.\n" -"You should only choose a database entry that is exactly the same model as\n" -"your card; choosing one that looks similar is just a bad idea (e.g. a\n" -"GemStone Snail 64 may be as different from a GemStone Snail 64+ in terms of\n" -"hardware as can be).\n" -"\n"; - -static char *cardunsupported_text = -"This card is basically UNSUPPORTED. It may only work as a generic\n" -"VGA-compatible card. If you have an "__XSERVERNAME__" version more recent than what\n" -"this card definition was based on, there's a chance that it is now\n" -"supported.\n"; - -static void -carddb_configuration(void) { - int i; - char s[80]; - card_selected = -1; - printf("%s", cardintro_text); - printf("Do you want to look at the card database? "); - getstring(s); - printf("\n"); - if (!answerisyes(s)) - return; - - /* - * Choose a database entry. - */ - if (parse_database()) { - printf("Couldn't read card database file %s.\n", - CARD_DATABASE_FILE); - keypress(); - return; - } - - i = 0; - for (;;) { - int j; - emptylines(); - for (j = i; j < i + 18 && j <= lastcard; j++) { - char *name = card[j].name, - *chipset = card[j].chipset; - - printf("%3d %-50s%s\n", j, - name ? name : "-", - chipset ? chipset : "-"); - } - printf("\n"); - printf("Enter a number to choose the corresponding card definition.\n"); - printf("Press enter for the next page, q to continue configuration.\n"); - printf("\n"); - getstring(s); - if (s[0] == 'q') - break; - if (strlen(s) == 0) { - i += 18; - if (i > lastcard) - i = 0; - continue; - } - card_selected = atoi(s); - if (card_selected >= 0 && card_selected <= lastcard) - break; - } - - /* - * Look at the selected card. - */ - if (card_selected != -1) { - char *name = card[card_selected].name, - *chipset = card[card_selected].chipset; - - printf("\nYour selected card definition:\n\n"); - printf("Identifier: %s\n", name ? name : "-"); - printf("Chipset: %s\n", chipset ? chipset : "-"); - if (!card[card_selected].driver) - card[card_selected].driver = "unknown"; - printf("Driver: %s\n", card[card_selected].driver); - - if (card[card_selected].ramdac != NULL) - printf("Ramdac: %s\n", card[card_selected].ramdac); - if (card[card_selected].dacspeed != NULL) - printf("DacSpeed: %s\n", card[card_selected].dacspeed); - if (card[card_selected].clockchip != NULL) - printf("Clockchip: %s\n", card[card_selected].clockchip); - if (card[card_selected].flags & NOCLOCKPROBE) - printf("Do NOT probe clocks or use any Clocks line.\n"); - if (card[card_selected].flags & UNSUPPORTED) - printf("%s", cardunsupported_text); -#if 0 /* Might be confusing. */ - if (strlen(card[card_selected].lines) > 0) - printf("Device section text:\n%s", - card[card_selected].lines); -#endif - printf("\n"); - keypress(); - } -} - - -/* - * Screen/video card configuration. - */ - -static char *deviceintro_text = -"Now you must give information about your video card. This will be used for\n" -"the \"Device\" section of your video card in " CONFIGNAME ".\n" -"\n"; - -static char *videomemoryintro_text = -"It is probably a good idea to use the same approximate amount as that detected\n" -"by the server you intend to use. If you encounter problems that are due to the\n" -"used server not supporting the amount memory you have, specify the maximum\n" -"amount supported by the server.\n" -"\n" -"How much video memory do you have on your video card:\n" -"\n"; - -static char *carddescintro_text = -"You must now enter a few identification/description strings, namely an\n" -"identifier, a vendor name, and a model name. Just pressing enter will fill\n" -"in default names (possibly from a card definition).\n" -"\n"; - -#if 0 -static char *devicesettingscomment_text = -"Especially for accelerated drivers, Ramdac, Dacspeed and ClockChip settings\n" -"or special options may be required in the Device section.\n" -"\n"; - -static char *ramdaccomment_text = -"The RAMDAC setting only applies to some drivers. Some RAMDAC's are\n" -"auto-detected by the server. The detection of a RAMDAC is forced by using a\n" -"Ramdac \"identifier\" line in the Device section. The identifiers are shown\n" -"at the right of the following table of RAMDAC types:\n" -"\n"; - -#define NU_RAMDACS 24 - -static char *ramdac_name[NU_RAMDACS] = { - "AT&T 20C490 (S3 and AGX servers, ARK driver)", - "AT&T 20C498/21C498/22C498 (S3, autodetected)", - "AT&T 20C409/20C499 (S3, autodetected)", - "AT&T 20C505 (S3)", - "BrookTree BT481 (AGX)", - "BrookTree BT482 (AGX)", - "BrookTree BT485/9485 (S3)", - "Sierra SC15025 (S3, AGX)", -#if XFREE86_VERSION >= 311 - "S3 GenDAC (86C708) (autodetected)", - "S3 SDAC (86C716) (autodetected)", -#else - "S3 GenDAC (86C708)", - "S3 SDAC (86C716)", -#endif - "STG-1700 (S3, autodetected)", - "STG-1703 (S3, autodetected)", - "TI 3020 (S3, autodetected)", - "TI 3025 (S3, autodetected)", - "TI 3026 (S3, autodetected)", - "IBM RGB 514 (S3, autodetected)", - "IBM RGB 524 (S3, autodetected)", - "IBM RGB 525 (S3, autodetected)", - "IBM RGB 526 (S3)", - "IBM RGB 528 (S3, autodetected)", - "ICS5342 (S3, ARK)", - "ICS5341 (W32)", - "IC Works w30C516 ZoomDac (ARK)", - "Normal DAC" -}; - -static char *ramdac_id[NU_RAMDACS] = { - "att20c490", "att20c498", "att20c409", "att20c505", "bt481", "bt482", - "bt485", "sc15025", "s3gendac", "s3_sdac", "stg1700","stg1703", - "ti3020", "ti3025", "ti3026", "ibm_rgb514", "ibm_rgb524", - "ibm_rgb525", "ibm_rgb526", "ibm_rgb528", "ics5342", "ics5341", - "zoomdac", "normal" -}; - -static char *clockchipcomment_text = -"A Clockchip line in the Device section forces the detection of a\n" -"programmable clock device. With a clockchip enabled, any required\n" -"clock can be programmed without requiring probing of clocks or a\n" -"Clocks line. Most cards don't have a programmable clock chip.\n" -"Choose from the following list:\n" -"\n"; - -#define NU_CLOCKCHIPS 12 - -static char *clockchip_name[] = { - "Chrontel 8391", - "ICD2061A and compatibles (ICS9161A, DCS2824)", - "ICS2595", - "ICS5342 (similar to SDAC, but not completely compatible)", - "ICS5341", - "S3 GenDAC (86C708) and ICS5300 (autodetected)", - "S3 SDAC (86C716)", - "STG 1703 (autodetected)", - "Sierra SC11412", - "TI 3025 (autodetected)", - "TI 3026 (autodetected)", - "IBM RGB 51x/52x (autodetected)", -}; - -static char *clockchip_id[] = { - "ch8391", "icd2061a", "ics2595", "ics5342", "ics5341", - "s3gendac", "s3_sdac", - "stg1703", "sc11412", "ti3025", "ti3026", "ibm_rgb5xx", -}; - -static char *deviceclockscomment_text = -"For most modern configurations, a Clocks line is neither required or\n" -"desirable. However for some older hardware it can be useful since it\n" -"prevents the slow and nasty sounding clock probing at server start-up.\n" -"Probed clocks are displayed at server startup, along with other server\n" -"and hardware configuration info. You can save this information in a file\n" -"by running 'X -probeonly 2>output_file'. Be warned that clock probing is\n" -"inherently imprecise; some clocks may be slightly too high (varies per run).\n" -"\n"; - -static char *deviceclocksquestion_text = -"At this point I can run X -probeonly, and try to extract the clock information\n" -"from the output. It is recommended that you do this yourself and if a set of\n" -"clocks is shown then you add a clocks line (note that the list of clocks may\n" -"be split over multiple Clocks lines) to your Device section afterwards. Be\n" -"aware that a clocks line is not appropriate for most modern hardware that\n" -"has programmable clocks.\n" -"\n" -"You must be root to be able to run X -probeonly now.\n" -"\n"; - -static char *probeonlywarning_text = -"It is possible that the hardware detection routines in the server will somehow\n" -"cause the system to crash and the screen to remain blank. If this is the\n" -"case, do not choose this option the next time. The server may need a\n" -"Ramdac, ClockChip or special option (e.g. \"nolinear\" for S3) to probe\n" -"and start-up correctly.\n" -"\n"; -#endif - -static char *modesorderintro_text = -"For each depth, a list of modes (resolutions) is defined. The default\n" -"resolution that the server will start-up with will be the first listed\n" -"mode that can be supported by the monitor and card.\n" -"Currently it is set to:\n" -"\n"; - -static char *modesorder_text2 = -"Modes that cannot be supported due to monitor or clock constraints will\n" -"be automatically skipped by the server.\n" -"\n" -" 1 Change the modes for 8-bit (256 colors)\n" -" 2 Change the modes for 16-bit (32K/64K colors)\n" -" 3 Change the modes for 24-bit (24-bit color)\n" -" 4 The modes are OK, continue.\n" -"\n"; - -static char *modeslist_text = -"Please type the digits corresponding to the modes that you want to select.\n" -"For example, 432 selects \"1024x768\" \"800x600\" \"640x480\", with a\n" -"default mode of 1024x768.\n" -"\n"; - -static char *virtual_text = -"You can have a virtual screen (desktop), which is screen area that is larger\n" -"than the physical screen and which is panned by moving the mouse to the edge\n" -"of the screen. If you don't want virtual desktop at a certain resolution,\n" -"you cannot have modes listed that are larger. Each color depth can have a\n" -"differently-sized virtual screen\n" -"\n"; - -static int videomemory[] = { - 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144 -}; - -/* Is this required? */ -#if XFREE86_VERSION >= 400 -#define NU_MODESTRINGS 13 -#else -#if XFREE86_VERSION >= 330 -#define NU_MODESTRINGS 12 -#else -#if XFREE86_VERSION >= 311 -#define NU_MODESTRINGS 8 -#else -#define NU_MODESTRINGS 5 -#endif -#endif -#endif - -static char *modestring[NU_MODESTRINGS] = { - "\"640x400\"", - "\"640x480\"", - "\"800x600\"", - "\"1024x768\"", - "\"1280x1024\"", -#if XFREE86_VERSION >= 311 - "\"320x200\"", - "\"320x240\"", - "\"400x300\"" -#endif -#if XFREE86_VERSION >= 330 - ,"\"1152x864\"", - "\"1600x1200\"", - "\"1800x1400\"", - "\"512x384\"" -#endif -#if XFREE86_VERSION >= 400 - ,"\"1400x1050\"" -#endif -}; - -static int exists_dir(char *name) { - struct stat sbuf; - - /* is it there ? */ - if (stat(name,&sbuf) == -1) - return 0; - - /* is there, but is it a dir? */ - return S_ISDIR(sbuf.st_mode) ? 1 : 0; -} - -static int -screen_configuration(void) { - int i, c/*, np*/; - char s[80]; - - /* - * Configure the "Device" section for the video card. - */ - - printf("%s", deviceintro_text); - - printf("%s", videomemoryintro_text); - - for (i = 0; i < sizeof(videomemory) / sizeof(videomemory[0]); i++) - printf("%2d %dK\n", i + 1, videomemory[i]); - printf("%2d Other\n\n", i + 1); - - printf("Enter your choice: "); - getstring(s); - printf("\n"); - - c = atoi(s) - 1; - if (c >= 0 && c < sizeof(videomemory) / sizeof(videomemory[0])) - config_videomemory = videomemory[c]; - else { - printf("Amount of video memory in Kbytes: "); - getstring(s); - config_videomemory = atoi(s); - printf("\n"); - } - - printf("%s", carddescintro_text); - if (card_selected != -1) - printf("Your card definition is %s.\n\n", - card[card_selected].name); - printf("The strings are free-form, spaces are allowed.\n"); - printf("Enter an identifier for your video card definition: "); - getstring(s); - if (strlen(s) == 0) - if (card_selected != -1) - config_deviceidentifier = card[card_selected].name; - else - config_deviceidentifier = "My Video Card"; - else { - config_deviceidentifier = Malloc(strlen(s) + 1); - strcpy(config_deviceidentifier, s); - } - printf("\n"); - - emptylines(); - - /* - * Initialize screen mode variables for svga and accel - * to default values. - * XXXX Doesn't leave room for off-screen caching in 16/32bpp modes - * for the accelerated servers in some situations. - */ - config_modesline8bpp = - config_modesline16bpp = - config_modesline24bpp = "\"640x480\""; - config_virtualx8bpp = config_virtualx16bpp = config_virtualx24bpp = - config_virtualy8bpp = config_virtualy16bpp = config_virtualy24bpp = 0; - if (config_videomemory >= 4096) { - config_virtualx8bpp = 1600; - config_virtualy8bpp = 1280; - if (card_selected != -1 && !(card[card_selected].flags & UNSUPPORTED)) { - /* - * Allow room for font/pixmap cache for accel - * servers. - */ - config_virtualx16bpp = 1280; - config_virtualy16bpp = 1024; - } - else { - config_virtualx16bpp = 1600; - config_virtualy16bpp = 1280; - } - if (card_selected != -1 && !(card[card_selected].flags & UNSUPPORTED)) { - config_virtualx24bpp = 1152; - config_virtualy24bpp = 900; - } - else { - config_virtualx24bpp = 1280; - config_virtualy24bpp = 1024; - } - /* Add 1600x1280 */ - config_modesline8bpp = "\"1280x1024\" \"1024x768\" \"800x600\" \"640x480\""; - config_modesline16bpp = "\"1280x1024\" \"1024x768\" \"800x600\" \"640x480\""; - config_modesline24bpp = "\"1280x1024\" \"1024x768\" \"800x600\" \"640x480\""; - - } - else - if (config_videomemory >= 2048) { - if (card_selected != -1 && !(card[card_selected].flags & UNSUPPORTED)) { - /* - * Allow room for font/pixmap cache for accel - * servers. - * Also the mach32 is has a limited width. - */ - config_virtualx8bpp = 1280; - config_virtualy8bpp = 1024; - } - else { - config_virtualx8bpp = 1600; - config_virtualy8bpp = 1200; - } - if (card_selected != -1 && !(card[card_selected].flags & UNSUPPORTED)) { - config_virtualx16bpp = 1024; - config_virtualy16bpp = 768; - } - else { - config_virtualx16bpp = 1152; - config_virtualy16bpp = 900; - } - config_virtualx24bpp = 800; - config_virtualy24bpp = 600; - if (config_videomemory >= 2048 + 256) { - config_virtualx24bpp = 1024; - config_virtualy24bpp = 768; - } - config_modesline8bpp = "\"1280x1024\" \"1024x768\" \"800x600\" \"640x480\""; - config_modesline16bpp = "\"1024x768\" \"800x600\" \"640x480\""; - if (config_videomemory >= 2048 + 256) - config_modesline24bpp = "\"1024x768\" \"800x600\" \"640x480\""; - else - config_modesline24bpp = "\"800x600\" \"640x480\""; - } - else - if (config_videomemory >= 1024) { - if (card_selected != -1 && !(card[card_selected].flags & UNSUPPORTED)) { - /* - * Allow room for font/pixmap cache for accel - * servers. - */ - config_virtualx8bpp = 1024; - config_virtualy8bpp = 768; - } - else { - config_virtualx8bpp = 1152; - config_virtualy8bpp = 900; - } - config_virtualx16bpp = 800; /* Forget about cache space; */ - config_virtualy16bpp = 600; /* it's small enough as it is. */ - config_virtualx24bpp = 640; - config_virtualy24bpp = 480; - config_modesline8bpp = "\"1024x768\" \"800x600\" \"640x480\""; - config_modesline16bpp = "\"800x600\" \"640x480\""; - config_modesline24bpp = "\"640x480\""; - } - else - if (config_videomemory >= 512) { - config_virtualx8bpp = 800; - config_virtualy8bpp = 600; - config_modesline8bpp = "\"800x600\" \"640x480\""; - config_modesline16bpp = "\"640x400\""; - } - else - if (config_videomemory >= 256) { - config_modesline8bpp = "\"640x400\""; - config_virtualx8bpp = 640; - config_virtualy8bpp = 400; - } - else { - printf("Invalid amount of video memory. Please try again\n"); - return(1); - } - -#if 0 - /* - * Handle the Ramdac/Clockchip setting. - */ - - printf("%s", devicesettingscomment_text); - - if (card_selected == -1 || (card[card_selected].flags & UNSUPPORTED)) - goto skipramdacselection; - - printf("%s", ramdaccomment_text); - - /* meanwhile there are so many RAMDACs that they do no longer fit on - * on page - */ - for (np=12, i=0 ;;) { - int j; - for (j = i; j < i + np && j < NU_RAMDACS; j++) - printf("%3d %-60s%s\n", j+1, - ramdac_name[j], - ramdac_id[j]); - - printf("\n"); - if (card_selected != -1) - if (card[card_selected].ramdac != NULL) - printf("The card definition has Ramdac \"%s\".\n\n", - card[card_selected].ramdac); - printf("\n"); - printf("Enter a number to choose the corresponding RAMDAC.\n"); - printf("Press enter for the next page, q to quit without selection of a RAMDAC.\n"); - printf("\n"); - getstring(s); - - config_ramdac = NULL; - if (s[0] == 'q') - break; - - if (strlen(s) > 0) { - c = atoi(s)-1; - if (c >= 0 && c < NU_RAMDACS) { - config_ramdac = ramdac_id[atoi(s)-1]; - break; - } - } - - i += np; - if (np==12) np = 18; /* account intro lines only displayed 1st time */ - if (i >= NU_RAMDACS) - i = 0; - emptylines(); - } - -skipramdacselection: - emptylines(); - printf("%s", clockchipcomment_text); - - for (i = 0; i < NU_CLOCKCHIPS; i++) - printf("%2d %-60s%s\n", - i + 1, clockchip_name[i], clockchip_id[i]); - - printf("\n"); - - if (card_selected != -1) - if (card[card_selected].clockchip != NULL) - printf("The card definition has Clockchip \"%s\"\n\n", - card[card_selected].clockchip); - - printf("Just press enter if you don't want a Clockchip setting.\n"); - printf("What Clockchip setting do you want (1-%d)? ", NU_CLOCKCHIPS); - - getstring(s); - config_clockchip = NULL; - if (strlen(s) > 0) - config_clockchip = clockchip_id[atoi(s) - 1]; - - emptylines(); - - /* - * Optionally run X -probeonly to figure out the clocks. - */ - - config_numberofclockslines = 0; - - printf("%s", deviceclockscomment_text); - - printf("%s", deviceclocksquestion_text); -#endif - -#if 0 - /* - * XXX Change this to check for a CLOCKPROBE flag rather than an - * NOCLOCKPROBE. - */ - if (card_selected != -1) - if (card[card_selected].flags & NOCLOCKPROBE) - printf("The card definition says to NOT probe clocks.\n"); - - if (config_clockchip != NULL) { - printf("Because you have enabled a Clockchip line, there's no need for clock\n" - "probing.\n"); - keypress(); - goto skipclockprobing; - } - - printf("Do you want me to run 'X -probeonly' now? "); - getstring(s); - printf("\n"); - if (answerisyes(s)) { - /* - * Write temporary XF86Config and run X -probeonly. - * Only allow when root. - */ - FILE *f; - char *buf; - char syscmdline[2*256+100]; /* enough */ - char *fname = NULL; - char *d2name = NULL; - char *d3name = NULL; - - if (getuid() != 0) { - printf("Sorry, you must be root to do this.\n\n"); - goto endofprobeonly; - } - printf("%s", probeonlywarning_text); - keypress(); - fname = Malloc(strlen(temp_dir) + - strlen(TEMPORARY_XF86CONFIG_FILENAME) + 1); - sprintf(fname, "%s%s", temp_dir, - TEMPORARY_XF86CONFIG_FILENAME); - d2name = Malloc(strlen(temp_dir) + strlen(DUMBCONFIG2) + 1); - sprintf(d2name, "%s%s", temp_dir, DUMBCONFIG2); - d3name = Malloc(strlen(temp_dir) + strlen(DUMBCONFIG3) + 1); - sprintf(d3name, "%s%s", temp_dir, DUMBCONFIG3); - printf("Running X -probeonly -pn -xf86config %s.\n", fname); - write_XF86Config(fname); - sync(); - /* compose a line with the real path */ - sprintf(syscmdline, "X -probeonly -pn -xf86config %s 2> %s", - fname, d2name); - - if (system(syscmdline)) { - printf("X -probeonly call failed.\n"); - printf("No Clocks line inserted.\n"); - goto clocksprobefailed; - } - /* Look for 'clocks:' (case sensitive). */ - sprintf(syscmdline, "grep clocks\\: %s > %s", d2name, d3name); - if (system(syscmdline)) { - printf("grep failed.\n"); - printf("Cannot find clocks in server output.\n"); - goto clocksprobefailed; - } - f = fopen(d3name, "r"); - buf = Malloc(8192); - /* Parse lines. */ - while (fgets(buf, 8192, f) != NULL) { - char *clks; - clks = strstr(buf, "clocks: ") + 8; - if (clks >= buf + 3 && strcmp(clks - 11, "num") == 0) - /* Reject lines with 'numclocks:'. */ - continue; - if (clks >= buf + 8 && strcpy(clks - 14, "pixel ") == 0) - /* Reject lines with 'pixel clocks:'. */ - continue; - clks[strlen(clks) - 1] = '\0'; /* Remove '\n'. */ - config_clocksline[config_numberofclockslines] = - Malloc(strlen(clks) + 1); - strcpy(config_clocksline[config_numberofclockslines], - clks); - printf("Clocks %s\n", clks); - config_numberofclockslines++; - } - fclose(f); -clocksprobefailed: - unlink(d3name); - unlink(d2name); - unlink(fname); - printf("\n"); - -endofprobeonly: - keypress(); - } -skipclockprobing: -#endif - - /* - * For vga driver, no further configuration is required. - */ - if (card_selected == -1 || (card[card_selected].flags & UNSUPPORTED)) - return (0); - - /* - * Configure the modes order. - */ - config_virtual = 0; - for (;;) { - char modes[128]; - - emptylines(); - - printf("%s", modesorderintro_text); - printf("%s for 8-bit\n", config_modesline8bpp); - printf("%s for 16-bit\n", config_modesline16bpp); - printf("%s for 24-bit\n", config_modesline24bpp); - printf("\n"); - printf("%s", modesorder_text2); - - printf("Enter your choice: "); - getstring(s); - printf("\n"); - - c = atoi(s) - 1; - if (c < 0 || c >= 3) - break; - - printf("Select modes from the following list:\n\n"); - - for (i = 0; i < NU_MODESTRINGS; i++) - printf(" %c %s\n", i < 9 ? '1' + i : - 'a' + i - 9, - modestring[i]); - printf("\n"); - - printf("%s", modeslist_text); - - printf("Which modes? "); - getstring(s); - printf("\n"); - - modes[0] = '\0'; - for (i = 0; i < strlen(s); i++) { - if ( NU_MODESTRINGS > 9 ) { - if ((s[i] < '1' || s[i] > '9') && - (s[i] < 'a' || s[i] > 'a' + NU_MODESTRINGS - 10)) { - printf("Invalid mode skipped.\n"); - continue; - } - } - else { - if (s[i] < '1' || s[i] > '0' + NU_MODESTRINGS) { - printf("Invalid mode skipped.\n"); - continue; - } - } - if (i > 0) - strcat(modes, " "); - strcat(modes, modestring[s[i] <= '9' ? s[i] - '1' : - s[i] - 'a' + 9]); - } - switch (c) { - case 0 : - config_modesline8bpp = Malloc(strlen(modes) + 1); - strcpy(config_modesline8bpp, modes); - break; - case 1 : - config_modesline16bpp = Malloc(strlen(modes) + 1); - strcpy(config_modesline16bpp, modes); - break; - case 2 : - config_modesline24bpp = Malloc(strlen(modes) + 1); - strcpy(config_modesline24bpp, modes); - break; - } - - printf("%s", virtual_text); - - printf("Please answer the following question with either 'y' or 'n'.\n"); - printf("Do you want a virtual screen that is larger than the physical screen?"); - getstring(s); - if (answerisyes(s)) - config_virtual = 1; - } - return(0); -} - -static char *defaultdepthtext = -"Please specify which color depth you want to use by default:\n" -"\n"; - -static struct depth_str { - char *name; - char *desc; -} depth_list[] = { - { "1", "1 bit (monochrome)" }, - { "4", "4 bits (16 colors)" }, - { "8", "8 bits (256 colors)" }, - { "16", "16 bits (65536 colors)" }, - { "24", "24 bits (16 million colors)" } -}; - -static int ndepths = sizeof(depth_list)/sizeof(struct depth_str); - -static void -depth_configuration(void) -{ - int i; - char s[80]; - int depth; - - printf(defaultdepthtext); - for (i=0; i ndepths) ? 0 : i; - } - config_depth = depth_list[depth].name; -} - -/* - * Create the XF86Config file. - */ - -static char *XF86Config_firstchunk_text = -"# File generated by xorgconfig.\n" -"\n" -"#\n" -"# Copyright 2004 "XVENDORNAME"\n" -"#\n" -"# Permission is hereby granted, free of charge, to any person obtaining a\n" -"# copy of this software and associated documentation files (the \"Software\"),\n" -"# to deal in the Software without restriction, including without limitation\n" -"# the rights to use, copy, modify, merge, publish, distribute, sublicense,\n" -"# and/or sell copies of the Software, and to permit persons to whom the\n" -"# Software is furnished to do so, subject to the following conditions:\n" -"# \n" -"# The above copyright notice and this permission notice shall be included in\n" -"# all copies or substantial portions of the Software.\n" -"# \n" -"# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n" -"# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n" -"# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n" -"# "XVENDORNAME" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n" -"# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF\n" -"# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n" -"# SOFTWARE.\n" -"# \n" -"# Except as contained in this notice, the name of "XVENDORNAME" shall\n" -"# not be used in advertising or otherwise to promote the sale, use or other\n" -"# dealings in this Software without prior written authorization from\n" -"# "XVENDORNAME".\n" -"#\n" -"\n" -"# **********************************************************************\n" -"# Refer to the " CONFIGNAME "(" FILEMANSUFFIX ") man page for details about the format of \n" -"# this file.\n" -"# **********************************************************************\n" -"\n" -"# **********************************************************************\n" -"# Module section -- this section is used to specify\n" -"# which dynamically loadable modules to load.\n" -"# **********************************************************************\n" -"#\n" -"Section \"Module\"\n" -"\n" -"# This loads the DBE extension module.\n" -"\n" -" Load \"dbe\" # Double buffer extension\n" -"\n" -"# This loads the miscellaneous extensions module, and disables\n" -"# initialisation of the XFree86-DGA extension within that module.\n" -" SubSection \"extmod\"\n" -" Option \"omit xfree86-dga\" # don't initialise the DGA extension\n" -" EndSubSection\n" -"\n" -"# This loads the font modules\n" -#ifdef HAS_TYPE1 -" Load \"type1\"\n" -#else -"# Load \"type1\"\n" -#endif -" Load \"freetype\"\n" -"# Load \"xtt\"\n" -"\n" -"# This loads the GLX module\n" -"# Load \"glx\"\n" -"# This loads the DRI module\n" -"# Load \"dri\"\n" -"\n" -"EndSection\n" -"\n" -"# **********************************************************************\n" -"# Files section. This allows default font and rgb paths to be set\n" -"# **********************************************************************\n" -"\n" -"Section \"Files\"\n" -"\n" -"# Multiple FontPath entries are allowed (which are concatenated together),\n" -"# as well as specifying multiple comma-separated entries in one FontPath\n" -"# command (or a combination of both methods)\n" -"# \n" -"\n"; - -static char *XF86Config_fontpaths[] = -{ -/* " FontPath \"" TREEROOTFONT "/75dpi/\"\n"*/ - "/local/", - "/misc/", - "/75dpi/:unscaled", - "/100dpi/:unscaled", - "/Type1/", - "/TrueType/", - "/freefont/", - "/75dpi/", - "/100dpi/", - 0 /* end of fontpaths */ -}; - -static char *XF86Config_fontpathchunk_text = - -"\n" -"# The module search path. The default path is shown here.\n" -"\n" -"# ModulePath \"" MODULEPATH "\"\n" -"\n" -"EndSection\n" -"\n" -"# **********************************************************************\n" -"# Server flags section.\n" -"# **********************************************************************\n" -"\n" -"Section \"ServerFlags\"\n" -"\n" -"# Uncomment this to cause a core dump at the spot where a signal is \n" -"# received. This may leave the console in an unusable state, but may\n" -"# provide a better stack trace in the core dump to aid in debugging\n" -"\n" -"# Option \"NoTrapSignals\"\n" -"\n" -"# Uncomment this to disable the VT switch sequence\n" -"# (where n is 1 through 12). This allows clients to receive these key\n" -"# events.\n" -"\n" -"# Option \"DontVTSwitch\"\n" -"\n" -"# Uncomment this to disable the server abort sequence\n" -"# This allows clients to receive this key event.\n" -"\n" -"# Option \"DontZap\"\n" -"\n" -"# Uncomment this to disable the / mode switching\n" -"# sequences. This allows clients to receive these key events.\n" -"\n" -"# Option \"Dont Zoom\"\n" -"\n" -"# Uncomment this to disable tuning with the xvidtune client. With\n" -"# it the client can still run and fetch card and monitor attributes,\n" -"# but it will not be allowed to change them. If it tries it will\n" -"# receive a protocol error.\n" -"\n" -"# Option \"DisableVidModeExtension\"\n" -"\n" -"# Uncomment this to enable the use of a non-local xvidtune client. \n" -"\n" -"# Option \"AllowNonLocalXvidtune\"\n" -"\n" -"# Uncomment this to disable dynamically modifying the input device\n" -"# (mouse and keyboard) settings. \n" -"\n" -"# Option \"DisableModInDev\"\n" -"\n" -"# Uncomment this to enable the use of a non-local client to\n" -"# change the keyboard or mouse settings (currently only xset).\n" -"\n" -"# Option \"AllowNonLocalModInDev\"\n" -"\n" -"EndSection\n" -"\n" -"# **********************************************************************\n" -"# Input devices\n" -"# **********************************************************************\n" -"\n" -"# **********************************************************************\n" -"# Core keyboard's InputDevice section\n" -"# **********************************************************************\n" -"\n" -"Section \"InputDevice\"\n" -"\n" -" Identifier \"Keyboard1\"\n" -" Driver \"kbd\"\n" -"\n" -" Option \"AutoRepeat\" \"500 30\"\n" -"\n" -"# Specify which keyboard LEDs can be user-controlled (eg, with xset(1))\n" -"# Option \"Xleds\" \"1 2 3\"\n" -"\n"; - -static char *keyboardchunk2_text = -"\n"; - -static char *keyboardchunk3_text = -"# To customise the XKB settings to suit your keyboard, modify the\n" -"# lines below (which are the defaults). For example, for a non-U.S.\n" -"# keyboard, you will probably want to use:\n" -"# Option \"XkbModel\" \"pc105\"\n" -"# If you have a US Microsoft Natural keyboard, you can use:\n" -"# Option \"XkbModel\" \"microsoft\"\n" -"#\n" -"# Then to change the language, change the Layout setting.\n" -"# For example, a german layout can be obtained with:\n" -"# Option \"XkbLayout\" \"de\"\n" -"# or:\n" -"# Option \"XkbLayout\" \"de\"\n" -"# Option \"XkbVariant\" \"nodeadkeys\"\n" -"#\n" -"# If you'd like to switch the positions of your capslock and\n" -"# control keys, use:\n" -"# Option \"XkbOptions\" \"ctrl:swapcaps\"\n" -"\n" -"# These are the default XKB settings for "__XSERVERNAME__"\n" -"# Option \"XkbRules\" \""__XKBDEFRULES__"\"\n" -"# Option \"XkbModel\" \"pc105\"\n" -"# Option \"XkbLayout\" \"us\"\n" -"# Option \"XkbVariant\" \"\"\n" -"# Option \"XkbOptions\" \"\"\n" -"\n"; - -static char *keyboardlastchunk_text = -"\n" -"EndSection\n" -"\n" -"\n"; - -static char *pointersection_text1 = -"# **********************************************************************\n" -"# Core Pointer's InputDevice section\n" -"# **********************************************************************\n" -"\n" -"Section \"InputDevice\"\n" -"\n" -"# Identifier and driver\n" -"\n" -#if defined(__UNIXWARE__) -"# Identifier \"Mouse1\"\n" -"# Driver \"mouse\"\n" -#else -" Identifier \"Mouse1\"\n" -" Driver \"mouse\"\n" -#endif -; - -static char *pointersection_text2 = -"\n" -"# Mouse-speed setting for PS/2 mouse.\n" -"\n" -"# Option \"Resolution\" \"256\"\n" -"\n" -"# Baudrate and SampleRate are only for some Logitech mice. In\n" -"# almost every case these lines should be omitted.\n" -"\n" -"# Option \"BaudRate\" \"9600\"\n" -"# Option \"SampleRate\" \"150\"\n" -"\n" -"# Mouse wheel mapping. Default is to map vertical wheel to buttons 4 & 5,\n" -"# horizontal wheel to buttons 6 & 7. Change if your mouse has more than\n" -"# 3 buttons and you need to map the wheel to different button ids to avoid\n" -"# conflicts.\n" -"\n" -" Option \"ZAxisMapping\" \"4 5 6 7\"\n" -"\n" -"# Emulate3Buttons is an option for 2-button mice\n" -"# Emulate3Timeout is the timeout in milliseconds (default is 50ms)\n" -"\n"; - - -static char *xinputsection_text = -"# **********************************************************************\n" -"# Other input device sections \n" -"# this is optional and is required only if you\n" -"# are using extended input devices. This is for example only. Refer\n" -"# to the " CONFIGNAME " man page for a description of the options.\n" -"# **********************************************************************\n" -"#\n" -"# Section \"InputDevice\" \n" -"# Identifier \"Mouse2\"\n" -"# Driver \"mouse\"\n" -"# Option \"Protocol\" \"MouseMan\"\n" -"# Option \"Device\" \"/dev/mouse2\"\n" -"# EndSection\n" -"#\n" -"# Section \"InputDevice\"\n" -"# Identifier \"spaceball\"\n" -"# Driver \"magellan\"\n" -"# Option \"Device\" \"/dev/cua0\"\n" -"# EndSection\n" -"#\n" -"# Section \"InputDevice\"\n" -"# Identifier \"spaceball2\"\n" -"# Driver \"spaceorb\"\n" -"# Option \"Device\" \"/dev/cua0\"\n" -"# EndSection\n" -"#\n" -"# Section \"InputDevice\"\n" -"# Identifier \"touchscreen0\"\n" -"# Driver \"microtouch\"\n" -"# Option \"Device\" \"/dev/ttyS0\"\n" -"# Option \"MinX\" \"1412\"\n" -"# Option \"MaxX\" \"15184\"\n" -"# Option \"MinY\" \"15372\"\n" -"# Option \"MaxY\" \"1230\"\n" -"# Option \"ScreenNumber\" \"0\"\n" -"# Option \"ReportingMode\" \"Scaled\"\n" -"# Option \"ButtonNumber\" \"1\"\n" -"# Option \"SendCoreEvents\"\n" -"# EndSection\n" -"#\n" -"# Section \"InputDevice\"\n" -"# Identifier \"touchscreen1\"\n" -"# Driver \"elo2300\"\n" -"# Option \"Device\" \"/dev/ttyS0\"\n" -"# Option \"MinX\" \"231\"\n" -"# Option \"MaxX\" \"3868\"\n" -"# Option \"MinY\" \"3858\"\n" -"# Option \"MaxY\" \"272\"\n" -"# Option \"ScreenNumber\" \"0\"\n" -"# Option \"ReportingMode\" \"Scaled\"\n" -"# Option \"ButtonThreshold\" \"17\"\n" -"# Option \"ButtonNumber\" \"1\"\n" -"# Option \"SendCoreEvents\"\n" -"# EndSection\n" -"\n"; - -static char *monitorsection_text1 = -"# **********************************************************************\n" -"# Monitor section\n" -"# **********************************************************************\n" -"\n" -"# Any number of monitor sections may be present\n" -"\n" -"Section \"Monitor\"\n" -"\n"; - -static char *monitorsection_text2 = -"# HorizSync is in kHz unless units are specified.\n" -"# HorizSync may be a comma separated list of discrete values, or a\n" -"# comma separated list of ranges of values.\n" -"# NOTE: THE VALUES HERE ARE EXAMPLES ONLY. REFER TO YOUR MONITOR\'S\n" -"# USER MANUAL FOR THE CORRECT NUMBERS.\n" -"\n"; - -static char *monitorsection_text3 = -"# HorizSync 30-64 # multisync\n" -"# HorizSync 31.5, 35.2 # multiple fixed sync frequencies\n" -"# HorizSync 15-25, 30-50 # multiple ranges of sync frequencies\n" -"\n" -"# VertRefresh is in Hz unless units are specified.\n" -"# VertRefresh may be a comma separated list of discrete values, or a\n" -"# comma separated list of ranges of values.\n" -"# NOTE: THE VALUES HERE ARE EXAMPLES ONLY. REFER TO YOUR MONITOR\'S\n" -"# USER MANUAL FOR THE CORRECT NUMBERS.\n" -"\n"; - -#if 0 -static char *monitorsection_text4 = -"# Modes can be specified in two formats. A compact one-line format, or\n" -"# a multi-line format.\n" -"\n" -"# These two are equivalent\n" -"\n" -"# ModeLine \"1024x768i\" 45 1024 1048 1208 1264 768 776 784 817 Interlace\n" -"\n" -"# Mode \"1024x768i\"\n" -"# DotClock 45\n" -"# HTimings 1024 1048 1208 1264\n" -"# VTimings 768 776 784 817\n" -"# Flags \"Interlace\"\n" -"# EndMode\n" -"\n"; - -static char *modelines_text = -"# This is a set of standard mode timings. Modes that are out of monitor spec\n" -"# are automatically deleted by the server (provided the HorizSync and\n" -"# VertRefresh lines are correct), so there's no immediate need to\n" -"# delete mode timings (unless particular mode timings don't work on your\n" -"# monitor). With these modes, the best standard mode that your monitor\n" -"# and video card can support for a given resolution is automatically\n" -"# used.\n" -"\n" -"# 640x400 @ 70 Hz, 31.5 kHz hsync\n" -"Modeline \"640x400\" 25.175 640 664 760 800 400 409 411 450\n" -"# 640x480 @ 60 Hz, 31.5 kHz hsync\n" -"Modeline \"640x480\" 25.175 640 664 760 800 480 491 493 525\n" -"# 800x600 @ 56 Hz, 35.15 kHz hsync\n" -"ModeLine \"800x600\" 36 800 824 896 1024 600 601 603 625\n" -"# 1024x768 @ 87 Hz interlaced, 35.5 kHz hsync\n" -"Modeline \"1024x768\" 44.9 1024 1048 1208 1264 768 776 784 817 Interlace\n" -"\n" -"# 640x400 @ 85 Hz, 37.86 kHz hsync\n" -"Modeline \"640x400\" 31.5 640 672 736 832 400 401 404 445 -HSync +VSync\n" -"# 640x480 @ 72 Hz, 36.5 kHz hsync\n" -"Modeline \"640x480\" 31.5 640 680 720 864 480 488 491 521\n" -"# 640x480 @ 75 Hz, 37.50 kHz hsync\n" -"ModeLine \"640x480\" 31.5 640 656 720 840 480 481 484 500 -HSync -VSync\n" -"# 800x600 @ 60 Hz, 37.8 kHz hsync\n" -"Modeline \"800x600\" 40 800 840 968 1056 600 601 605 628 +hsync +vsync\n" -"\n" -"# 640x480 @ 85 Hz, 43.27 kHz hsync\n" -"Modeline \"640x480\" 36 640 696 752 832 480 481 484 509 -HSync -VSync\n" -"# 1152x864 @ 89 Hz interlaced, 44 kHz hsync\n" -"ModeLine \"1152x864\" 65 1152 1168 1384 1480 864 865 875 985 Interlace\n" -"\n" -"# 800x600 @ 72 Hz, 48.0 kHz hsync\n" -"Modeline \"800x600\" 50 800 856 976 1040 600 637 643 666 +hsync +vsync\n" -"# 1024x768 @ 60 Hz, 48.4 kHz hsync\n" -"Modeline \"1024x768\" 65 1024 1032 1176 1344 768 771 777 806 -hsync -vsync\n" -"\n" -"# 640x480 @ 100 Hz, 53.01 kHz hsync\n" -"Modeline \"640x480\" 45.8 640 672 768 864 480 488 494 530 -HSync -VSync\n" -"# 1152x864 @ 60 Hz, 53.5 kHz hsync\n" -"Modeline \"1152x864\" 89.9 1152 1216 1472 1680 864 868 876 892 -HSync -VSync\n" -"# 800x600 @ 85 Hz, 55.84 kHz hsync\n" -"Modeline \"800x600\" 60.75 800 864 928 1088 600 616 621 657 -HSync -VSync\n" -"\n" -"# 1024x768 @ 70 Hz, 56.5 kHz hsync\n" -"Modeline \"1024x768\" 75 1024 1048 1184 1328 768 771 777 806 -hsync -vsync\n" -"# 1280x1024 @ 87 Hz interlaced, 51 kHz hsync\n" -"Modeline \"1280x1024\" 80 1280 1296 1512 1568 1024 1025 1037 1165 Interlace\n" -"\n" -"# 800x600 @ 100 Hz, 64.02 kHz hsync\n" -"Modeline \"800x600\" 69.65 800 864 928 1088 600 604 610 640 -HSync -VSync\n" -"# 1024x768 @ 76 Hz, 62.5 kHz hsync\n" -"Modeline \"1024x768\" 85 1024 1032 1152 1360 768 784 787 823\n" -"# 1152x864 @ 70 Hz, 62.4 kHz hsync\n" -"Modeline \"1152x864\" 92 1152 1208 1368 1474 864 865 875 895\n" -"# 1280x1024 @ 61 Hz, 64.2 kHz hsync\n" -"Modeline \"1280x1024\" 110 1280 1328 1512 1712 1024 1025 1028 1054\n" -"\n" -"# 1024x768 @ 85 Hz, 70.24 kHz hsync\n" -"Modeline \"1024x768\" 98.9 1024 1056 1216 1408 768 782 788 822 -HSync -VSync\n" -"# 1152x864 @ 78 Hz, 70.8 kHz hsync\n" -"Modeline \"1152x864\" 110 1152 1240 1324 1552 864 864 876 908\n" -"\n" -"# 1280x1024 @ 70 Hz, 74.59 kHz hsync\n" -"Modeline \"1280x1024\" 126.5 1280 1312 1472 1696 1024 1032 1040 1068 -HSync -VSync\n" -"# 1600x1200 @ 60Hz, 75.00 kHz hsync\n" -"Modeline \"1600x1200\" 162 1600 1664 1856 2160 1200 1201 1204 1250 +HSync +VSync\n" -"# 1152x864 @ 84 Hz, 76.0 kHz hsync\n" -"Modeline \"1152x864\" 135 1152 1464 1592 1776 864 864 876 908\n" -"\n" -"# 1280x1024 @ 74 Hz, 78.85 kHz hsync\n" -"Modeline \"1280x1024\" 135 1280 1312 1456 1712 1024 1027 1030 1064\n" -"\n" -"# 1024x768 @ 100Hz, 80.21 kHz hsync\n" -"Modeline \"1024x768\" 115.5 1024 1056 1248 1440 768 771 781 802 -HSync -VSync\n" -"# 1280x1024 @ 76 Hz, 81.13 kHz hsync\n" -"Modeline \"1280x1024\" 135 1280 1312 1416 1664 1024 1027 1030 1064\n" -"\n" -"# 1600x1200 @ 70 Hz, 87.50 kHz hsync\n" -"Modeline \"1600x1200\" 189 1600 1664 1856 2160 1200 1201 1204 1250 -HSync -VSync\n" -"# 1152x864 @ 100 Hz, 89.62 kHz hsync\n" -"Modeline \"1152x864\" 137.65 1152 1184 1312 1536 864 866 885 902 -HSync -VSync\n" -"# 1280x1024 @ 85 Hz, 91.15 kHz hsync\n" -"Modeline \"1280x1024\" 157.5 1280 1344 1504 1728 1024 1025 1028 1072 +HSync +VSync\n" -"# 1600x1200 @ 75 Hz, 93.75 kHz hsync\n" -"Modeline \"1600x1200\" 202.5 1600 1664 1856 2160 1200 1201 1204 1250 +HSync +VSync\n" -"# 1600x1200 @ 85 Hz, 105.77 kHz hsync\n" -"Modeline \"1600x1200\" 220 1600 1616 1808 2080 1200 1204 1207 1244 +HSync +VSync\n" -"# 1280x1024 @ 100 Hz, 107.16 kHz hsync\n" -"Modeline \"1280x1024\" 181.75 1280 1312 1440 1696 1024 1031 1046 1072 -HSync -VSync\n" -"\n" -"# 1800x1440 @ 64Hz, 96.15 kHz hsync \n" -"ModeLine \"1800X1440\" 230 1800 1896 2088 2392 1440 1441 1444 1490 +HSync +VSync\n" -"# 1800x1440 @ 70Hz, 104.52 kHz hsync \n" -"ModeLine \"1800X1440\" 250 1800 1896 2088 2392 1440 1441 1444 1490 +HSync +VSync\n" -"\n" -"# 512x384 @ 78 Hz, 31.50 kHz hsync\n" -"Modeline \"512x384\" 20.160 512 528 592 640 384 385 388 404 -HSync -VSync\n" -"# 512x384 @ 85 Hz, 34.38 kHz hsync\n" -"Modeline \"512x384\" 22 512 528 592 640 384 385 388 404 -HSync -VSync\n" -"\n" -#if XFREE86_VERSION >= 311 -"# Low-res Doublescan modes\n" -"# If your chipset does not support doublescan, you get a 'squashed'\n" -"# resolution like 320x400.\n" -"\n" -"# 320x200 @ 70 Hz, 31.5 kHz hsync, 8:5 aspect ratio\n" -"Modeline \"320x200\" 12.588 320 336 384 400 200 204 205 225 Doublescan\n" -"# 320x240 @ 60 Hz, 31.5 kHz hsync, 4:3 aspect ratio\n" -"Modeline \"320x240\" 12.588 320 336 384 400 240 245 246 262 Doublescan\n" -"# 320x240 @ 72 Hz, 36.5 kHz hsync\n" -"Modeline \"320x240\" 15.750 320 336 384 400 240 244 246 262 Doublescan\n" -"# 400x300 @ 56 Hz, 35.2 kHz hsync, 4:3 aspect ratio\n" -"ModeLine \"400x300\" 18 400 416 448 512 300 301 302 312 Doublescan\n" -"# 400x300 @ 60 Hz, 37.8 kHz hsync\n" -"Modeline \"400x300\" 20 400 416 480 528 300 301 303 314 Doublescan\n" -"# 400x300 @ 72 Hz, 48.0 kHz hsync\n" -"Modeline \"400x300\" 25 400 424 488 520 300 319 322 333 Doublescan\n" -"# 480x300 @ 56 Hz, 35.2 kHz hsync, 8:5 aspect ratio\n" -"ModeLine \"480x300\" 21.656 480 496 536 616 300 301 302 312 Doublescan\n" -"# 480x300 @ 60 Hz, 37.8 kHz hsync\n" -"Modeline \"480x300\" 23.890 480 496 576 632 300 301 303 314 Doublescan\n" -"# 480x300 @ 63 Hz, 39.6 kHz hsync\n" -"Modeline \"480x300\" 25 480 496 576 632 300 301 303 314 Doublescan\n" -"# 480x300 @ 72 Hz, 48.0 kHz hsync\n" -"Modeline \"480x300\" 29.952 480 504 584 624 300 319 322 333 Doublescan\n" -"\n" -#endif -; -#endif - -static char *devicesection_text = -"# **********************************************************************\n" -"# Graphics device section\n" -"# **********************************************************************\n" -"\n" -"# Any number of graphics device sections may be present\n" -"\n" -"# Standard VGA Device:\n" -"\n" -"Section \"Device\"\n" -" Identifier \"Standard VGA\"\n" -" VendorName \"Unknown\"\n" -" BoardName \"Unknown\"\n" -"\n" -"# The chipset line is optional in most cases. It can be used to override\n" -"# the driver's chipset detection, and should not normally be specified.\n" -"\n" -"# Chipset \"generic\"\n" -"\n" -"# The Driver line must be present. When using run-time loadable driver\n" -"# modules, this line instructs the server to load the specified driver\n" -"# module. Even when not using loadable driver modules, this line\n" -"# indicates which driver should interpret the information in this section.\n" -"\n" -" Driver \"vga\"\n" -"# The BusID line is used to specify which of possibly multiple devices\n" -"# this section is intended for. When this line isn't present, a device\n" -"# section can only match up with the primary video device. For PCI\n" -"# devices a line like the following could be used. This line should not\n" -"# normally be included unless there is more than one video device\n" -"# intalled.\n" -"\n" -"# BusID \"PCI:0:10:0\"\n" -"\n" -"# VideoRam 256\n" -"\n" -"# Clocks 25.2 28.3\n" -"\n" -"EndSection\n" -"\n" -"# Device configured by xorgconfig:\n" -"\n"; - -static char *screensection_text1 = -"# **********************************************************************\n" -"# Screen sections\n" -"# **********************************************************************\n" -"\n" -"# Any number of screen sections may be present. Each describes\n" -"# the configuration of a single screen. A single specific screen section\n" -"# may be specified from the X server command line with the \"-screen\"\n" -"# option.\n"; - -static char *serverlayout_section_text1 = -"# **********************************************************************\n" -"# ServerLayout sections.\n" -"# **********************************************************************\n" -"\n" -"# Any number of ServerLayout sections may be present. Each describes\n" -"# the way multiple screens are organised. A specific ServerLayout\n" -"# section may be specified from the X server command line with the\n" -"# \"-layout\" option. In the absence of this, the first section is used.\n" -"# When now ServerLayout section is present, the first Screen section\n" -"# is used alone.\n" -"\n" -"Section \"ServerLayout\"\n" -"\n" -"# The Identifier line must be present\n" -" Identifier \"Simple Layout\"\n" -"\n" -"# Each Screen line specifies a Screen section name, and optionally\n" -"# the relative position of other screens. The four names after\n" -"# primary screen name are the screens to the top, bottom, left and right\n" -"# of the primary screen. In this example, screen 2 is located to the\n" -"# right of screen 1.\n" -"\n"; - -static char *serverlayout_section_text2 = -"\n" -"# Each InputDevice line specifies an InputDevice section name and\n" -"# optionally some options to specify the way the device is to be\n" -"# used. Those options include \"CorePointer\", \"CoreKeyboard\" and\n" -"# \"SendCoreEvents\".\n" -"\n" -" InputDevice \"Mouse1\" \"CorePointer\"\n" -" InputDevice \"Keyboard1\" \"CoreKeyboard\"\n" -"\n" -"EndSection\n" -"\n" -"# Section \"DRI\"\n" -"# Mode 0666\n" -"# EndSection\n" -"\n"; - -static void -write_fontpath_section(FILE *f) -{ - /* this will create the Fontpath lines, but only after checking, - * that the corresponding dir exists (was THE absolute problem - * users had with XFree86/OS2 3.1.2D !) - */ - int i; - char cur[256+20],*colon, *hash; - -#ifdef COMPILEDDEFAULTFONTPATH - static const char dfp[] = COMPILEDDEFAULTFONTPATH; - const char *thisdir; - const char *nextdir; - int len; - - for (thisdir = dfp; thisdir != NULL; thisdir = nextdir) { - nextdir = strchr(thisdir, ','); - if (nextdir == NULL) { - len = strlen(thisdir); - } else { - len = nextdir - thisdir; - nextdir++; - } - if (len >= sizeof(cur)) - continue; - strncpy(cur, thisdir, len); - cur[len] = '\0'; - colon = strchr(cur+2,':'); /* OS/2: C:/...:scaled */ - if (colon) *colon = 0; - hash = exists_dir(cur) ? "" : "#"; - if (colon) *colon = ':'; - fprintf(f,"%s FontPath \"%s\"\n", hash, cur); - } -#endif - - for (i=0; XF86Config_fontpaths[i]; i++) { - strcpy(cur,TREEROOTFONT); - strcat(cur,XF86Config_fontpaths[i]); - /* remove a ':' */ - colon = strchr(cur+2,':'); /* OS/2: C:/...:scaled */ - if (colon) *colon = 0; -#ifdef COMPILEDDEFAULTFONTPATH - /* skip if we already added it as part of the default font path */ - if (strstr(dfp, cur) != NULL) - continue; -#endif - hash = exists_dir(cur) ? "" : "#"; - fprintf(f,"%s FontPath \"%s%s\"\n", - hash, - TREEROOTFONT, - XF86Config_fontpaths[i]); - } -} - -static int -write_XF86Config(char *filename) -{ - FILE *f; - - /* - * Write the file. - */ - - f = fopen(filename, "w"); - if (f == NULL) { - printf("Failed to open filename for writing.\n"); - if (getuid() != 0) - printf("Maybe you need to be root to write to the specified directory?\n"); - return(1); - } - - fprintf(f, "%s", XF86Config_firstchunk_text); - write_fontpath_section(f); - fprintf(f, "%s", XF86Config_fontpathchunk_text); - - /* - * Write keyboard section. - */ - if (config_altmeta) { - fprintf(f, " Option \"LeftAlt\" \"Meta\"\n"); - fprintf(f, " Option \"RightAlt\" \"ModeShift\"\n"); - } - else { - fprintf(f, "# Option \"LeftAlt\" \"Meta\"\n"); - fprintf(f, "# Option \"RightAlt\" \"ModeShift\"\n"); - } -#if defined(__OpenBSD__) && defined(WSCONS_SUPPORT) && !defined(PCVT_SUPPORT) - /* wscons keyoards need a protocol line */ - fprintf(f, " Option \"Protocol\" \"wskbd\"\n"); - fprintf(f, " Option \"Device\" \"%s\"\n", config_keyboard_dev); - fprintf(f, " Option \"XkbKeycodes\" \"wscons(ppc)\"\n"); -#endif - fprintf(f, "%s", keyboardchunk2_text); - - fprintf(f, "%s", keyboardchunk3_text); - if (config_xkbdisable) { - fprintf(f, " Option \"XkbDisable\"\n\n"); - } else { - fprintf(f, "# Option \"XkbDisable\"\n\n"); - } - fprintf(f, " Option \"XkbRules\" \"%s\"\n", - config_xkbrules); - fprintf(f, " Option \"XkbModel\" \"%s\"\n", - config_xkbmodel); - fprintf(f, " Option \"XkbLayout\" \"%s\"\n", - config_xkblayout); - if (config_xkbvariant) - fprintf(f, " Option \"XkbVariant\" \"%s\"\n", - config_xkbvariant); - if (config_xkboptions) - fprintf(f, " Option \"XkbOptions\" \"%s\"\n", - config_xkboptions); - - fprintf(f, "%s",keyboardlastchunk_text); - - /* - * Write pointer section. - */ - fprintf(f, "%s", pointersection_text1); - fprintf(f, " Option \"Protocol\" \"%s\"\t# %s\n", - mouse_info[config_mousetype].name, - mouse_info[config_mousetype].desc); -#if !defined(QNX4) - fprintf(f, " Option \"Device\" \"%s\"\n", config_pointerdevice); -#endif - fprintf(f, "%s", pointersection_text2); - if (!config_emulate3buttons) - fprintf(f, "#"); - fprintf(f, " Option \"Emulate3Buttons\"\n"); - fprintf(f, "# Option \"Emulate3Timeout\" \"50\"\n\n"); - fprintf(f, "# ChordMiddle is an option for some 3-button Logitech mice\n\n"); - if (!config_chordmiddle) - fprintf(f, "#"); - fprintf(f, " Option \"ChordMiddle\"\n\n"); - if (config_cleardtrrts) { - fprintf(f, " Option \"ClearDTR\"\n"); - fprintf(f, " Option \"ClearRTS\"\n\n"); - } - fprintf(f, "EndSection\n\n\n"); - - /* - * Write XInput sample section - */ - fprintf(f, "%s", xinputsection_text); - - /* - * Write monitor section. - */ - fprintf(f, "%s", monitorsection_text1); - fprintf(f, " Identifier \"%s\"\n", config_monitoridentifier); - fprintf(f, "\n"); - fprintf(f, "%s", monitorsection_text2); - fprintf(f, " HorizSync %s\n", config_hsyncrange); - fprintf(f, "\n"); - fprintf(f, "%s", monitorsection_text3); - fprintf(f, " VertRefresh %s\n", config_vsyncrange); - fprintf(f, "\n"); -#if 0 - fprintf(f, "%s", monitorsection_text4); - fprintf(f, "%s", modelines_text); -#endif - fprintf(f, "EndSection\n\n\n"); - - /* - * Write Device section. - */ - - fprintf(f, "%s", devicesection_text); - fprintf(f, "Section \"Device\"\n"); - fprintf(f, " Identifier \"%s\"\n", config_deviceidentifier); - if (card_selected != -1) { - fprintf(f, " Driver \"%s\"\n", card[card_selected].driver); - if (card[card_selected].flags & UNSUPPORTED) { - fprintf(f, " # unsupported card\n"); - } - } else { - fprintf(f, " Driver \"vga\"\n" - " # unsupported card\n"); - } - /* Rely on server to detect video memory. */ - fprintf(f, " #VideoRam %d\n", config_videomemory); - if (card_selected != -1) - /* Add comment lines from card definition. */ - fprintf(f, card[card_selected].lines); - if (config_ramdac != NULL) - fprintf(f, " Ramdac \"%s\"\n", config_ramdac); - if (card_selected != -1) - if (card[card_selected].dacspeed != NULL) - fprintf(f, " Dacspeed %s\n", - card[card_selected].dacspeed); - if (config_clockchip != NULL) - fprintf(f, " Clockchip \"%s\"\n", config_clockchip); - else - if (config_numberofclockslines == 0) - fprintf(f, " # Insert Clocks lines here if appropriate\n"); - else { - int i; - for (i = 0; i < config_numberofclockslines; i++) - fprintf(f, " Clocks %s\n", config_clocksline[i]); - } - fprintf(f, "EndSection\n\n\n"); - - /* - * Write Screen sections. - */ - - fprintf(f, "%s", screensection_text1); - - fprintf(f, - "Section \"Screen\"\n" - " Identifier \"Screen 1\"\n" - " Device \"%s\"\n" - " Monitor \"%s\"\n" - " DefaultDepth %s\n" - "\n" - " Subsection \"Display\"\n" - " Depth 8\n" - " Modes %s\n" - " ViewPort 0 0\n", - config_deviceidentifier, - config_monitoridentifier, - config_depth, - config_modesline8bpp); - if (config_virtual) - fprintf(f, " Virtual %d %d\n", - config_virtualx8bpp, config_virtualy8bpp); - fprintf(f, - " EndSubsection\n" - " Subsection \"Display\"\n" - " Depth 16\n" - " Modes %s\n" - " ViewPort 0 0\n", - config_modesline16bpp); - if (config_virtual) - fprintf(f, " Virtual %d %d\n", - config_virtualx16bpp, config_virtualy16bpp); - fprintf(f, - " EndSubsection\n" - " Subsection \"Display\"\n" - " Depth 24\n" - " Modes %s\n" - " ViewPort 0 0\n", - config_modesline24bpp); - if (config_virtual) - fprintf(f, " Virtual %d %d\n", - config_virtualx24bpp, config_virtualy24bpp); - fprintf(f, - " EndSubsection\n" - "EndSection\n" - "\n"); - - /* - * ServerLayout section - */ - - fprintf(f, serverlayout_section_text1); - /* replace with screen config */ - fprintf(f, " Screen \"Screen 1\"\n"); - - fprintf(f, serverlayout_section_text2); - - fclose(f); - return(0); -} - -static char * -append_version(char *name) -{ -#ifdef APPEND_VERSION_TO_CONFIG_NAME - char *ret = NULL; - - if (XF86_VERSION_MAJOR > 9 || XF86_VERSION_MAJOR < 0) - return name; - - ret = Malloc(strlen(name) + 2 + 1); - sprintf(ret, "%s-%d", name, XF86_VERSION_MAJOR); - free(name); - return ret; -#else - return name; -#endif -} - -/* - * Ask where to write XF86Config to. Returns filename. - */ - -static char * -ask_XF86Config_location(void) { - char s[80]; - char *filename = NULL; - - printf( -"I am going to write the " CONFIGNAME " file now. Make sure you don't accidently\n" -"overwrite a previously configured one.\n\n"); - - if (getuid() == 0) { -#ifdef PREFER_XF86CONFIG_IN_ETC - filename = Strdup("/etc/X11/" XCONFIGFILE); - filename = append_version(filename); - printf("Shall I write it to %s? ", filename); - getstring(s); - printf("\n"); - if (answerisyes(s)) - return filename; -#endif - - if (filename) - free(filename); - filename = Strdup(TREEROOTCFG "/" XCONFIGFILE); - filename = append_version(filename); - printf("Please answer the following question with either 'y' or 'n'.\n"); - printf("Shall I write it to the default location, %s? ", filename); - getstring(s); - printf("\n"); - if (answerisyes(s)) - return filename; - -#ifndef PREFER_XF86CONFIG_IN_ETC - if (filename) - free(filename); - filename = Strdup("/etc/X11/" XCONFIGFILE); - filename = append_version(filename); - printf("Shall I write it to %s? ", filename); - getstring(s); - printf("\n"); - if (answerisyes(s)) - return filename; -#endif - } - - if (filename) - free(filename); - filename = Strdup(XCONFIGFILE); - filename = append_version(filename); - printf("Do you want it written to the current directory as '%s'? ", filename); - getstring(s); - printf("\n"); - if (answerisyes(s)) { - return filename; - } - - printf("Please give a filename to write to: "); - getstring(s); - printf("\n"); - if (filename) - free(filename); - filename = Strdup(s); - return filename; -} - - -/* - * Check if an earlier version of XFree86 is installed; warn about proper - * search path order in that case. - */ - -static char *notinstalled_text = -"The directory " TREEROOT " does not exist. This probably means that you have\n" -"not yet installed the version of "__XSERVERNAME__" that this program was built\n" -"to configure. Please install "__XSERVERNAME__" "XVERSIONSTRING" before running this program,\n" -"following the instructions in the INSTALL or README that comes with the\n" -__XSERVERNAME__" distribution for your OS.\n" -"For a minimal installation it is sufficient to only install base binaries,\n" -"libraries, configuration files and a server that you want to use.\n" -"\n"; - -static char *oldxfree86_text = -"The directory '/usr/X386/bin' exists. You probably have a very old version of\n" -"XFree86 installed, but this program was built to configure "__XSERVERNAME__" "XVERSIONSTRING"\n" -"installed in '" TREEROOT "' instead of '/usr/X386'.\n" -"\n" -"It is important that the directory '" TREEROOT "' is present in your\n" -"search path, *before* any occurrence of '/usr/X386/bin'. If you have installed\n" -"X program binaries that are not in the base "__XSERVERNAME__" distribution in\n" -"'/usr/X386/bin', you can keep the directory in your path as long as it is\n" -"after '" TREEROOT "'.\n" -"\n"; - -static char *pathnote_text = -"Note that the X binary directory in your path may be a symbolic link.\n" -"In that case you could modify the symbolic link to point to the new binaries.\n" -"Example: 'rm -f /usr/bin/X11; ln -s /usr/X11R6/bin /usr/bin/X11', if the\n" -"link is '/usr/bin/X11'.\n" -"\n" -"Make sure the path is OK before continuing.\n"; - -static void -path_check(void) { - char s[80]; - int ok; - - ok = exists_dir(TREEROOT); - if (!ok) { - printf("%s", notinstalled_text); - printf("Do you want to continue? "); - getstring(s); - if (!answerisyes(s)) - exit(-1); - printf("\n"); - } - - ok = exists_dir("/usr/X386/bin"); - if (!ok) - return; - - printf("%s", oldxfree86_text); - printf("Your PATH is currently set as follows:\n%s\n\n", - getenv("PATH")); - printf("%s", pathnote_text); - keypress(); -} - - -static void -configdir_check(void) -{ - /* /etc/X11 may not exist on some systems */ - if (getuid() == 0) { - struct stat buf; - if (stat("/etc/X11", &buf) == -1 && errno == ENOENT) - mkdir("/etc/X11", 0777); - if (stat(TREEROOTCFG, &buf) == -1 && errno == ENOENT) - mkdir(TREEROOTCFG, 0777); - } -} - - -/* - * Program entry point. - */ - -int -main(int argc, char *argv[]) { - - createtmpdir(); - - emptylines(); - - printf("%s", intro_text); - - keypress(); - emptylines(); - - path_check(); - - emptylines(); - - configdir_check(); - - emptylines(); - - mouse_configuration(); - - emptylines(); - - keyboard_configuration(); - - emptylines(); - - monitor_configuration(); - - emptylines(); - - carddb_configuration(); - - emptylines(); - - while(screen_configuration()){}; - - emptylines(); - - depth_configuration(); - - emptylines(); - - while(write_XF86Config(ask_XF86Config_location())){}; - - printf("%s", finalcomment_text); - - exit(0); -} diff --git a/hw/xfree86/utils/xorgconfig/xorgconfig.man.pre b/hw/xfree86/utils/xorgconfig/xorgconfig.man.pre deleted file mode 100644 index b3d656cfa..000000000 --- a/hw/xfree86/utils/xorgconfig/xorgconfig.man.pre +++ /dev/null @@ -1,22 +0,0 @@ -.\" $XdotOrg: $ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/xf86config/xorgconfig.man,v 1.5 2001/11/01 23:35:34 dawes Exp $ -.TH xorgconfig 1 __vendorversion__ -.SH NAME -xorgconfig \- generate an __XCONFIGFILE__ file -.SH SYNOPSIS -.B xorgconfig -.SH DESCRIPTION -\fIxorgconfig\fP is an interactive program for generating an __XCONFIGFILE__ file -for use with __XSERVERNAME__ X servers. -.PP -Note that the default name used by \fIxorgconfig\fP for the __XCONFIGFILE__ file -is system-dependent. For instance, on OS/2, XConfig is used. -.SH FILES -.TP -.I __projectroot__/lib/X11/Cards -Video cards database -.SH "SEE ALSO" -__XSERVERNAME__(1), __XCONFIGFILE__(__filemansuffix__), xorgcfg(1), reconfig(1) -.SH AUTHOR -Harm Hanemaayer. -.\" $TOG: xf86conf.man /main/9 1997/07/19 10:53:08 kaleb $ From 9e5b3deafb97ec1f83e6bfe067bc68df7385bc6a Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 24 Jun 2008 14:08:04 -0400 Subject: [PATCH 29/83] Bug #11842: Fix emulation of int1A PCI BIOS services. Use only %di to name the PCI register to read/write, rather than %edi. DOS is only expecting the base PCI config space anyway, and the BIOS might be using the high bits of %edi. --- hw/xfree86/int10/xf86int10.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/xfree86/int10/xf86int10.c b/hw/xfree86/int10/xf86int10.c index 535978b89..f50607cfc 100644 --- a/hw/xfree86/int10/xf86int10.c +++ b/hw/xfree86/int10/xf86int10.c @@ -730,7 +730,7 @@ int1A_handler(xf86Int10InfoPtr pInt) return 1; case 0xb108: if ((dev = findPci(pInt, X86_EBX)) != NULL) { - pci_device_cfg_read_u8(dev, & X86_CL, X86_EDI); + pci_device_cfg_read_u8(dev, & X86_CL, X86_DI); X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */ } else { @@ -743,7 +743,7 @@ int1A_handler(xf86Int10InfoPtr pInt) return 1; case 0xb109: if ((dev = findPci(pInt, X86_EBX)) != NULL) { - pci_device_cfg_read_u16(dev, & X86_CX, X86_EDI); + pci_device_cfg_read_u16(dev, & X86_CX, X86_DI); X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */ } else { @@ -756,7 +756,7 @@ int1A_handler(xf86Int10InfoPtr pInt) return 1; case 0xb10a: if ((dev = findPci(pInt, X86_EBX)) != NULL) { - pci_device_cfg_read_u32(dev, & X86_ECX, X86_EDI); + pci_device_cfg_read_u32(dev, & X86_ECX, X86_DI); X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */ } else { @@ -769,7 +769,7 @@ int1A_handler(xf86Int10InfoPtr pInt) return 1; case 0xb10b: if ((dev = findPci(pInt, X86_EBX)) != NULL) { - pci_device_cfg_write_u8(dev, X86_CL, X86_EDI); + pci_device_cfg_write_u8(dev, X86_CL, X86_DI); X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */ } else { @@ -782,7 +782,7 @@ int1A_handler(xf86Int10InfoPtr pInt) return 1; case 0xb10c: if ((dev = findPci(pInt, X86_EBX)) != NULL) { - pci_device_cfg_write_u16(dev, X86_CX, X86_EDI); + pci_device_cfg_write_u16(dev, X86_CX, X86_DI); X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */ } else { @@ -795,7 +795,7 @@ int1A_handler(xf86Int10InfoPtr pInt) return 1; case 0xb10d: if ((dev = findPci(pInt, X86_EBX)) != NULL) { - pci_device_cfg_write_u32(dev, X86_ECX, X86_EDI); + pci_device_cfg_write_u32(dev, X86_ECX, X86_DI); X86_EAX = X86_AL | (SUCCESSFUL << 8); X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */ } else { From 249c892784ca5e8c75863dd82097ca2bedec4723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20B=C3=A4r?= Date: Tue, 24 Jun 2008 14:13:02 -0400 Subject: [PATCH 30/83] Bug #11857: Avoid running off the end of a MAXCLIENTS-sized array. --- XTrap/xtrapdi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XTrap/xtrapdi.c b/XTrap/xtrapdi.c index 52bd57aee..a4ba45b5f 100644 --- a/XTrap/xtrapdi.c +++ b/XTrap/xtrapdi.c @@ -487,7 +487,7 @@ int XETrapCreateEnv(ClientPtr client) XETrapEnv *penv = NULL; int status = Success; - if (client->index > MAXCLIENTS) + if (client->index >= MAXCLIENTS) { status = BadImplementation; } From 9719354ae04a41e9834ac9ba8fd9e895092ba4f1 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 24 Jun 2008 14:37:06 -0400 Subject: [PATCH 31/83] Check for __amd64__, not __x86_64__. Spiritual revert of 1fa4de80fcfc697b5e5879cc351fb3e9dbf6acbe. Intel's C compiler claims to be gcc-compatible; if they're not defining the same macros as gcc then that's their bug, not ours. Even if we were to do this aliasing we should do it once and for all in servermd.h. --- fb/fb.h | 2 +- hw/xfree86/common/compiler.h | 2 +- hw/xfree86/common/xf86AutoConfig.c | 2 +- hw/xfree86/loader/loader.c | 2 +- hw/xfree86/os-support/bsd/bsdResource.c | 2 +- hw/xfree86/os-support/bus/Pci.h | 2 +- hw/xfree86/os-support/misc/SlowBcopy.c | 4 ++-- hw/xfree86/utils/xorgcfg/loadmod.c | 2 +- hw/xfree86/x86emu/prim_ops.c | 2 +- hw/xfree86/x86emu/x86emu/prim_x86_gcc.h | 2 +- hw/xfree86/x86emu/x86emu/types.h | 2 +- include/servermd.h | 2 +- mi/micoord.h | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fb/fb.h b/fb/fb.h index 8e76bebfa..2c6c4fbef 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -138,7 +138,7 @@ typedef unsigned __int64 FbBits; defined(ia64) || defined(__ia64__) || \ defined(__sparc64__) || defined(_LP64) || \ defined(__s390x__) || \ - defined(amd64) || defined (__amd64__) || defined(__x86_64__) || \ + defined(amd64) || defined (__amd64__) \ defined (__powerpc64__) || \ (defined(sgi) && (_MIPS_SZLONG == 64)) typedef unsigned long FbBits; diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h index 9e7f8219d..a20baa3e4 100644 --- a/hw/xfree86/common/compiler.h +++ b/hw/xfree86/common/compiler.h @@ -498,7 +498,7 @@ extern unsigned int inb(unsigned long port); extern unsigned int inw(unsigned long port); extern unsigned int inl(unsigned long port); -# elif defined(linux) && (defined(__amd64__) || defined(__x86_64__)) +# elif defined(linux) && defined(__amd64__) # include diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index 7e5fab412..a786eed3e 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -454,7 +454,7 @@ chooseVideoDriver(void) if (info != NULL) chosen_driver = videoPtrToDriverName(info); if (chosen_driver == NULL) { -#if defined __i386__ || defined __amd64__ || defined __x86_64__ || defined __hurd__ +#if defined __i386__ || defined __amd64__ || defined __hurd__ chosen_driver = "vesa"; #elif defined __sparc__ chosen_driver = "sunffb"; diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c index a00269b70..774a4c4a0 100644 --- a/hw/xfree86/loader/loader.c +++ b/hw/xfree86/loader/loader.c @@ -63,7 +63,7 @@ #include #if defined(linux) && \ (defined(__alpha__) || defined(__powerpc__) || defined(__ia64__) \ - || defined(__amd64__) || defined(__x86_64__)) + || defined(__amd64__)) #include #endif #include diff --git a/hw/xfree86/os-support/bsd/bsdResource.c b/hw/xfree86/os-support/bsd/bsdResource.c index d1ee787f1..fe166c845 100644 --- a/hw/xfree86/os-support/bsd/bsdResource.c +++ b/hw/xfree86/os-support/bsd/bsdResource.c @@ -19,7 +19,7 @@ #ifdef INCLUDE_XF86_NO_DOMAIN -#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) || defined(__x86_64__) +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) resPtr xf86AccResFromOS(resPtr ret) diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h index 557483b9b..a1390c073 100644 --- a/hw/xfree86/os-support/bus/Pci.h +++ b/hw/xfree86/os-support/bus/Pci.h @@ -202,7 +202,7 @@ /* * Select architecture specific PCI init function */ -#if defined(__i386__) || defined(__i386) || defined(__amd64__) || defined(__amd64) || defined(__x86_64__) +#if defined(__i386__) || defined(__i386) || defined(__amd64__) || defined(__amd64) # define ARCH_PCI_INIT ix86PciInit #elif defined(__powerpc__) || defined(__powerpc64__) # define ARCH_PCI_INIT ppcPciInit diff --git a/hw/xfree86/os-support/misc/SlowBcopy.c b/hw/xfree86/os-support/misc/SlowBcopy.c index 5cd716823..7c51fcca3 100644 --- a/hw/xfree86/os-support/misc/SlowBcopy.c +++ b/hw/xfree86/os-support/misc/SlowBcopy.c @@ -30,7 +30,7 @@ xf86SetReallySlowBcopy(void) really_slow_bcopy = 1; } -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) || defined(__amd64__) static void xf86_really_slow_bcopy(unsigned char *src, unsigned char *dst, int len) { while(len--) @@ -45,7 +45,7 @@ static void xf86_really_slow_bcopy(unsigned char *src, unsigned char *dst, int l _X_EXPORT void xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len) { -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) || defined(__amd64__) if (really_slow_bcopy) { xf86_really_slow_bcopy(src, dst, len); return; diff --git a/hw/xfree86/utils/xorgcfg/loadmod.c b/hw/xfree86/utils/xorgcfg/loadmod.c index 629dfe118..748bd3a0b 100644 --- a/hw/xfree86/utils/xorgcfg/loadmod.c +++ b/hw/xfree86/utils/xorgcfg/loadmod.c @@ -181,7 +181,7 @@ LOOKUP xfree86LookupTab[] = { SYMFUNC(xf86memcpy) #if (defined(__powerpc__) && (defined(Lynx) || defined(linux))) || \ defined(__sparc__) || defined(__sparc) || defined(__ia64__) || \ - defined (__amd64__) || defined(__x86_64__) + defined (__amd64__) /* * Some PPC, SPARC, and IA64 compilers generate calls to memcpy to handle * structure copies. This causes a problem both here and in shared diff --git a/hw/xfree86/x86emu/prim_ops.c b/hw/xfree86/x86emu/prim_ops.c index 41968e1a7..4a6ac5deb 100644 --- a/hw/xfree86/x86emu/prim_ops.c +++ b/hw/xfree86/x86emu/prim_ops.c @@ -103,7 +103,7 @@ #include "x86emu/x86emui.h" #if defined(__GNUC__) -# if defined (__i386__) || defined(__i386) || defined(__AMD64__) || defined(__x86_64__) || defined(__amd64__) || defined(__x86_64__) +# if defined (__i386__) || defined(__i386) || defined(__AMD64__) || defined(__amd64__) # include "x86emu/prim_x86_gcc.h" # endif #endif diff --git a/hw/xfree86/x86emu/x86emu/prim_x86_gcc.h b/hw/xfree86/x86emu/x86emu/prim_x86_gcc.h index 5a443cdbf..5530a3ada 100644 --- a/hw/xfree86/x86emu/x86emu/prim_x86_gcc.h +++ b/hw/xfree86/x86emu/x86emu/prim_x86_gcc.h @@ -42,7 +42,7 @@ #include "x86emu/types.h" -#if !defined(__GNUC__) || !(defined (__i386__) || defined(__i386) || defined(__AMD64__) || defined(__x86_64__) || defined(__amd64__) || defined(__x86_64__)) +#if !defined(__GNUC__) || !(defined (__i386__) || defined(__i386) || defined(__AMD64__) || defined(__amd64__)) #error This file is intended to be used by gcc on i386 or x86-64 system #endif diff --git a/hw/xfree86/x86emu/x86emu/types.h b/hw/xfree86/x86emu/x86emu/types.h index 2d41b0f18..ff28885f1 100644 --- a/hw/xfree86/x86emu/x86emu/types.h +++ b/hw/xfree86/x86emu/x86emu/types.h @@ -75,7 +75,7 @@ defined(__sparc64__) || \ defined(__s390x__) || \ (defined(__hppa__) && defined(__LP64)) || \ - defined(__amd64__) || defined(amd64) || defined(__x86_64__) || \ + defined(__amd64__) || defined(amd64) \ (defined(__sgi) && (_MIPS_SZLONG == 64)) #define NUM32 int #else diff --git a/include/servermd.h b/include/servermd.h index 91b705bb2..f10e6bce0 100644 --- a/include/servermd.h +++ b/include/servermd.h @@ -285,7 +285,7 @@ SOFTWARE. #endif /* ia64 */ -#if defined(__amd64__) || defined(amd64) || defined(__amd64) || defined(__x86_64__) +#if defined(__amd64__) || defined(amd64) || defined(__amd64) # define IMAGE_BYTE_ORDER LSBFirst # if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO) diff --git a/mi/micoord.h b/mi/micoord.h index 876e88c95..16d086117 100644 --- a/mi/micoord.h +++ b/mi/micoord.h @@ -48,7 +48,7 @@ defined(__alpha) || defined(__alpha__) || \ defined(__i386__) || defined(__i386) || defined(__ia64__) || \ defined(__s390x__) || defined(__s390__) || \ - defined(__amd64__) || defined(amd64) || defined(__amd64) || defined(__x86_64__) + defined(__amd64__) || defined(amd64) || defined(__amd64) #define GetHighWord(x) (((int) (x)) >> 16) #else #define GetHighWord(x) (((int) (x)) / 65536) From 2725ba1fca45e5ba241695e24333d8efab1f862b Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 24 Jun 2008 14:41:32 -0400 Subject: [PATCH 32/83] Also remove xorgconfig from configure.ac. --- configure.ac | 8 -------- 1 file changed, 8 deletions(-) diff --git a/configure.ac b/configure.ac index f6997e59a..201bfe4c2 100644 --- a/configure.ac +++ b/configure.ac @@ -1830,13 +1830,6 @@ AC_TRY_COMPILE([ AC_DEFINE_DIR(PROJECTROOT, prefix, [Overall prefix]) -dnl xorgconfig CLI configuration utility -if test "x$XORG" = xyes; then - PKG_CHECK_MODULES([XORGCONFIG_DEP], [xkbfile x11]) - AC_SUBST(XORGCONFIG_DEP_CFLAGS) - AC_SUBST(XORGCONFIG_DEP_LIBS) -fi - dnl xorgcfg GUI configuration utility AC_ARG_ENABLE(xorgcfg, AS_HELP_STRING([--enable-xorgcfg], [Build xorgcfg GUI configuration utility (default: no)]), @@ -1971,7 +1964,6 @@ hw/xfree86/utils/gtf/Makefile hw/xfree86/utils/ioport/Makefile hw/xfree86/utils/kbd_mode/Makefile hw/xfree86/utils/xorgcfg/Makefile -hw/xfree86/utils/xorgconfig/Makefile hw/dmx/config/Makefile hw/dmx/doc/Makefile hw/dmx/examples/Makefile From fa1545eeda2a7feebc006840a44d390177634231 Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Fri, 20 Jun 2008 23:47:22 -0400 Subject: [PATCH 33/83] Fix "warning: passing argument 1 of `xf86addNewLoadDirective' from incompatible pointer type". --- hw/xfree86/common/xf86Config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index e52974dd1..126ae9f93 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -305,7 +305,7 @@ xf86ModulelistFromConfig(pointer **optlist) } } if (found == FALSE) { - XF86ConfModulePtr ptr = xf86configptr->conf_modules; + XF86LoadPtr ptr = (XF86LoadPtr)xf86configptr->conf_modules; ptr = xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt); xf86Msg(X_INFO, "\"%s\" will be loaded by default.\n", ModuleDefaults[i].name); } @@ -314,7 +314,7 @@ xf86ModulelistFromConfig(pointer **optlist) xf86configptr->conf_modules = xnfcalloc(1, sizeof(XF86ConfModuleRec)); for (i=0 ; ModuleDefaults[i].name != NULL ; i++) { if (ModuleDefaults[i].toLoad == TRUE) { - XF86ConfModulePtr ptr = xf86configptr->conf_modules; + XF86LoadPtr ptr = (XF86LoadPtr)xf86configptr->conf_modules; ptr = xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt); } } From 95d4ede538fbb68049ba3efa0acb0e9712e5cb01 Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Fri, 20 Jun 2008 23:49:32 -0400 Subject: [PATCH 34/83] Fix "warning: passing argument 1 of `modeIsPresent' from incompatible pointer type". --- hw/xfree86/common/xf86Config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 126ae9f93..f0ae730af 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -2417,14 +2417,14 @@ configInput(IDevPtr inputp, XF86ConfInputPtr conf_input, MessageType from) } static Bool -modeIsPresent(char * modename,MonPtr monitorp) +modeIsPresent(DisplayModePtr mode, MonPtr monitorp) { DisplayModePtr knownmodes = monitorp->Modes; /* all I can think of is a linear search... */ while(knownmodes != NULL) { - if(!strcmp(modename,knownmodes->name) && + if(!strcmp(mode->name, knownmodes->name) && !(knownmodes->type & M_T_DEFAULT)) return TRUE; knownmodes = knownmodes->next; From 8910dde96ec4318c9c44fb9717b6b52fad56cd1d Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Mon, 23 Jun 2008 14:51:38 -0400 Subject: [PATCH 35/83] Fix "warning: assignment discards qualifiers from pointer target type". --- hw/xfree86/loader/dlloader.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/xfree86/loader/dlloader.c b/hw/xfree86/loader/dlloader.c index 4caefd071..18dcb76c6 100644 --- a/hw/xfree86/loader/dlloader.c +++ b/hw/xfree86/loader/dlloader.c @@ -87,16 +87,15 @@ DLFindSymbolLocal(pointer module, const char *name) static const char symPrefix[] = DLSYM_PREFIX; - if (strlen(symPrefix)) { + if (sizeof(symPrefix) > 1) { n = malloc(strlen(symPrefix) + strlen(name) + 1); sprintf(n, "%s%s", symPrefix, name); - } else { - n = name; + name = n; } - p = dlsym(module, n); + p = dlsym(module, name); - if (strlen(symPrefix)) + if (sizeof(symPrefix) > 1) free(n); return p; From e9b4f3cd856e2401675452c387b4155246239f91 Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Mon, 23 Jun 2008 16:18:20 -0400 Subject: [PATCH 36/83] Fix "warning: suggest parentheses around && within ||". --- hw/xfree86/ramdac/xf86Cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c index ec9a35811..3c98f6e7d 100644 --- a/hw/xfree86/ramdac/xf86Cursor.c +++ b/hw/xfree86/ramdac/xf86Cursor.c @@ -378,7 +378,7 @@ xf86CursorMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) /* only update coordinate state for first sprite, otherwise we get jumps when removing a sprite. The second sprite is never HW rendered anyway */ if (pDev == inputInfo.pointer || - !pDev->isMaster && pDev->u.master == inputInfo.pointer) + (!pDev->isMaster && pDev->u.master == inputInfo.pointer)) { ScreenPriv->x = x; ScreenPriv->y = y; From 9ed9d98dec58d1f7468d02c4b951811b8e1ca7c1 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 24 Jun 2008 22:36:32 +0200 Subject: [PATCH 37/83] x86emu: fix build, fallout from 9719354 --- hw/xfree86/x86emu/x86emu/types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/x86emu/x86emu/types.h b/hw/xfree86/x86emu/x86emu/types.h index ff28885f1..c0c09c1b0 100644 --- a/hw/xfree86/x86emu/x86emu/types.h +++ b/hw/xfree86/x86emu/x86emu/types.h @@ -75,7 +75,7 @@ defined(__sparc64__) || \ defined(__s390x__) || \ (defined(__hppa__) && defined(__LP64)) || \ - defined(__amd64__) || defined(amd64) \ + defined(__amd64__) || defined(amd64) || \ (defined(__sgi) && (_MIPS_SZLONG == 64)) #define NUM32 int #else From bcc88a1d46c7ba469c4e2861875f84f8c77d4b15 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Sun, 22 Jun 2008 22:34:30 +0930 Subject: [PATCH 38/83] xkb: remove unused variable is_core. --- xkb/xkbAccessX.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c index 28107d05d..d3b585a70 100644 --- a/xkb/xkbAccessX.c +++ b/xkb/xkbAccessX.c @@ -309,15 +309,14 @@ AccessXRepeatKeyExpire(OsTimerPtr timer,CARD32 now,pointer arg) DeviceIntPtr dev = (DeviceIntPtr) arg; XkbSrvInfoPtr xkbi = dev->key->xkbInfo; KeyCode key; -BOOL is_core; if (xkbi->repeatKey == 0) return 0; - is_core = (dev == inputInfo.keyboard); key = xkbi->repeatKey; AccessXKeyboardEvent(dev, DeviceKeyRelease, key, True); AccessXKeyboardEvent(dev, DeviceKeyPress, key, True); + return xkbi->desc->ctrls->repeat_interval; } From 32a7bbbba6fec0535a8faa1d6d2ecebe786bcc81 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 24 Jun 2008 09:28:05 +0930 Subject: [PATCH 39/83] xfree86: fix up leftover allocation of xf86Events. Thanks to Eamon Walsh for spotting this. --- hw/xfree86/common/xf86Xinput.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 675ec9f75..b98e903fa 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -131,7 +131,7 @@ xf86ProcessCommonOptions(LocalDevicePtr local, local->history_size = GetMotionHistorySize(); /* Preallocate xEvent store */ if (!xf86Events) - xf86Events = (xEvent *)xcalloc(sizeof(xEvent), GetMaximumEventsNum()); + GetEventList(&xf86Events); if (!xf86Events) FatalError("Couldn't allocate event store\n"); } From a4cb25f8c816adc3bdf6a28d5beb558e8be40121 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Tue, 24 Jun 2008 12:08:35 +0930 Subject: [PATCH 40/83] dix: free FocusPrivates when deleting a window. #16493 Signed-off-by: Peter Hutterer X.Org Bug 16493 --- dix/window.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dix/window.c b/dix/window.c index 6b9506825..137afa0b4 100644 --- a/dix/window.c +++ b/dix/window.c @@ -978,6 +978,7 @@ DeleteWindow(pointer value, XID wid) if (pWin->prevSib) pWin->prevSib->nextSib = pWin->nextSib; } + xfree(dixLookupPrivate(&pWin->devPrivates, FocusPrivatesKey)); dixFreePrivates(pWin->devPrivates); xfree(pWin); return Success; From a3ec22627355fc08730ad7e90022e374763d333f Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Tue, 24 Jun 2008 20:32:24 -0400 Subject: [PATCH 41/83] Fix a leak in the code that parses the protocol names. Also added some comments. Reported by Ben Gamari (bug #16492). --- dix/registry.c | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/dix/registry.c b/dix/registry.c index 10fa21f84..a519cff6b 100644 --- a/dix/registry.c +++ b/dix/registry.c @@ -126,10 +126,12 @@ RegisterExtensionNames(ExtensionEntry *extEntry) rewind(fh); while (fgets(buf, sizeof(buf), fh)) { + lineobj = NULL; ptr = strchr(buf, '\n'); if (ptr) *ptr = 0; + /* Check for comments or empty lines */ switch (buf[0]) { case PROT_REQUEST: case PROT_EVENT: @@ -139,48 +141,54 @@ RegisterExtensionNames(ExtensionEntry *extEntry) case '\0': continue; default: - continue; + goto invalid; } + /* Check for space character in the fifth position */ ptr = strchr(buf, ' '); - if (!ptr || ptr != buf + 4) { - LogMessage(X_WARNING, "Invalid line in " FILENAME ", skipping\n"); - continue; - } + if (!ptr || ptr != buf + 4) + goto invalid; + + /* Duplicate the string after the space */ lineobj = strdup(ptr + 1); if (!lineobj) continue; + /* Check for a colon somewhere on the line */ ptr = strchr(buf, ':'); - if (!ptr) { - LogMessage(X_WARNING, "Invalid line in " FILENAME ", skipping\n"); - continue; - } + if (!ptr) + goto invalid; + + /* Compare the part before colon with the target extension name */ *ptr = 0; - if (strcmp(buf + 5, extEntry->name)) - continue; + goto skip; + /* Get the opcode for the request, event, or error */ offset = strtol(buf + 1, &ptr, 10); - if (offset == 0 && ptr == buf + 1) { - LogMessage(X_WARNING, "Invalid line in " FILENAME ", skipping\n"); - continue; - } + if (offset == 0 && ptr == buf + 1) + goto invalid; + /* Save the strdup result in the registry */ switch(buf[0]) { case PROT_REQUEST: if (extEntry->base) RegisterRequestName(extEntry->base, offset, lineobj); else RegisterRequestName(offset, 0, lineobj); - break; + continue; case PROT_EVENT: RegisterEventName(extEntry->eventBase + offset, lineobj); - break; + continue; case PROT_ERROR: RegisterErrorName(extEntry->errorBase + offset, lineobj); - break; + continue; } + + invalid: + LogMessage(X_WARNING, "Invalid line in " FILENAME ", skipping\n"); + skip: + free(lineobj); } } From 2ff7eb4995b663cf12a01124745de600f38d0bfc Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Tue, 24 Jun 2008 22:09:34 -0300 Subject: [PATCH 42/83] xfree86: kill INHERIT_LOCK_STATE macro. I don't know how this survived so long. Google didn't show anything usable related with this. --- hw/xfree86/common/xf86Events.c | 39 ---------------------------------- 1 file changed, 39 deletions(-) diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index a7f9578b8..e7effc8c8 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -196,45 +196,6 @@ void ProcessInputEvents () { int x, y; -#ifdef INHERIT_LOCK_STATE - static int generation = 0; -#endif - - /* - * With INHERIT_LOCK_STATE defined, the initial state of CapsLock, NumLock - * and ScrollLock will be set to match that of the VT the server is - * running on. - */ -#ifdef INHERIT_LOCK_STATE - if (generation != serverGeneration) { - xEvent kevent; - DevicePtr pKeyboard = xf86Info.pKeyboard; - extern unsigned int xf86InitialCaps, xf86InitialNum, xf86InitialScroll; - - generation = serverGeneration; - kevent.u.keyButtonPointer.time = GetTimeInMillis(); - kevent.u.keyButtonPointer.rootX = 0; - kevent.u.keyButtonPointer.rootY = 0; - kevent.u.u.type = KeyPress; - - - if (xf86InitialCaps) { - kevent.u.u.detail = xf86InitialCaps; - (* pKeyboard->processInputProc)(&kevent, (DeviceIntPtr)pKeyboard, 1); - xf86InitialCaps = 0; - } - if (xf86InitialNum) { - kevent.u.u.detail = xf86InitialNum; - (* pKeyboard->processInputProc)(&kevent, (DeviceIntPtr)pKeyboard, 1); - xf86InitialNum = 0; - } - if (xf86InitialScroll) { - kevent.u.u.detail = xf86InitialScroll; - (* pKeyboard->processInputProc)(&kevent, (DeviceIntPtr)pKeyboard, 1); - xf86InitialScroll = 0; - } - } -#endif mieqProcessInputEvents(); From f3b29efc4d7bb346cdd3fd79e780f1022c8f46e8 Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Tue, 24 Jun 2008 23:07:49 -0300 Subject: [PATCH 43/83] Remove NOFONTSERVERACCESS macro dix: this is semantically different but it goes through the same path in the code. --- configure.ac | 1 - dix/dixfonts.c | 2 -- include/dix-config.h.in | 3 --- 3 files changed, 6 deletions(-) diff --git a/configure.ac b/configure.ac index 201bfe4c2..ab6cb1057 100644 --- a/configure.ac +++ b/configure.ac @@ -962,7 +962,6 @@ fi if test "x$BUILTIN_FONTS" = xyes; then AC_DEFINE(BUILTIN_FONTS, 1, [Use only built-in fonts]) - AC_DEFINE(NOFONTSERVERACCESS, 1, [Avoid using a font server]) FONTPATH="built-ins" fi diff --git a/dix/dixfonts.c b/dix/dixfonts.c index 83b264a29..89f15289a 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -1920,8 +1920,6 @@ InitFonts (void) BuiltinRegisterFpeFunctions(); #else FontFileRegisterFpeFunctions(); -#endif -#ifndef NOFONTSERVERACCESS fs_register_fpe_functions(); #endif } diff --git a/include/dix-config.h.in b/include/dix-config.h.in index 0c515c561..ad74f773b 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -480,9 +480,6 @@ /* Use only built-in fonts */ #undef BUILTIN_FONTS -/* Avoid using font servers */ -#undef NOFONTSERVERACCESS - /* Use an empty root cursor */ #undef NULL_ROOT_CURSOR From 385943e0e97463ce4681a9b6a4a40d7e3c91e51e Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Tue, 24 Jun 2008 23:13:32 -0300 Subject: [PATCH 44/83] Set --enable-builtin-fonts as default. Some reasons to embed fonts by default: 1. X server doesn't pick a good default font path so it's easiest just to built in the core fonts and let new X hackers more happy. Developers and distro guys are wise enough to just set --disable-builtin-fonts when they want. 2. Seems that this is by far the most popular FAQ (http://www.x.org/wiki/FAQErrorMessages). 3. No one gave a good argument to not do this: http://lists.freedesktop.org/archives/xorg/2008-May/035479.html --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index ab6cb1057..ce2721df3 100644 --- a/configure.ac +++ b/configure.ac @@ -505,9 +505,9 @@ AC_ARG_ENABLE(install-libxf86config, [Install libxf86config (default: disabled)]), [INSTALL_LIBXF86CONFIG=$enableval], [INSTALL_LIBXF86CONFIG=no]) -AC_ARG_ENABLE(builtin-fonts, AS_HELP_STRING([--enable-builtin-fonts], [Use only built-in fonts (default: use external)]), +AC_ARG_ENABLE(builtin-fonts, AS_HELP_STRING([--enable-builtin-fonts], [Use only built-in fonts (default: yes)]), [BUILTIN_FONTS=$enableval], - [BUILTIN_FONTS=no]) + [BUILTIN_FONTS=yes]) AC_ARG_ENABLE(null-root-cursor, AS_HELP_STRING([--enable-null-root-cursor], [Use an empty root cursor (default: use core cursor)]), [NULL_ROOT_CURSOR=$enableval], [NULL_ROOT_CURSOR=no]) From 3a2beb2f867fd47dc5a7723dcac345ea0b0ecf3d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 25 Jun 2008 13:12:41 +0930 Subject: [PATCH 45/83] dix: InitEventList does not need to be _X_EXPORT. --- dix/getevents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dix/getevents.c b/dix/getevents.c index b00bc11ca..3713f4b08 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -787,7 +787,7 @@ GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type, * * @param num_events Number of elements in list. */ -_X_EXPORT EventListPtr +EventListPtr InitEventList(int num_events) { EventListPtr events; From a81b5ce452766bbc4b2ac0849711284ba8591b46 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 25 Jun 2008 13:23:09 +0930 Subject: [PATCH 46/83] dix: free memory associated with the EventList. #16507 Un-deprecates CloseDownEvents. X.Org Bug 16507 --- dix/events.c | 11 ++++++----- dix/main.c | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dix/events.c b/dix/events.c index 7bd682526..f6309f29d 100644 --- a/dix/events.c +++ b/dix/events.c @@ -5520,14 +5520,15 @@ InitEvents(void) FatalError("[dix] Failed to allocate input event list.\n"); } -/** - * This function is deprecated! It shouldn't be used anymore. It used to free - * the spriteTraces, but now they are freed when the SpriteRec is freed. - */ -_X_DEPRECATED void +void CloseDownEvents(void) { + int len; + EventListPtr list; + len = GetEventList(&list); + while(len--) + xfree(list[len].event); } /** diff --git a/dix/main.c b/dix/main.c index e0bb18024..3bc45fb37 100644 --- a/dix/main.c +++ b/dix/main.c @@ -437,6 +437,7 @@ int main(int argc, char *argv[], char *envp[]) memset(WindowTable, 0, MAXSCREENS * sizeof(WindowPtr)); CloseDownDevices(); + CloseDownEvents(); for (i = screenInfo.numScreens - 1; i >= 0; i--) { From cbc20d92de92aad5ca240310a9156ccf97c24a01 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 25 Jun 2008 09:52:36 -0400 Subject: [PATCH 47/83] XTrap delenda est. --- Makefile.am | 6 - XTrap/Makefile.am | 5 - XTrap/xtrapddmi.c | 161 -- XTrap/xtrapdi.c | 2154 -------------------------- XTrap/xtrapdiswp.c | 937 ----------- XTrap/xtrapditbl.c | 243 --- configure.ac | 21 +- hw/xfree86/dixmods/Makefile.am | 11 +- hw/xfree86/dixmods/xf86XTrapModule.c | 45 - include/dix-config.h.in | 3 - include/xorg-server.h.in | 3 - mi/miinitext.c | 6 - 12 files changed, 7 insertions(+), 3588 deletions(-) delete mode 100644 XTrap/Makefile.am delete mode 100644 XTrap/xtrapddmi.c delete mode 100644 XTrap/xtrapdi.c delete mode 100644 XTrap/xtrapdiswp.c delete mode 100644 XTrap/xtrapditbl.c delete mode 100644 hw/xfree86/dixmods/xf86XTrapModule.c diff --git a/Makefile.am b/Makefile.am index 116e4feab..aa9c8b6f8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,10 +5,6 @@ if COMPOSITE COMPOSITE_DIR=composite endif -if XTRAP -XTRAP_DIR=XTrap -endif - if GLX GLX_DIR=glx endif @@ -38,7 +34,6 @@ SUBDIRS = \ $(RECORD_DIR) \ xfixes \ damageext \ - $(XTRAP_DIR) \ $(COMPOSITE_DIR) \ $(GLX_DIR) \ exa \ @@ -80,7 +75,6 @@ DIST_SUBDIRS = \ record \ xfixes \ damageext \ - XTrap \ composite \ glx \ exa \ diff --git a/XTrap/Makefile.am b/XTrap/Makefile.am deleted file mode 100644 index 1eddd4f56..000000000 --- a/XTrap/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -noinst_LTLIBRARIES = libxtrap.la - -AM_CFLAGS = $(DIX_CFLAGS) - -libxtrap_la_SOURCES = xtrapddmi.c xtrapdi.c xtrapdiswp.c xtrapditbl.c diff --git a/XTrap/xtrapddmi.c b/XTrap/xtrapddmi.c deleted file mode 100644 index 8ce99543d..000000000 --- a/XTrap/xtrapddmi.c +++ /dev/null @@ -1,161 +0,0 @@ -/***************************************************************************** -Copyright 1987, 1988, 1989, 1990, 1991 by Digital Equipment Corp., Maynard, MA - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*****************************************************************************/ -/* - * ABSTRACT: - * - * This module is the platform-specific but conditionally independent - * code for the XTrap extension (usually I/O or platform setup). - * This is shared code and is subject to change only by team approval. - * - * CONTRIBUTORS: - * - * Dick Annicchiarico - * Robert Chesler - * Gene Durso - * Marc Evans - * Alan Jamison - * Mark Henry - * Ken Miller - * - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#ifdef PC -# include "fcntl.h" -# include "io.h" -# define O_NDELAY 0L -#endif - -#define NEED_REPLIES -#define NEED_EVENTS -#include /* From library include environment */ -#include "inputstr.h" /* From server include env. (must be before Xlib.h!) */ -#ifdef PC -# include "scrintst.h" /* Screen struct */ -# include "extnsist.h" -#else -# include "extnsionst.h" /* Server ExtensionEntry definitions */ -# include "scrnintstr.h" /* Screen struct */ -#endif -#include "inputstr.h" - -#include -#include -#include - -extern int XETrapErrorBase; -extern xXTrapGetAvailReply XETrap_avail; -extern DevicePtr XETrapKbdDev; -extern DevicePtr XETrapPtrDev; - -/* - * DESCRIPTION: - * - * This function performs the platform specific setup for server - * extension implementations. - */ -void XETrapPlatformSetup() -{ -} - - -#if !defined _XINPUT -/* - * DESCRIPTION: - * - * This routine processes the simulation of some input event. - * - */ -int XETrapSimulateXEvent(register xXTrapInputReq *request, - register ClientPtr client) -{ - ScreenPtr pScr = NULL; - int status = Success; - xEvent xev; - register int x = request->input.x; - register int y = request->input.y; - DevicePtr keydev = (DevicePtr)PickKeyboard(client); - DevicePtr ptrdev = (DevicePtr)PickPointer(client); - - if (request->input.screen < screenInfo.numScreens) - { - pScr = screenInfo.screens[request->input.screen]; - } - else - { /* Trying to play bogus events to this WS! */ -#ifdef VERBOSE - ErrorF("%s: Trying to send events to screen %d!\n", XTrapExtName, - request->input.screen); -#endif - status = XETrapErrorBase + BadScreen; - } - /* Fill in the event structure with the information - * Note: root, event, child, eventX, eventY, state, and sameScreen - * are all updated by FixUpEventFromWindow() when the events - * are delivered via DeliverDeviceEvents() or whatever. XTrap - * needs to only concern itself with type, detail, time, rootX, - * and rootY. - */ - if (status == Success) - { - xev.u.u.type = request->input.type; - xev.u.u.detail = request->input.detail; - xev.u.keyButtonPointer.time = GetTimeInMillis(); - xev.u.keyButtonPointer.rootX = x; - xev.u.keyButtonPointer.rootY = y; - - if (request->input.type == MotionNotify) - { /* Set new cursor position on screen */ - XETrap_avail.data.cur_x = x; - XETrap_avail.data.cur_y = y; - NewCurrentScreen (inputInfo.pointer, pScr, x, y); /* fix from amnonc@mercury.co.il */ - if (!(*pScr->SetCursorPosition)(inputInfo.pointer, pScr, x, y, xFalse)) - { - status = BadImplementation; - } - } - } - if (status == Success) - { - switch(request->input.type) - { /* Now process the event appropriately */ - case KeyPress: - case KeyRelease: - (*XETrapKbdDev->realInputProc)(&xev,(DeviceIntPtr)keydev, 1L); - break; - case MotionNotify: - case ButtonPress: - case ButtonRelease: - (*XETrapPtrDev->realInputProc)(&xev,(DeviceIntPtr)ptrdev, 1L); - break; - default: - status = BadValue; - break; - } - } - return(status); -} -#endif /* _XINPUT */ diff --git a/XTrap/xtrapdi.c b/XTrap/xtrapdi.c deleted file mode 100644 index a4ba45b5f..000000000 --- a/XTrap/xtrapdi.c +++ /dev/null @@ -1,2154 +0,0 @@ -/***************************************************************************** -Copyright 1987, 1988, 1989, 1990, 1991 by Digital Equipment Corp., Maynard, MA -X11R6 Changes Copyright (c) 1994 by Robert Chesler of Absol-Puter, Hudson, NH. - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL AND ABSOL-PUTER DISCLAIM ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS, IN NO EVENT SHALL DIGITAL OR ABSOL-PUTER BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER -RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF -CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -*****************************************************************************/ -/* - * ABSTRACT: - * - * This module is the main module for extension initialization and setup. - * It is called by the server and by clients using the extension. - * This is shared code and is subject to change only by team approval. - * - * CONTRIBUTORS: - * - * Dick Annicchiarico - * Robert Chesler - * Gene Durso - * Marc Evans - * Alan Jamison - * Mark Henry - * Ken Miller - * - * CHANGES: - * - * Robert Chesler - grab-impreviousness patch to improve grab behavior - * Robert Chesler - add client arg to swapping routines for X11R6 port - * - */ - -/*-----------------* - * Include Files * - *-----------------*/ - -#define NEED_REPLIES -#define NEED_EVENTS -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include "inputstr.h" /* Server DevicePtr definitions */ -#include "misc.h" /* Server swapping macros */ -#include "dixstruct.h" /* Server ClientRec definitions */ -#include "resource.h" /* Used with the MakeAtom call */ -#ifdef PC -# include "scrintst.h" /* Screen struct */ -# include "extnsist.h" -#else -# include "extnsionst.h" /* Server ExtensionEntry definitions */ -# include "scrnintstr.h" /* Screen struct */ -#endif -#include "pixmapstr.h" /* DrawableRec */ -#include "windowstr.h" /* Drawable Lookup structures */ -#include "inputstr.h" -#include -#include -#include -#include "colormapst.h" -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#include "cursor.h" -#endif - - -/*----------------------------* - * Global Data Declarations * - *----------------------------*/ - -DevicePtr XETrapKbdDev = NULL; -DevicePtr XETrapPtrDev = NULL; -int XETrapErrorBase = 0L; -xXTrapGetAvailReply XETrap_avail; /* What's available to clients */ - -globalref int_function XETrapDispatchVector[10L]; /* Vector of XTrap Rtns */ -globalref int_function XETSwDispatchVector[10L]; /* Swapped XTrap Rtns */ - -globalref int_function XETrapProcVector[256L]; /* The "shadowed" ProcVector */ - /* The "real" EventVector (XTrap creates it till events - * truly become vectored - */ -#ifndef VECTORED_EVENTS -globalref int_function EventProcVector[XETrapCoreEvents]; -#else -extern WindowPtr GetCurrentRootWindow(DeviceIntPtr); -globalref int_function EventProcVector[128L]; -#endif -static int_function keybd_process_inp = NULL; /* Used for VECTORED_EVENTS */ - /* The "shadowed" Event Vector */ -globalref int_function XETrapEventProcVector[XETrapCoreEvents]; - -globalref void_function XETSwProcVector[256L];/* Vector of Req swapping rtns */ - -/* This macro returns a true/false indicator based on whether it changes the - * environment state bits local to the server extension. This is based on the - * idea that if a valid flag is set and the corresponding data bit is not in - * the same state as desired, then true is returned, otherwise false is - * returned. - */ -#define _CheckChangeBit(valid,data,local,bit) \ - (BitIsFalse(valid,bit) ? 0L : \ - (((BitIsTrue(data,bit) && BitIsTrue(local,bit)) || \ - (BitIsFalse(data,bit) && BitIsFalse(local,bit))) ? 0L : \ - (BitToggle(local,bit), 1L))) - -/* This macro is designed to return the number of elements in an - * automatically allocated array. - */ -#ifndef ASIZE -#define ASIZE(array) (sizeof(array)/sizeof(array[0L])) -#endif - -/* This macro is designed to return the number of long words beyond - * XETrapMinRepSize contained in a data structure. - */ -#ifndef XEXTRA -#define XEXTRA(s) \ - ((sizeof(s)+(sizeof(CARD32)-1L)-XETrapMinRepSize)/sizeof(CARD32)) -#endif - -/* Static Declarations known to XTrap Only - * All XTrap clients refer to these single copies! - */ -/* This carries all of the information XTrap uses for internal information */ -static XETrapEnv *XETenv[MAXCLIENTS] = {NULL}; -#ifndef RESTYPE -#define RESTYPE unsigned long -#endif -static RESTYPE XETrapClass = 0L; /* Resource class for this extension */ -static RESTYPE XETrapType = 0L; /* Resource type for this extension */ -static Bool gate_closed = False; /* The global "gatekeeper" */ -static Bool key_ignore = False; /* The global "keymaster" */ -static Bool ignore_grabs = False; -static CARD8 next_key = XEKeyIsClear; /* Echo, Clear, or Other */ -#ifdef VECTORED_EVENTS -static INT16 current_screen = -1L; /* Current screen for events */ -#endif -static INT16 vectored_requests[256L] = {0L}; /* cnt of vectoring clients */ -static INT16 vectored_events[KeyPress+MotionNotify] = {0L}; -typedef struct _client_list -{ - struct _client_list *next; - ClientPtr client; -} ClientList; -static ClientList io_clients; /* Linked-list of clients currently doing I/O */ -static ClientList stats_clients; /* Linked-list of clients collecting stats */ -static ClientList cmd_clients; /* Linked-list of clients using command key */ - -/*----------------------------* - * Forward Declarations - *----------------------------*/ -static void _SwapProc (int (**f1 )(void), int (**f2 )(void)); -static void sXETrapEvent (xETrapDataEvent *from , xETrapDataEvent *to ); -static int add_accelerator_node (ClientPtr client , ClientList *accel ); -static void remove_accelerator_node (ClientPtr client , ClientList *accel ); -static void update_protocol (xXTrapGetReq *reqptr , ClientPtr client ); -#ifdef COLOR_REPLIES -static void GetSendColorRep (ClientPtr client , xResourceReq *req ); -static void GetSendNamedColorRep (ClientPtr client , xResourceReq *req ); -static void GetSendColorCellsRep (ClientPtr client , xResourceReq *req ); -static void GetSendColorPlanesRep (ClientPtr client , xResourceReq *req ); -#endif - -/* - * DESCRIPTION: - * - * This routine is called by the server when a given client - * goes away (as identified by the first argument). All - * memory allocations, misc. values specific to a given - * client would be reset here. - * - */ -int XETrapDestroyEnv(pointer value, XID id) -{ - xXTrapReq request; - XETrapEnv *penv = XETenv[(long)value]; - - XETrapReset(&request,penv->client); - /* Free any memory malloc'd for a particular client here */ - /* In case stop I/O wasn't received for this client */ - if (penv->stats) - { /* Remove from client accelerator list */ - remove_accelerator_node(penv->client, &stats_clients); - Xfree(penv->stats); /* Free the stats buckets */ - } - if (cmd_clients.next == NULL) - { /* No more command key clients! Let's reset the gate */ - gate_closed = False; - key_ignore = False; - next_key = XEKeyIsClear; - } - -#ifdef VECTORED_EVENTS - current_screen = -1L; /* Invalidate current screen */ -#endif - -#ifdef VERBOSE - ErrorF("%s: Client '%d' Disconnected\n", XTrapExtName, - penv->client->index); -#endif - - Xfree(penv); - XETenv[(long)value] = NULL; - - return 0; -} - -/* - * DESCRIPTION: - * - * This routine is called by the server when the last client - * (the session manager in most cases) goes away. This is server - * reset. When the server comes back up, this extension will not - * be loaded unless this routine makes the proper arrangements. - * - * The real concern here is to unload the extension - * and possibly make arragements to be called upon - * server restart. - * - */ -void XETrapCloseDown(ExtensionEntry *extEntry) -{ - long i; - - for (i=0L; irealInputProc; - EventProcVector[KeyRelease] = - (int_function)XETrapKbdDev->realInputProc; - } -#ifdef VECTORED_EVENTS - keybd_process_inp = EventProcVector[KeyPress]; - EventProcVector[KeyPress] = EventProcVector[KeyRelease] = NULL; - XETrapEventProcVector[KeyPress] = XETrapEventVector; - XETrapEventProcVector[KeyRelease] = XETrapEventVector; -#else /* !VECTORED_EVENTS */ - XETrapEventProcVector[KeyPress] = XETrapKeyboard; - XETrapEventProcVector[KeyRelease] = XETrapKeyboard; -#endif /* !VECTORED_EVENTS */ - } - /* Do we need to redirect the pointer device? */ -#ifndef VECTORED_EVENTS - if (XETrapPtrDev == NULL) - { - if ((XETrapPtrDev = (DevicePtr)inputInfo.pointer) == 0L) - { - retval = False; - } - else - { - EventProcVector[ButtonPress] = - (int_function)XETrapPtrDev->realInputProc; - EventProcVector[ButtonRelease] = - (int_function)XETrapPtrDev->realInputProc; - EventProcVector[MotionNotify] = - (int_function)XETrapPtrDev->realInputProc; - } - XETrapEventProcVector[ButtonPress] = XETrapPointer; - XETrapEventProcVector[ButtonRelease] = XETrapPointer; - XETrapEventProcVector[MotionNotify] = XETrapPointer; - } -#endif /* !VECTORED_EVENTS */ - return(retval); -} - -/* - * - * DESCRIPTION: - * - * This routine is the main entry point for the Xtrap extension. It is - * called by the server to inititalize the Xtrap extension. Once the - * extension is initialized, life is controlled by the XtrapDispatch - * routine by the requests it will handle. - * - * Initializes all the XTrap data structures with the proper - * addresses of defined routines that will help control the extension. - * It is vital that the extension state be kept accurate so that only - * one call to this routine be made. - * - */ - -void DEC_XTRAPInit() -{ - register ExtensionEntry *extEntry; - unsigned int i; - Atom a; - - /* Make the extension known to the server. Must be done every time - * DEC_XTRAPInit is called, else server will think it failed. - */ - if ((extEntry = AddExtension(XTrapExtName,XETrapNumEvents, - XETrapNumErrors,XETrapDispatch,sXETrapDispatch,XETrapCloseDown - ,StandardMinorOpcode)) == NULL) - { - ErrorF("%s: AddExtension Failed!\n", XTrapExtName); - return; - } -#ifdef VERBOSE - ErrorF("%s: AddExtension assigned Major Opcode '%d'\n", - XTrapExtName, extEntry->base); -#endif - XETrap_avail.data.major_opcode = extEntry->base; - XETrapErrorBase = extEntry->errorBase; - XETrap_avail.data.event_base = extEntry->eventBase; - - /* Set up our swapped reply vector */ - ReplySwapVector[XETrap_avail.data.major_opcode] = - (void_function) sReplyXTrapDispatch; - - /* Set up our swapped event vector */ - EventSwapVector[extEntry->eventBase + XETrapData] = - (EventSwapPtr) sXETrapEvent; - - /* make an atom saying that the extension is present. The - * adding of the resource occurs during XETrapCreateEnv(). - */ - if ((a = MakeAtom(XTrapExtName,strlen(XTrapExtName),1L)) == None || - (XETrapType = CreateNewResourceType(XETrapDestroyEnv)) == 0L) - { - ErrorF("%s: Setup can't create new resource type (%d,%d,%d)\n", - XTrapExtName, (int)a,(int)XETrapClass,(int)XETrapType); - return; - } - /* initialize the GetAvailable info reply here */ - XETrap_avail.hdr.type = X_Reply; - XETrap_avail.hdr.length = XEXTRA(xXTrapGetAvailReply); - XETrap_avail.data.xtrap_release = XETrapRelease; - XETrap_avail.data.xtrap_version = XETrapVersion; - XETrap_avail.data.xtrap_revision = XETrapRevision; - XETrap_avail.data.pf_ident = XETrapPlatform; - XETrap_avail.data.max_pkt_size = 0xFFFF; /* very large number */ - for (i=0L; iindex >= MAXCLIENTS) - { - status = BadImplementation; - } - else if ((XETenv[client->index] = (XETrapEnv *)Xcalloc(sizeof(XETrapEnv))) - == NULL) - { - status = BadAlloc; - } - if (status == Success) - { - penv = XETenv[client->index]; - penv->client = client; - penv->protocol = 31; /* default to backwards compatibility */ - /* prep for client's departure (for memory dealloc, cleanup) */ - AddResource(FakeClientID(client->index),XETrapType, - (pointer)(long)(client->index)); - if (XETrapRedirectDevices() == False) - { - status = XETrapErrorBase + BadDevices; - } - /* Initialize the current state */ - if (status == Success) - { - status = XETrapReset(NULL, penv->client); - } - } - -#ifdef VECTORED_EVENTS - current_screen = -1L; /* Invalidate current screen */ -#endif - -#ifdef VERBOSE - if (status == Success) - { - ErrorF("%s: Client '%d' Connection Accepted\n", XTrapExtName, - penv->client->index); - } -#endif - - return(status); -} - -/* - * DESCRIPTION: - * - * This procedure is defined for the call to AddExtension() - * in which it is expected to be a parameter of the call. - * - * This routine will be called by the server dispatcher - * when a client makes a request that is handled - * by the extension and the byte ordering of the client is the - * SAME as that of the extension. - * - * Note: the status of the requests is returned to the caller of - * the Dispatch routine which will in turn SendErrorToClient if - * necessary. - */ - -int XETrapDispatch(ClientPtr client) -{ - - REQUEST(xXTrapReq); - register int status = Success; - - REQUEST_AT_LEAST_SIZE(xXTrapReq); - - /* Have we seen this client before? */ - if (XETenv[client->index] == NULL) - { - status = XETrapCreateEnv(client); - } - /* Do we have a valid request? */ - if (status == Success) - { - if (stuff->minor_opcode < ASIZE(XETrapDispatchVector)) - { - /* Then vector to the pointed to function */ - status = - (*(XETrapDispatchVector[stuff->minor_opcode]))(stuff,client); - } - else - { - status = BadRequest; - } - } - return(status); -} - -/* - * DESCRIPTION: - * - * This procedure is defined for the call to AddExtension() - * in which it is expected to be a parameter of the call. - * - * This routine would ordinarily be called by the server - * dispatcher when a client makes a request that is handled - * by the extension and the byte ordering of the client is - * DIFFERENT than that of the extension. - */ - -int sXETrapDispatch(ClientPtr client) -{ - - REQUEST(xXTrapReq); - register int status = Success; - - REQUEST_AT_LEAST_SIZE(xXTrapReq); - - /* Have we seen this client before? */ - if (XETenv[client->index] == NULL) - { - status = XETrapCreateEnv(client); - } - /* Do we have a valid request? */ - if (status == Success) - { - if (stuff->minor_opcode < ASIZE(XETSwDispatchVector)) - { - /* Then vector to the pointed to function */ - status = - (*(XETSwDispatchVector[stuff->minor_opcode]))(stuff,client); - } - else - { - status = BadRequest; - } - } - return(status); -} - -/* - * DESCRIPTION: - * - * This routine will place the extension in a steady and known - * state. Any current state will be reset. This is called either - * by a client request (dispatched) or when a new client environment - * is created. - * - */ -int XETrapReset(xXTrapReq *request, ClientPtr client) -{ - static xXTrapConfigReq DummyReq; - register int i; - register int status = Success; - XETrapEnv *penv = XETenv[client->index]; - - /* in case any i/o's pending */ - (void)XETrapStopTrap((xXTrapReq *)NULL, client); - penv->cur.hdr.type = X_Reply; - penv->cur.hdr.length = XEXTRA(xXTrapGetCurReply); - /* Fill in a dummy config request to clear all elements */ - for (i=0L; icur.data_state_flags); i++) - { - penv->cur.data_state_flags[i] = 0L; /* Clear all env flags */ - } - penv->cur.data_config_max_pkt_size = XETrap_avail.data.max_pkt_size; - - return(status); -} - -/* - * DESCRIPTION: - * - * This function sends a reply back to the requesting client indicating - * the available states of the extension can be configured for. - */ -int XETrapGetAvailable(xXTrapGetReq *request, ClientPtr client) -{ - XETrapEnv *penv = XETenv[client->index]; - update_protocol(request, client); - /* Initialize the reply as needed */ - XETrap_avail.data.xtrap_protocol = penv->protocol; - XETrap_avail.hdr.detail = XETrap_GetAvailable; - XETrap_avail.hdr.sequenceNumber = client->sequence; - WriteReplyToClient(client, sizeof(xXTrapGetAvailReply), &XETrap_avail); - return(Success); -} - -/* - * DESCRIPTION: - * - * This function sends a reply back to the requesting client indicating - * the current state of the extension. - */ -int XETrapGetCurrent(xXTrapReq *request, ClientPtr client) -{ - XETrapEnv *penv = XETenv[client->index]; - int rep_size = (penv->protocol == 31 ? 284 : sz_xXTrapGetCurReply); - penv->cur.hdr.length = (rep_size - 32L) / SIZEOF(CARD32); - - /* Initialize the reply as needed */ - penv->cur.hdr.detail = XETrap_GetCurrent; - penv->cur.hdr.sequenceNumber = client->sequence; - WriteReplyToClient(client, rep_size, &(penv->cur)); - - return(Success); -} - -/* - * DESCRIPTION: - * - * This function sends a reply back to the requesting client dumping - * statistics (counts) of requests and events. If stat's isn't - * configured, return failure. - */ -int XETrapGetStatistics(xXTrapReq *request, ClientPtr client) -{ - int status = Success; - XETrapEnv *penv = XETenv[client->index]; - - if ((BitIsTrue(penv->cur.data_config_flags_data, XETrapStatistics)) && - (penv->stats)) - { - /* Initialize the reply as needed */ - int rep_size = sizeof(xXTrapGetStatsReply); - penv->stats->detail = XETrap_GetStatistics; - penv->stats->sequenceNumber = client->sequence; - if (penv->protocol == 31) - { - xXTrapGetStatsReply rep_stats; - rep_stats = *penv->stats; -#ifndef VECTORED_EVENTS - rep_size = 1060; -#else - rep_size = 1544; -#endif - rep_stats.length = (rep_size - 32L) / SIZEOF(CARD32); - /* - * Now we need to shift the data *into* the header area - * for bug compatibility. - */ - memcpy(&(rep_stats.pad0),&(penv->stats->data), - sizeof(XETrapGetStatsRep)); - WriteReplyToClient(client, rep_size, &rep_stats); - } - else - { - WriteReplyToClient(client, rep_size, penv->stats); - } - } - else - { - status = XETrapErrorBase + BadStatistics; - } - return(status); -} - -/* - * DESCRIPTION: - * - * This function is dispatched when a client requests the extension to - * be configured in some manner. - */ -int XETrapConfig(xXTrapConfigReq *request, ClientPtr client) -{ - UByteP vflags = request->config_flags_valid; - UByteP dflags = request->config_flags_data; - UByteP req_flags = request->config_flags_req; - UByteP event_flags = request->config_flags_event; - XETrapEnv *penv = XETenv[client->index]; - UByteP bit_flags = penv->cur.data_config_flags_data; - int status = Success; - CARD32 i = 0L; - - /* Check events and swap if desired */ - if (BitIsTrue(vflags,XETrapEvent)) - { /* Loop through all of the events */ - for (i=0L; icur.data_config_flags_event,i)))) - { /* At this point we *know* there's a change. The - * only question remaining is are there any more - * clients interested in this specific event. If - * so, *don't* swap this process! - */ - if (BitIsTrue(dflags,XETrapEvent)) - { /* Client wants the XTrap rtn */ - if (++(vectored_events[i]) <= 1L) - { /* first client, so do it */ - _SwapProc(&(XETrapEventProcVector[i]), - &(EventProcVector[i])); - } - } - else - { /* Client wants the *real* rtn */ - if (--(vectored_events[i]) <= 0L) - { /* No more clients using, so do it */ - _SwapProc(&(XETrapEventProcVector[i]), - &(EventProcVector[i])); - } - } - switch(i) - { - case KeyPress: /* needed for command key processing */ - case KeyRelease: - XETrapKbdDev->processInputProc = - (void_function)(EventProcVector[i] ? - (void_function)EventProcVector[i] : - (void_function)keybd_process_inp); - XETrapKbdDev->realInputProc = - (void_function)(EventProcVector[i] ? - (void_function)EventProcVector[i] : - (void_function)keybd_process_inp); - break; -#ifndef VECTORED_EVENTS - case ButtonPress: /* hack until events become vectored */ - case ButtonRelease: - case MotionNotify: - XETrapPtrDev->processInputProc = - (void_function)EventProcVector[i]; - XETrapPtrDev->realInputProc = - (void_function)EventProcVector[i]; - break; - default: - status = BadImplementation; - break; -#endif /* !VECTORED_EVENTS */ - } - BitToggle(penv->cur.data_config_flags_event,i); - } - } - } - if ((status == Success) && - (_CheckChangeBit(vflags,dflags,bit_flags,XETrapCmd))) - { - if (BitIsTrue(dflags, XETrapCmd)) - { /* Add accelerator entry to cmd_clients list iff necessary */ - penv->cur.data_config_cmd_key = request->config_cmd_key; - status = add_accelerator_node(penv->client, &cmd_clients); - } - else - { - penv->cur.data_config_cmd_key = 0L; /* default no KeyCode */ - remove_accelerator_node(penv->client, &cmd_clients); - } - } - if ((status == Success) && - (_CheckChangeBit(vflags,dflags,bit_flags,XETrapMaxPacket))) - { - if (BitIsTrue(dflags,XETrapMaxPacket)) - { /* Set size to what's passed in */ - if (request->config_max_pkt_size < XETrapMinPktSize) - { /* Tell them the value is too small */ - status = BadValue; - } - else - { - penv->cur.data_config_max_pkt_size = - request->config_max_pkt_size; - } - } - else - { /* Set it to the default (a *very* big number) */ - penv->cur.data_config_max_pkt_size = 0xFFFF; - } - } - /* If the valid flag is set for requests, then each of the - * requests is swapped if it's different from current state. - */ - if (BitIsTrue(vflags,XETrapRequest) && status == Success) - { /* Loop through all of the core requests */ - for (i=0L; icur.data_config_flags_req,i)))) - { /* At this point we *know* there's a change. The - * only question remaining is are there any more - * clients interested in this specific request. If - * so, *don't* swap this process! - */ - if (BitIsTrue(dflags,XETrapRequest)) - { /* Client wants the XTrap rtn */ - if (++(vectored_requests[i]) <= 1L) - { /* first client, so do it */ - _SwapProc(&(XETrapProcVector[i]), (int_function *)&(ProcVector[i])); - } - } - else - { /* Client wants the *real* rtn */ - if (--(vectored_requests[i]) <= 0L) - { /* No more clients using, so do it */ - _SwapProc(&(XETrapProcVector[i]), (int_function *)&(ProcVector[i])); - } - } - if (status == Success) - { - BitToggle(penv->cur.data_config_flags_req,i); - } - } - } - } - /* Check & Set the boolean flags */ - if (status == Success) - { - _CheckChangeBit(vflags,dflags,bit_flags,XETrapCmdKeyMod); - _CheckChangeBit(vflags,dflags,bit_flags,XETrapTimestamp); - _CheckChangeBit(vflags,dflags,bit_flags,XETrapWinXY); -/* _CheckChangeBit(vflags,dflags,bit_flags,XETrapCursor); */ -#ifdef COLOR_REPLIES - _CheckChangeBit(vflags,dflags,bit_flags,XETrapColorReplies); -#endif /* COLOR_REPLIES */ - if (_CheckChangeBit(vflags,dflags,bit_flags,XETrapGrabServer)) - { /* Let any client uncoditionally set/clear Grabs */ - ignore_grabs = BitValue(dflags, XETrapGrabServer); - } - } - /* The statistics vflag/dflag mechanism is a little different - * from most. The dflag is initially set to 0 to indicate no - * statistics. When a config request comes in to request - * statistics, memory's allocated and the dflag is set. - * Thereafter, whenever a client wants to clear the counters, he - * simply sets the vflag and clears the dflag. Multiple requests - * for statistics configuration are ignored, and the stats memory is - * free'd only when the client disconnects. - */ - if (status == Success) - { - if (_CheckChangeBit(vflags,dflags,bit_flags,XETrapStatistics)) - { - if (BitIsTrue(dflags,XETrapStatistics)) - { /* Do we need to allocate memory? */ - if (penv->stats == NULL && (penv->stats = - (xXTrapGetStatsReply *)Xcalloc(sizeof(xXTrapGetStatsReply))) - != NULL) - { /* Set up the reply header */ - penv->stats->type = X_Reply; - penv->stats->length = XEXTRA(xXTrapGetStatsReply); - /* add accelerator node for stats clients list */ - status = add_accelerator_node(penv->client, &stats_clients); - } - else if (penv->stats == NULL) - { /* No Memory! */ - status = BadAlloc; - } - } - else - { /* Zero out counters */ - (void)memset(penv->stats->data.requests, 0L, - sizeof(penv->stats->data.requests)); - (void)memset(penv->stats->data.events, 0L, - sizeof(penv->stats->data.events)); - /* Re-cock the Stat's flag so that it'll - * sense a change for next zero'ing out - * of the counters. - */ - BitTrue(penv->cur.data_config_flags_data, XETrapStatistics); - } - } - } - return(status); -} - -/* - * DESCRIPTION: - * - * This function sets the XETrapTrapActive bit to indicate that Trapping - * of requests and/or core events to the client may take place. - * - */ -int XETrapStartTrap(xXTrapReq *request, ClientPtr client) -{ - XETrapEnv *penv = XETenv[client->index]; - int status = add_accelerator_node(penv->client, &io_clients); - if (status == Success) - { - BitTrue(penv->cur.data_state_flags, XETrapTrapActive); - } - return(status); -} -/* - * DESCRIPTION: - * - * This function clears the XETrapTrapActive bit to indicate that Trapping - * of requests and/or core events to the client may *not* take place. - * - */ -int XETrapStopTrap(xXTrapReq *request, ClientPtr client) -{ - XETrapEnv *penv = XETenv[client->index]; - - remove_accelerator_node(penv->client, &io_clients); - BitFalse(penv->cur.data_state_flags, XETrapTrapActive); - return(Success); -} - -/* - * DESCRIPTION: - * - * This function sends a reply back to the requesting client indicating - * the specific XTrap version of this extension. - */ -int XETrapGetVersion(xXTrapGetReq *request, ClientPtr client) -{ - xXTrapGetVersReply ver_rep; - XETrapEnv *penv = XETenv[client->index]; - - update_protocol(request,client); /* to agree on protocol version */ - /* Initialize the reply as needed */ - ver_rep.hdr.type = X_Reply; - ver_rep.hdr.detail = XETrap_GetVersion; - ver_rep.hdr.sequenceNumber = client->sequence; - ver_rep.hdr.length = XEXTRA(xXTrapGetVersReply); - ver_rep.data.xtrap_release = XETrap_avail.data.xtrap_release; - ver_rep.data.xtrap_version = XETrap_avail.data.xtrap_version; - ver_rep.data.xtrap_revision = XETrap_avail.data.xtrap_revision; - ver_rep.data.xtrap_protocol = penv->protocol; /* return agreed protocol */ - WriteReplyToClient(client, sizeof(xXTrapGetVersReply), &ver_rep); - return(Success); -} - -/* - * DESCRIPTION: - * - * This function sends a reply back to the requesting client indicating - * the specific XTrap version of this extension. - */ -int XETrapGetLastInpTime(xXTrapReq *request, ClientPtr client) -{ - xXTrapGetLITimReply tim_rep; - XETrapEnv *penv = XETenv[client->index]; - - /* Initialize the reply as needed */ - tim_rep.hdr.type = X_Reply; - tim_rep.hdr.detail = XETrap_GetLastInpTime; - tim_rep.hdr.sequenceNumber = client->sequence; - tim_rep.hdr.length = XEXTRA(xXTrapGetLITimReply); - tim_rep.data_last_time = penv->last_input_time; - WriteReplyToClient(client, sizeof(xXTrapGetLITimReply), &tim_rep); - return(Success); -} - -/* - * DESCRIPTION: - * - * This routine is swapped in for the server's output request vectors. - * After writing the request to one (or more) XTrap client(s), this - * routine ALWAYS returns by calling the REAL output request vector rtn. - * - * Note: Swapped Requests are handled automatically since the unswapped - * vectored routine is called after the request has been swapped. - * IOW, all requests are directed through ProcVector eventually and are - * "unswapped" at that point. It is necessary to swap the data - * back if writing to a swapped client, however, and this is done - * by calling the appropriate XETSwProcVector[] routine. - */ -int XETrapRequestVector(ClientPtr client) -{ - int status = True; - XETrapDatum *pdata, *spdata = NULL; - REQUEST(xResourceReq); - WindowPtr window_ptr; - XETrapEnv *penv; - BYTE *tptr; - ClientList *ioc = &io_clients; - ClientList *stc = &stats_clients; - INT32 asize = sizeof(pdata->hdr) + stuff->length * sizeof(CARD32); - INT32 size = MAX(asize,XETrapMinPktSize); /* Must be at least */ - INT32 csize; /* size of request to send to the XTrap client */ - - /* Get memory for the data to be sent */ - if ((pdata = (XETrapDatum *)Xcalloc(size)) == NULL) - { /* Can't do anything accept set a flag since we don't - * know who to send the error to yet. - */ - status = False; - } - - while (ioc->next != NULL) - { - ioc = ioc->next; - penv = XETenv[ioc->client->index]; - if (status == False) - { /* We didn't get the memory! Complain */ - SendErrorToClient(penv->client,XETrap_avail.data.major_opcode, - stuff->reqType, 0L, BadAlloc); - break; - } - if (BitIsTrue(penv->cur.data_config_flags_req,stuff->reqType)) - { /* This particular client is interested in *this* request */ - pdata->hdr.client = client->index; /* stuff client index in hdr */ - if (BitIsTrue(penv->cur.data_config_flags_data,XETrapWinXY)) - { - if (Success != dixLookupDrawable(&window_ptr, stuff->id, - client, 0, DixUnknownAccess)) - { /* Failed...invalidate the X and Y coordinate data. */ - pdata->hdr.win_x = -1L; - pdata->hdr.win_y = -1L; - } - else - { - pdata->hdr.screen = window_ptr->drawable.pScreen->myNum; - pdata->hdr.win_x = window_ptr->drawable.x; - pdata->hdr.win_y = window_ptr->drawable.y; - } - } - if (BitIsTrue(penv->cur.data_config_flags_data,XETrapTimestamp)) - { - pdata->hdr.timestamp = GetTimeInMillis(); - } - /* Copy the information to a location we can write it from */ - (void) memcpy(&(pdata->u.req),stuff,stuff->length*sizeof(CARD32)); - pdata->hdr.count = MIN(penv->cur.data_config_max_pkt_size,asize); - XETrapSetHeaderRequest(&(pdata->hdr)); - - /* Perform any needed byte/word swapping. NOTE: This is not - * the "normal" technique that should be used to perform the - * swapping. The reason that we do it here is to be sure to - * do it only once in a controlled manner, which we can not - * guarentee in the case of the Xlib transport. Notice that - * we don't swap the XTRAP EVENT information. This is done - * in the XETrapWriteXLib() routine. - */ - - if (penv->client->swapped) - { /* need to deal with swapped clients */ - if (spdata == NULL) - { /* Get memory for the swapped data to be sent */ - if ((spdata = (XETrapDatum *)Xcalloc(size)) == NULL) - { - SendErrorToClient(penv->client, - XETrap_avail.data.major_opcode, - stuff->reqType, 0L, BadAlloc); - break; - } - - memcpy(spdata,pdata,size); /* fill in the info */ - /* Now call the request-specific rtn to swap the request */ - if (stuff->reqType < 128) - { /* a core request, good */ - (*XETSwProcVector[stuff->reqType])(&(spdata->u.req), - penv->client); /* RTC X11R6 */ - } - else if (penv->cur.data_config_max_pkt_size == - XETrapMinPktSize) - { /* Minimum size, so swap it as an ResourceReq */ - XETSwResourceReq(&(spdata->u.req)); - } - else - { /* trying to swap an extension request! */ - SendErrorToClient(penv->client, - XETrap_avail.data.major_opcode, - stuff->reqType, 0L, XETrapErrorBase + BadSwapReq); - } - } - /* need to stow in the latest header (count) */ - memcpy(spdata,pdata,SIZEOF(XETrapHeader)); - sXETrapHeader(&(spdata->hdr)); /* swap the XTrap Header */ - } - /* Write as many bytes of information as the client wants */ - tptr = (BYTE *)(penv->client->swapped ? spdata : pdata); - csize = MAX(pdata->hdr.count, XETrapMinPktSize); - if (XETrapWriteXLib(penv, tptr, csize) != csize) - { - SendErrorToClient(penv->client,XETrap_avail.data.major_opcode, - stuff->reqType, 0L, XETrapErrorBase + BadIO); - } -#ifdef COLOR_REPLIES - /* Process Color Replies, if desired, and applicable */ - if (BitIsTrue(penv->cur.data_config_flags_data,XETrapColorReplies)) - { /* wants color replies */ - switch(stuff->reqType) - { - case X_AllocColor: - GetSendColorRep(client, stuff); - break; - case X_AllocNamedColor: - GetSendNamedColorRep(client, stuff); - break; - case X_AllocColorCells: - GetSendColorCellsRep(client, stuff); - break; - case X_AllocColorPlanes: - GetSendColorPlanesRep(client, stuff); - break; - default: - break; - } - } -#endif /* COLOR_REPLIES */ - } - } - while (stc->next != NULL) - { /* increment appropriate stats bucket for each interested client */ - stc = stc->next; - penv = XETenv[stc->client->index]; - if (BitIsTrue(penv->cur.data_config_flags_req,stuff->reqType)) - { /* This particular client would like this particular stat */ - penv->stats->data.requests[stuff->reqType]++; - } - } - - if (pdata) - { - Xfree(pdata); - } - if (spdata) - { - Xfree(spdata); - } - if (ignore_grabs == True && - (stuff->reqType == X_GrabServer || stuff->reqType == X_UngrabServer)) - { /* doesn't want Grab's! Note: this is a "last configured" setting */ -#ifndef NO_NEW_XTRAP - int status; - - if (stuff->reqType == X_GrabServer) - { - ClientList *pclient; - - /* first call grab server procedure */ - status = (*XETrapProcVector[stuff->reqType])(client); - - /* then add XTrap controlling clients */ - for (pclient = &io_clients; pclient; pclient = pclient->next) - if (pclient->client) - MakeClientGrabImpervious(pclient->client); - } - else - { - ClientList *pclient; - - /* first drop XTrap controlling clients */ - for (pclient = &io_clients; pclient; pclient = pclient->next) - if (pclient->client) - MakeClientGrabPervious(pclient->client); - - /* then call ungrab server procedure */ - status = (*XETrapProcVector[stuff->reqType])(client); - } - return status; -#else /* NO_NEW_XTRAP */ - return(Success); -#endif /* NO_NEW_XTRAP */ - } - else - { - return((*XETrapProcVector[stuff->reqType])(client)); - } -} -/* - * - * DESCRIPTION: - * - * This routine intercepts input xEvents from the keyboard. - * if XETrapTrapActive, will write record to client(s) - * and then pass the event to the server iff not command - * key and gate is open. If it's a command key, then twiddle - * the gate state as required (optional, see below). - * - * This routine implements an optional user specified command key - * that can be used to close the input pipe into the server - * while a client command is generated. The keypress of the - * command key places this routine in command mode, the keyrelease - * exits command mode. - * - * A keypress of the command key followed by the - * optionally specified lock key will place this routine in continuous - * command mode until the command key and lock key are pressed again - * to exit command mode. In the locked state, the client interprets - * keystrokes as it wishes, as commands or as input to a prior command. - * - * Both mechanisms can be used alternately. - * - * IMPLICIT INPUTS : - * - * penv->cur.data_config_cmd_key : - * This is the keycode of the key that is used to stop - * and restart the transmission of intercepted input - * events to the server. If specified, the gate_state - * flag will be set or cleared depending on the state of - * the command_key. - * - * penv->cur.data_config_flags_data.XETrapCmdKeyMod: - * This is the value of the mode in which the command_key - * will operate. It currently has two values: MODIFIER and - * COMMAND_LOCK. MODIFIER mode clears gate_state on - * keypress, and sets gate_state on keyrelease. - * COMMAND_LOCK mode toggles gate_state on - * or off. - * - * gate_closed: - * A flag that is set/cleared in the xtrap_keyboard - * routine that indicates whether intercepted input - * should be passed to the server at any particular - * instance. - * - * - * next_key: - * This variable tracks the state of the next key to be - * pressed or released. It allows the checking of double - * presses of the command key to be sent to the server and - * keeps good state order when the command key is used. - * - * key_ignore: - * This variable indicates whether or not the specific - * key should be ignored for subsequent server processing. - * - */ -int XETrapKeyboard(xEvent *x_event, DevicePtr keybd, int count) -{ - register BYTE type = x_event->u.u.type; - register BYTE detail = x_event->u.u.detail; - XETrapEnv *penv; - ClientList *stc = &stats_clients; - ClientList *cmc = &cmd_clients; - int_function cur_func = XETrapKeyboard; - -#ifdef VERBOSE - if (count != 1L) - { /* We haven't coded for this situation yet! */ - ErrorF("Warning! Event count != 1 (%d)\n", count); - } -#endif - while (stc->next != NULL) - { /* increment appropriate stats bucket for each interested client */ - stc = stc->next; - penv = XETenv[stc->client->index]; - if (BitIsTrue(penv->cur.data_config_flags_event,type)) - { /* This particular client would like this particular stat */ - penv->stats->data.events[type]++; - } - } -#ifndef VECTORED_EVENTS - /* We *only* StampAndMail command keys with vectored events since - * we get much more data by waiting till we get called in XETrapEventVector - */ - XETrapStampAndMail(x_event); /* send to XTrap client if necessry */ -#endif - while (cmc->next != NULL) - { - cmc = cmc->next; - penv = XETenv[cmc->client->index]; - key_ignore = False; - if (detail == penv->cur.data_config_cmd_key) - { - if (BitIsTrue(penv->cur.data_config_flags_data, XETrapCmdKeyMod)) - { - switch (type) - { - case KeyPress: - if (next_key == XEKeyIsEcho) - { - break; - } - gate_closed = True; - next_key = XEKeyIsClear; - break; - - case KeyRelease: - if (next_key == XEKeyIsEcho) - { - next_key = XEKeyIsClear; - break; - } - if (next_key == XEKeyIsClear) - { - next_key = XEKeyIsEcho; - } - else - { /* it's Other, so Clear it */ - next_key = XEKeyIsClear; - } - gate_closed = False; - key_ignore = True; - break; - - default: break; - } - } - else - { - switch (type) - { - case KeyPress: - if (next_key == XEKeyIsEcho) - { - gate_closed = False; - break; - } - /* Open gate on cmd key release */ - if ((next_key == XEKeyIsOther) && - gate_closed == True) - { - break; - } - gate_closed = True; - next_key = XEKeyIsClear; - break; - - case KeyRelease: - if (next_key == XEKeyIsClear) - { - next_key = XEKeyIsEcho; - break; - } - - if (next_key == XEKeyIsEcho) - { - next_key = XEKeyIsClear; - break; - } - - gate_closed = False; - key_ignore = True; - next_key = XEKeyIsClear; - break; - - default: - break; - } - } - } - else - { - next_key = XEKeyIsOther; - } - } - - /* - * If the gate to the server is open, - * and we are not ignoring a keyrelease, - * pass the event to the server for normal processing. - */ -#ifndef VECTORED_EVENTS - if ((gate_closed == False) && (key_ignore == False)) - { - if (XETrapEventProcVector[type] != cur_func) - { /* to protect us from infinite loops */ - (void)(*XETrapEventProcVector[type])(x_event,keybd,count); - } - else - { - (void)(*EventProcVector[type])(x_event,keybd,count); - } - } -#else /* VECTORED_EVENTS */ - if ((gate_closed == False) && (key_ignore == False)) - { /* send event on to server to be trapped again in XETrapEventVector */ - (void)(*keybd_process_inp)(x_event,keybd,count); - } - else - { - XETrapStampAndMail(x_event); /* send to XTrap client if necessry */ - } -#endif - key_ignore = False; /* reset for next time around */ - return 0; -} - -/* - * DESCRIPTION: - * - * This routine intercepts input xEvents from the pointer device - * and passes the input event back to the server for normal processing. - * - * This routine is sensitive to whether input is being passed - * up to the server or not. This state is set by the keyboard - * input routine. - * - * - */ -#ifndef VECTORED_EVENTS -int XETrapPointer(xEvent *x_event, DevicePtr ptrdev, int count) -{ - XETrapEnv *penv; - ClientList *stc = &stats_clients; - int_function cur_func = XETrapPointer; - -#ifdef VERBOSE - if (count != 1L) - { /* We haven't coded for this situation yet! */ - ErrorF("Warning! Event count != 1 (%d)\n", count); - } -#endif - while (stc->next != NULL) - { /* increment appropriate stats bucket for each interested client */ - stc = stc->next; - penv = XETenv[stc->client->index]; - if (BitIsTrue(penv->cur.data_config_flags_event,x_event->u.u.type)) - { /* This particular client would like this particular stat */ - penv->stats->data.events[x_event->u.u.type]++; - } - } - XETrapStampAndMail(x_event); /* send to XTrap client if necessry */ - /* - * If the gate to the server is open, - * pass the event up like nothing has happened. - */ - if (gate_closed == False) - { - if (XETrapEventProcVector[x_event->u.u.type] != cur_func) - { /* to protect us from infinite loops */ - (void)(*XETrapEventProcVector[x_event->u.u.type])(x_event,ptrdev, - count); - } - else - { - (void)(*EventProcVector[x_event->u.u.type])(x_event,ptrdev,count); - } - } - return 0; -} -#endif /* !VECTORED_EVENTS */ - - -/* - * DESCRIPTION: - * - * This routine determines whether it needs to send event data - * to the XTrap Client(s). If so, it timestamps it appropriately - * and writes out both the header and detail information. - * - */ -void XETrapStampAndMail(xEvent *x_event) -{ - XETrapDatum data; - register CARD32 size; - XETrapEnv *penv; - ClientList *ioc = &io_clients; - - /* Currently, we're intercepting core events *before* most - * of the event information's filled in. Specifically, the - * only fields that are valid at this level are: type, detail, - * time, rootX, rootY, and state. - */ - /* Loop through all clients wishing I/O */ - while (ioc->next != NULL) - { - ioc = ioc->next; - penv = XETenv[ioc->client->index]; - /* Do we have a valid fd? Do we care about this event? */ - if (BitIsTrue(penv->cur.data_config_flags_event, x_event->u.u.type)) - { - XETrapSetHeaderEvent(&(data.hdr)); - data.hdr.win_x = data.hdr.win_y = -1L; /* Invalidate req draw */ - data.hdr.screen = 0L; /* not till Events are vectored! */ - data.hdr.client = 0L; /* not till Events are vectored! */ - if (BitIsTrue(penv->cur.data_config_flags_data, - XETrapTimestamp)) - { - data.hdr.timestamp = GetTimeInMillis(); - } - size = data.hdr.count = XETrapMinPktSize; /* Always for evts */ - penv->last_input_time = x_event->u.keyButtonPointer.time; - /* Copy the event information into our local memory */ - (void)memcpy(&(data.u.event),x_event,sizeof(xEvent)); - -#ifdef PANORAMIX - if (!noPanoramiXExtension && - (data.u.event.u.u.type == MotionNotify || - data.u.event.u.u.type == ButtonPress || - data.u.event.u.u.type == ButtonRelease || - data.u.event.u.u.type == KeyPress || - data.u.event.u.u.type == KeyRelease)) { - int scr = XineramaGetCursorScreen(inputInfo.pointer); - data.u.event.u.keyButtonPointer.rootX += - panoramiXdataPtr[scr].x - panoramiXdataPtr[0].x; - data.u.event.u.keyButtonPointer.rootY += - panoramiXdataPtr[scr].y - panoramiXdataPtr[0].y; - } -#endif - - if (penv->client->swapped) - { /* - * Notice that we don't swap the XTRAP EVENT information. - * This is done in the XETrapWriteXLib() routine. - */ - xEvent ToEvent; - (*EventSwapVector[data.u.event.u.u.type & 0177]) - (&data.u.event,&ToEvent); - (void)memcpy(&(data.u.event),&ToEvent,sizeof(ToEvent)); - sXETrapHeader(&(data.hdr)); /* swap the XTrap Header */ - } - /* From this point on, the contents of data is swapped and - * therefore we should not refer to it for information. - */ - if (XETrapWriteXLib(penv, (BYTE *)&data, size) != size) - { - SendErrorToClient(penv->client, - XETrap_avail.data.major_opcode, - x_event->u.u.type, 0L, XETrapErrorBase + BadIO); - } - } - } - return; -} -#ifdef VECTORED_EVENTS -int XETrapEventVector(ClientPtr client, xEvent *x_event) -{ - XETrapDatum data; - register CARD32 size; - XETrapEnv *penv; - ClientList *ioc = &io_clients; - - /* Loop through all clients wishing I/O */ - while (ioc->next != NULL) - { - ioc = ioc->next; - penv = XETenv[ioc->client->index]; - /* Do we care about this event? */ - if (BitIsTrue(penv->cur.data_config_flags_event, x_event->u.u.type)) - { - XETrapSetHeaderEvent(&(data.hdr)); - data.hdr.client = client->index; - data.hdr.win_x = data.hdr.win_y = -1L; /* Invalidate req draw */ - if ((current_screen < 0L) || ((x_event->u.u.type >= KeyPress) && - (x_event->u.u.type <= MotionNotify) && - (!x_event->u.keyButtonPointer.sameScreen))) - { /* we've moved/warped to another screen */ - /* XXX: we're getting the client's pointer root window. - * is this correct? Should it be the client's keyboard? */ - WindowPtr root_win = GetCurrentRootWindow(PickPointer(client)); - current_screen = root_win->drawable.pScreen->myNum; - } - data.hdr.screen = current_screen; - if (BitIsTrue(penv->cur.data_config_flags_data, - XETrapTimestamp)) - { - data.hdr.timestamp = GetTimeInMillis(); - } - size = data.hdr.count = XETrapMinPktSize; /* Always for evts */ - penv->last_input_time = x_event->u.keyButtonPointer.time; - /* Copy the event information into our local memory */ - (void)memcpy(&(data.u.event),x_event,sizeof(xEvent)); - - if (penv->client->swapped) - { - xEvent ToEvent; - (*EventSwapVector[data.u.event.u.u.type & 0177]) - (&data.u.event,&ToEvent); - (void)memcpy(&(data.u.event),&ToEvent,sizeof(ToEvent)); - sXETrapHeader(&(data.hdr)); /* swap the XTrap Header */ - } - /* From this point on, the contents of pdata is swapped and - * therefore we should not refer to it for information. - */ - if (XETrapWriteXLib(penv, (BYTE *)&data, size) != size) - { - SendErrorToClient(penv->client, - XETrap_avail.data.major_opcode, - x_event->u.u.type, 0L, XETrapErrorBase + BadIO); - } - } - } - return; -} -#endif /* VECTORED_EVENTS */ -void sReplyXTrapDispatch(ClientPtr client, int size, char *reply) -{ - register XETrapRepHdr *rep = (XETrapRepHdr *)reply; - - switch(rep->detail) - { - case XETrap_GetAvailable: - { - xXTrapGetAvailReply lrep; - (void)memcpy((char *)&lrep,reply,sizeof(lrep)); - sReplyXETrapGetAvail(client,size,(char *)&lrep); - } - break; - case XETrap_GetCurrent: - { - xXTrapGetCurReply lrep; - (void)memcpy((char *)&lrep,reply,sizeof(lrep)); - sReplyXETrapGetCur(client,size,(char *)&lrep); - } - break; - case XETrap_GetStatistics: - { - xXTrapGetStatsReply lrep; - (void)memcpy((char *)&lrep,reply,sizeof(lrep)); - sReplyXETrapGetStats(client,size,(char *)&lrep); - } - break; - case XETrap_GetVersion: - { - xXTrapGetVersReply lrep; - (void)memcpy((char *)&lrep,reply,sizeof(lrep)); - sReplyXETrapGetVers(client,size,(char *)&lrep); - } - break; - case XETrap_GetLastInpTime: - { - xXTrapGetLITimReply lrep; - (void)memcpy((char *)&lrep,reply,sizeof(lrep)); - sReplyXETrapGetLITim(client,size,(char *)&lrep); - } - break; - default: - SendErrorToClient(client,XETrap_avail.data.major_opcode, - rep->detail, 0L, BadImplementation); - break; - } - return; -} - -/* - * XLib communications routines - */ - -/* - * DESCRIPTION: - * - * This function performs the transport specific functions required - * for writing data back to an XTrap client over XLib. The trick is - * packaging the data into <=32 byte packets to conform to the sizeof - * an X Event. nbytes must be at least equal to XETrapMinPktSize - * - */ -int XETrapWriteXLib(XETrapEnv *penv, BYTE *data, CARD32 nbytes) -{ - CARD32 size, total = 0L; - xETrapDataEvent event; - - /* Initialize the detail field to show the beginning of a datum */ - event.detail = XETrapDataStart; - event.idx = 0L; - - /* This loop could be optimized by not calling Write until after all - * of the events are packaged. However, this would require memory - * games, and may not therefore be a win. - */ - while (nbytes > 0L) - { /* How many bytes can we send in this packet */ - size = (nbytes > sz_EventData) ? sz_EventData : nbytes; - - /* Initialize the event */ - event.type = XETrapData + XETrap_avail.data.event_base; - event.sequenceNumber = penv->client->sequence; - - /* Copy the data we are sending */ - (void)memcpy(event.data,data,size); - if (size < sz_EventData) - (void)memset(event.data+size,0L,sz_EventData-size); - data += size; - nbytes -= size; - total += size; - - /* Set the detail field to show the continuation of datum */ - if (total != size) - { /* this is not the first one */ - event.detail = (nbytes > 0) ? XETrapDataContinued : XETrapDataLast; - } - - /* Send this part to the client */ - WriteEventsToClient(penv->client, 1L, (xEvent *) &event); - event.idx++; /* Bump the index for the next event */ - } - return(total); -} - -/*----------------------------* - * Static Functions - *----------------------------*/ - -static void update_protocol(xXTrapGetReq *reqptr, ClientPtr client) -{ - XETrapEnv *penv = XETenv[client->index]; - /* update protocol number */ - switch (reqptr->protocol) - { - /* known acceptable protocols */ - case 31: - case XETrapProtocol: - penv->protocol = reqptr->protocol; - break; - /* all else */ - default: /* stay backwards compatible */ - penv->protocol = 31; - break; - } -} - -/* Swap 2 functions. This is a function instead of a macro to help to keep - * lint from complaining about mixed types. It seems to work, but I would - * probably classify this as a hack. - */ -static void _SwapProc( register int (**f1)(void), register int (**f2)(void)) -{ - register int (*t1)(void) = *f1; - *f1 = *f2; - *f2 = t1; - - return; -} - -/* - * DESCRIPTION: - * - * This function swaps the byte order of fields within - * the XTrap Event Header. It assumes the data will be - * swapped by code in XETrapRequestVector(). - * - */ -static void sXETrapEvent(xETrapDataEvent *from, xETrapDataEvent *to) -{ - to->type = from->type; - to->detail = from->detail; - cpswaps(from->sequenceNumber,to->sequenceNumber); - cpswapl(from->idx,to->idx); - /* Assumes that the data's already been swapped by XETrapRequestVector */ - memcpy(to->data, from->data, SIZEOF(EventData)); -} - -/* - * DESCRIPTION: - * - * This function adds a node from an accelerator linked-list - * (either io_clients, stats_clients, or cmd_clients). - * - */ -static int add_accelerator_node(ClientPtr client, ClientList *accel) -{ - Bool found = False; - int status = Success; - - while (accel->next != NULL) - { - if (accel->client == client) - { - found = True; /* Client's already known */ - break; - } - else - { - accel = accel->next; - } - } - if (found == False) - { - if ((accel->next = (ClientList *)Xcalloc(sizeof(ClientList))) == NULL) - { - status = BadAlloc; - } - else - { /* fill in the node */ - accel = accel->next; - accel->next = NULL; - accel->client = client; - } - } - return(status); -} -/* - * DESCRIPTION: - * - * This function removes a node from an accelerator linked-list - * (either io_clients, stats_clients, or cmd_clients). - * - */ -static void remove_accelerator_node(ClientPtr client, ClientList *accel) -{ - while (accel->next != NULL) - { - if (accel->next->client == client) - { - ClientList *tmp = accel->next->next; - Xfree(accel->next); - accel->next = tmp; - break; - } - else - { - accel = accel->next; - } - } - - return; -} - -#ifdef COLOR_REPLIES -static void GetSendColorRep(ClientPtr client, xResourceReq *req) -{ /* adapted from ProcAllocColor() in dispatch.c */ - XETrapDatum data; - int retval; - XETrapEnv *penv = XETenv[client->index]; - xAllocColorReply *crep = (xAllocColorReply *)&(data.u.reply); - xAllocColorReq *creq = (xAllocColorReq *)req; - ColormapPtr pmap = (ColormapPtr )LookupIDByType(creq->cmap, RT_COLORMAP); - - /* Fill in the header fields */ - data.hdr.count = XETrapMinPktSize; /* The color replies are 32 bytes */ - XETrapSetHeaderReply(&(data.hdr)); - /* Hack alert: - * We need to pass the "reply" type in the header since replies don't - * contain the id's themselves. However, we're not changing the - * protocol to support this until we decide exactly how we want to - * do *all* replies (e.g. not just ColorReplies). So until then, stow - * the reply id in the screen field which wouldn't normally be used in - * this context. - */ - data.hdr.screen = req->reqType; - if (!pmap) - { - SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, - req->reqType, 0L, BadColor); - return; - } - crep->red = creq->red; - crep->green = creq->green; - crep->blue = creq->blue; - crep->pixel = 0; - if ((retval = AllocColor(pmap, &(crep->red), &(crep->green), - &(crep->blue), &(crep->pixel), client->index)) != Success) - { - SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, - req->reqType, 0L, retval); - return; - } - /* Swap data if necessary */ - if (client->swapped) - { - INT32 n; - swaps(&(crep->red), n); - swaps(&(crep->green), n); - swaps(&(crep->blue), n); - swapl(&(crep->pixel), n); - } - /* Send data to client */ - if (XETrapWriteXLib(penv, (BYTE *)&data, XETrapMinPktSize) - != XETrapMinPktSize) - { - SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, - req->reqType, 0L, XETrapErrorBase + BadIO); - } -} - -static void GetSendNamedColorRep(ClientPtr client, xResourceReq *req) -{ /* adapted from ProcAllocNamedColor() in dispatch.c */ - XETrapDatum data; - XETrapEnv *penv = XETenv[client->index]; - int retval; - xAllocNamedColorReply *nrep = (xAllocNamedColorReply *)&(data.u.reply); - xAllocNamedColorReq *nreq = (xAllocNamedColorReq *)req; - ColormapPtr pcmp = (ColormapPtr )LookupIDByType(nreq->cmap, RT_COLORMAP); - - data.hdr.count = XETrapMinPktSize; /* The color replies are 32 bytes */ - XETrapSetHeaderReply(&(data.hdr)); - /* Hack alert: - * We need to pass the "reply" type in the header since replies don't - * contain the id's themselves. However, we're not changing the - * protocol to support this until we decide exactly how we want to - * do *all* replies (e.g. not just ColorReplies). So until then, stow - * the reply id in the screen field which wouldn't normally be used in - * this context. - */ - data.hdr.screen = req->reqType; - if (!pcmp) - { - SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, - req->reqType, 0L, BadColor); - return; - } - if (!OsLookupColor(pcmp->pScreen->myNum, (char *)&nreq[1], - nreq->nbytes, &(nrep->exactRed), &(nrep->exactGreen), - &(nrep->exactBlue))) - { - SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, - req->reqType, 0L, BadName); - return; - } - nrep->screenRed = nrep->exactRed; - nrep->screenGreen = nrep->exactGreen; - nrep->screenBlue = nrep->exactBlue; - nrep->pixel = 0; - if ((retval = AllocColor(pcmp, &(nrep->screenRed), - &(nrep->screenGreen), &(nrep->screenBlue), &(nrep->pixel), - client->index)) != Success) - { - SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, - req->reqType, 0L, retval); - return; - } - /* Swap data if necessary */ - if (client->swapped) - { - INT32 n; - swapl(&(nrep->pixel), n); - swaps(&(nrep->exactRed), n); - swaps(&(nrep->exactGreen), n); - swaps(&(nrep->exactBlue), n); - swaps(&(nrep->screenRed), n); - swaps(&(nrep->screenGreen), n); - swaps(&(nrep->screenBlue), n); - } - - /* Send data to client */ - if (XETrapWriteXLib(penv, (BYTE *)&data, XETrapMinPktSize) - != XETrapMinPktSize) - { - SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, - req->reqType, 0L, XETrapErrorBase + BadIO); - } -} - -static void GetSendColorCellsRep(ClientPtr client, xResourceReq *req) -{ /* adapted from ProcAllocColorCells() in dispatch.c */ - int retval; - int npixels, nmasks; - unsigned long *ppixels, *pmasks; - long length; - XETrapDatum *data; - XETrapEnv *penv = XETenv[client->index]; - xAllocColorCellsReply *crep; - xAllocColorCellsReq *creq = (xAllocColorCellsReq *)req; - ColormapPtr pmap = (ColormapPtr )LookupIDByType(creq->cmap, RT_COLORMAP); - - if (!pmap) - { - SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, - req->reqType, 0L, BadColor); - return; - } - npixels = creq->colors; - if (!npixels) - { - SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, - req->reqType, 0L, BadValue); - return; - } - nmasks = creq->planes; - length = ((long)npixels + (long)nmasks) * sizeof(Pixel); - data = (XETrapDatum *)xalloc(sizeof(XETrapDatum)+length); - if (!data) - { - SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, - req->reqType, 0L, BadAlloc); - return; - } - data->hdr.count = MIN(penv->cur.data_config_max_pkt_size, - sizeof(XETrapDatum)+length); - XETrapSetHeaderReply(&(data->hdr)); - data->hdr.screen = req->reqType; /* hack! but necessary */ - ppixels = (unsigned long *)((char *)data + sizeof(XETrapDatum)); - pmasks = ppixels + npixels; - if ((retval = AllocColorCells(client->index, pmap, npixels, - nmasks, (Bool)creq->contiguous, ppixels, pmasks)) != Success) - { - SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, - req->reqType, 0L, retval); - xfree(data); - return; - } - crep = (xAllocColorCellsReply *)&(data->u.reply); - crep->nPixels = npixels; - crep->nMasks = nmasks; - /* Swap data if necessary */ - if (client->swapped) - { - INT32 n, i, *ptr; - ptr=(INT32 *)ppixels; - swaps(&(crep->nPixels), n); - swaps(&(crep->nMasks), n); - for (i=0; ihdr.count) - != data->hdr.count) - { - SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, - req->reqType, 0L, XETrapErrorBase + BadIO); - } - xfree(data); -} -static void GetSendColorPlanesRep(ClientPtr client, xResourceReq *req) -{ /* adapted from ProcAllocColorPlanes() in dispatch.c */ - int retval; - int npixels, nmasks; - unsigned long *ppixels, *pmasks; - long length; - XETrapDatum *data; - XETrapEnv *penv = XETenv[client->index]; - xAllocColorPlanesReply *crep; - xAllocColorPlanesReq *creq = (xAllocColorPlanesReq *)req; - ColormapPtr pmap = (ColormapPtr )LookupIDByType(creq->cmap, RT_COLORMAP); - - if (!pmap) - { - SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, - req->reqType, 0L, BadColor); - return; - } - npixels = creq->colors; - if (!npixels) - { - SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, - req->reqType, 0L, BadValue); - return; - } - length = (long)npixels * sizeof(Pixel); - data = (XETrapDatum *)xalloc(sizeof(XETrapDatum)+length); - if (!data) - { - SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, - req->reqType, 0L, BadAlloc); - return; - } - data->hdr.count = MIN(penv->cur.data_config_max_pkt_size, - sizeof(XETrapDatum)+length); - XETrapSetHeaderReply(&(data->hdr)); - data->hdr.screen = req->reqType; /* hack! but necessary */ - ppixels = (unsigned long *)((char *)data + sizeof(XETrapDatum)); - crep = (xAllocColorPlanesReply *)&(data->u.reply); - if ((retval = AllocColorPlanes(client->index, pmap, npixels, - (int)creq->red, (int)creq->green, (int)creq->blue, - (int)creq->contiguous, ppixels, &(crep->redMask), &(crep->greenMask), - &(crep->blueMask))) != Success) - { - SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, - req->reqType, 0L, retval); - xfree(data); - return; - } - crep->nPixels = npixels; - /* Swap data if necessary */ - if (client->swapped) - { - INT32 n, i, *ptr; - ptr=(INT32 *)ppixels; - swaps(&(crep->nPixels), n); - swapl(&(crep->redMask), n); - swapl(&(crep->greenMask), n); - swapl(&(crep->blueMask), n); - for (i=0; ihdr.count) - != data->hdr.count) - { - SendErrorToClient(penv->client, XETrap_avail.data.major_opcode, - req->reqType, 0L, XETrapErrorBase + BadIO); - } - xfree(data); -} -#endif /* COLOR_REPLIES */ diff --git a/XTrap/xtrapdiswp.c b/XTrap/xtrapdiswp.c deleted file mode 100644 index 86c240362..000000000 --- a/XTrap/xtrapdiswp.c +++ /dev/null @@ -1,937 +0,0 @@ -/**************************************************************************** -Copyright 1987, 1988, 1989, 1990, 1991, 1992 by - - Digital Equipment Corp., Maynard, MA - -X11R6 Changes Copyright (c) 1994 by Robert Chesler of Absol-Puter, Hudson, NH. - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL AND ABSOL-PUTER DISCLAIM ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS, IN NO EVENT SHALL DIGITAL OR ABSOL-PUTER BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER -RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF -CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -*****************************************************************************/ -/* - * ABSTRACT: - * - * This module is the device independent module responsible for all - * routines required for proper communication in a heterogeneous - * networking environment (i.e. client & server on different endian - * machines). The bulk of this module is patterned after X11/R4's - * server/dix/swapreq.c ; however, they infact swap fields - * in the exact opposite order since XTrap requires "unswapped" data - * to become "swapped" before sending it to a "swapped" client. - * - * CONTRIBUTORS: - * - * Ken Miller - * Marc Evans - * - * CHANGES: - * - * Robert Chesler - added client arg for X11R6 port in many spots - * - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#define NEED_REPLIES -#define NEED_EVENTS -#include -#include -#include -#include "input.h" /* Server DevicePtr definitions */ -#include "misc.h" -#include "dixstruct.h" -#ifdef PC -# include "extnsist.h" -#else -# include "extnsionst.h" /* Server ExtensionEntry definitions */ -#endif -# include "swapreq.h" /* Server SwapColorItem definition */ -#include -#include - -/* In-coming XTrap requests needing to be swapped to native format */ - -int sXETrapReset(xXTrapReq *request, ClientPtr client) -{ - register char n; - swaps(&(request->length),n); - return(XETrapReset(request,client)); -} - -int sXETrapGetAvailable(xXTrapGetReq *request, ClientPtr client) -{ - register char n; - swaps(&(request->length),n); - swaps(&(request->protocol),n); - return(XETrapGetAvailable(request,client)); -} - -int sXETrapConfig(xXTrapConfigReq *request, ClientPtr client) -{ - register char n; - swaps(&(request->length),n); - swaps(&(request->config_max_pkt_size),n); - return(XETrapConfig(request,client)); -} - -int sXETrapStartTrap(xXTrapReq *request, ClientPtr client) -{ - register char n; - swaps(&(request->length),n); - return(XETrapStartTrap(request,client)); -} - -int sXETrapStopTrap(xXTrapReq *request, ClientPtr client) -{ - register char n; - swaps(&(request->length),n); - return(XETrapStopTrap(request,client)); -} - -int sXETrapGetCurrent(xXTrapReq *request, ClientPtr client) -{ - register char n; - swaps(&(request->length),n); - return(XETrapGetCurrent(request,client)); -} - -int sXETrapGetStatistics(xXTrapReq *request, ClientPtr client) -{ - register char n; - swaps(&(request->length),n); - return(XETrapGetStatistics(request,client)); -} - -#ifndef _XINPUT -int sXETrapSimulateXEvent(xXTrapInputReq *request, ClientPtr client) -{ - register char n; - swaps(&(request->input.x),n); - swaps(&(request->input.y),n); - return(XETrapSimulateXEvent(request,client)); -} -#endif - -int sXETrapGetVersion(xXTrapGetReq *request, ClientPtr client) -{ - register char n; - swaps(&(request->length),n); - swaps(&(request->protocol),n); - return(XETrapGetVersion(request,client)); -} - -int sXETrapGetLastInpTime(xXTrapReq *request, ClientPtr client) -{ - register char n; - swaps(&(request->length),n); - return(XETrapGetLastInpTime(request,client)); -} - - -/* Out-going XTrap replies needing to be swapped *from* native format */ - -void sReplyXETrapGetAvail(ClientPtr client, int size, char *reply) -{ - xXTrapGetAvailReply *rep = (xXTrapGetAvailReply *)reply; - register char n; - swaps(&(rep->hdr.sequenceNumber),n); - swapl(&(rep->hdr.length),n); - swapl(&(rep->data.pf_ident),n); - swaps(&(rep->data.xtrap_release),n); - swaps(&(rep->data.xtrap_version),n); - swaps(&(rep->data.xtrap_revision),n); - swaps(&(rep->data.max_pkt_size),n); - swapl(&(rep->data.major_opcode),n); - swapl(&(rep->data.event_base),n); - swaps(&(rep->data.cur_x),n); - swaps(&(rep->data.cur_y),n); - (void)WriteToClient(client,size,reply); - return; -} -void sReplyXETrapGetVers(ClientPtr client, int size, char *reply) -{ - xXTrapGetVersReply *rep = (xXTrapGetVersReply *)reply; - register char n; - swaps(&(rep->hdr.sequenceNumber),n); - swapl(&(rep->hdr.length),n); - swaps(&(rep->data.xtrap_release),n); - swaps(&(rep->data.xtrap_version),n); - swaps(&(rep->data.xtrap_revision),n); - (void)WriteToClient(client,size,reply); - return; -} -void sReplyXETrapGetLITim(ClientPtr client, int size, char *reply) -{ - xXTrapGetLITimReply *rep = (xXTrapGetLITimReply *)reply; - register char n; - swaps(&(rep->hdr.sequenceNumber),n); - swapl(&(rep->hdr.length),n); - swapl(&(rep->data_last_time),n); - (void)WriteToClient(client,size,reply); - return; -} -void sReplyXETrapGetCur(ClientPtr client, int size, char *reply) -{ - xXTrapGetCurReply *rep = (xXTrapGetCurReply *)reply; - register char n; - swaps(&(rep->hdr.sequenceNumber),n); - swapl(&(rep->hdr.length),n); - swaps(&(rep->data_config_max_pkt_size),n); - (void)WriteToClient(client,size,reply); - return; -} -void sReplyXETrapGetStats(ClientPtr client, int size, char *reply) -{ - xXTrapGetStatsReply *rep = (xXTrapGetStatsReply *)reply; - register char n; - register int i; - long *p; - - swaps(&(rep->sequenceNumber),n); - swapl(&(rep->length),n); - for (i=0L, p = (long *)rep->data.requests; i<256L; i++, p++) - { - swapl(p,n); - } - for (i=0L, p = (long *)rep->data.events; icount), n); - swapl(&(hdr->timestamp), n); - swaps(&(hdr->win_x), n); - swaps(&(hdr->win_y), n); - swaps(&(hdr->client), n); -} - - /* Out-going requests needing to be swapped *from* native format - * aka swapreq.c "equivalents" - */ - -/* The following is used for all requests that have - no fields to be swapped (except "length") */ -void XETSwSimpleReq(register xReq *data) -{ - register char n; - swaps(&(data->length), n); -} - -/* The following is used for all requests that have - only a single 32-bit field to be swapped, coming - right after the "length" field */ - -void XETSwResourceReq(register xResourceReq *data) -{ - register char n; - - swaps(&(data->length), n); - swapl(&(data->id), n); -} - -void XETSwCreateWindow(register xCreateWindowReq *data,ClientPtr client) -{ - register char n; - - swapl(&(data->wid), n); - swapl(&(data->parent), n); - swaps(&(data->x), n); - swaps(&(data->y), n); - swaps(&(data->width), n); - swaps(&(data->height), n); - swaps(&(data->borderWidth), n); - swaps(&(data->class), n); - swapl(&(data->visual), n); - swapl(&(data->mask), n); - SwapRestL(data); - swaps(&(data->length), n); -} - -void XETSwChangeWindowAttributes(register xChangeWindowAttributesReq *data, -ClientPtr client) -{ - register char n; - - swapl(&(data->window), n); - swapl(&(data->valueMask), n); - SwapRestL(data); - swaps(&(data->length), n); -} - -void XETSwReparentWindow(register xReparentWindowReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->window), n); - swapl(&(data->parent), n); - swaps(&(data->x), n); - swaps(&(data->y), n); -} - -void XETSwConfigureWindow(xConfigureWindowReq *data, ClientPtr client) -{ - register char n; - swapl(&(data->window), n); - swaps(&(data->mask), n); - SwapRestL(data); - swaps(&(data->length), n); -} - - -void XETSwInternAtom(register xInternAtomReq *data) -{ - register char n; - swaps(&(data->length), n); - swaps(&(data->nbytes), n); -} - -void XETSwChangeProperty(register xChangePropertyReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->window), n); - swapl(&(data->property), n); - swapl(&(data->type), n); - switch ( data->format ) { - case 8L : break; - case 16L: - SwapShorts((short *)(data + 1), data->nUnits); - break; - case 32L: - SwapLongs((CARD32 *)(data + 1), data->nUnits); - break; - } - swapl(&(data->nUnits), n); -} - -void XETSwDeleteProperty(register xDeletePropertyReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->window), n); - swapl(&(data->property), n); - -} -void XETSwGetProperty(register xGetPropertyReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->window), n); - swapl(&(data->property), n); - swapl(&(data->type), n); - swapl(&(data->longOffset), n); - swapl(&(data->longLength), n); -} - -void XETSwSetSelectionOwner(register xSetSelectionOwnerReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->window), n); - swapl(&(data->selection), n); - swapl(&(data->time), n); -} - -void XETSwConvertSelection(register xConvertSelectionReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->requestor), n); - swapl(&(data->selection), n); - swapl(&(data->target), n); - swapl(&(data->property), n); - swapl(&(data->time), n); -} - -void XETSwSendEvent(register xSendEventReq *data) -{ - register char n; - xEvent eventT; - EventSwapPtr proc; - swapl(&(data->destination), n); - swapl(&(data->eventMask), n); - - /* Swap event */ - proc = EventSwapVector[data->event.u.u.type & 0177]; - if (!proc || proc == NotImplemented) - (*proc)(&(data->event), &eventT); - data->event = eventT; - swaps(&(data->length), n); -} - -void XETSwGrabPointer(register xGrabPointerReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->grabWindow), n); - swaps(&(data->eventMask), n); - swapl(&(data->confineTo), n); - swapl(&(data->cursor), n); - swapl(&(data->time), n); -} - -void XETSwGrabButton(register xGrabButtonReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->grabWindow), n); - swaps(&(data->eventMask), n); - swapl(&(data->confineTo), n); - swapl(&(data->cursor), n); - swaps(&(data->modifiers), n); -} - -void XETSwUngrabButton(register xUngrabButtonReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->grabWindow), n); - swaps(&(data->modifiers), n); -} - -void XETSwChangeActivePointerGrab(register xChangeActivePointerGrabReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->cursor), n); - swapl(&(data->time), n); - swaps(&(data->eventMask), n); -} - -void XETSwGrabKeyboard(register xGrabKeyboardReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->grabWindow), n); - swapl(&(data->time), n); -} - -void XETSwGrabKey(register xGrabKeyReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->grabWindow), n); - swaps(&(data->modifiers), n); -} - -void XETSwUngrabKey(register xUngrabKeyReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->grabWindow), n); - swaps(&(data->modifiers), n); -} - -void XETSwGetMotionEvents(register xGetMotionEventsReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->window), n); - swapl(&(data->start), n); - swapl(&(data->stop), n); -} - -void XETSwTranslateCoords(register xTranslateCoordsReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->srcWid), n); - swapl(&(data->dstWid), n); - swaps(&(data->srcX), n); - swaps(&(data->srcY), n); -} - -void XETSwWarpPointer(register xWarpPointerReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->srcWid), n); - swapl(&(data->dstWid), n); - swaps(&(data->srcX), n); - swaps(&(data->srcY), n); - swaps(&(data->srcWidth), n); - swaps(&(data->srcHeight), n); - swaps(&(data->dstX), n); - swaps(&(data->dstY), n); -} - -void XETSwSetInputFocus(register xSetInputFocusReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->focus), n); - swapl(&(data->time), n); -} - -void XETSwOpenFont(register xOpenFontReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->fid), n); - swaps(&(data->nbytes), n); -} - -void XETSwListFonts(register xListFontsReq *data) -{ - register char n; - swaps(&(data->length), n); - swaps(&(data->maxNames), n); - swaps(&(data->nbytes), n); -} - -void XETSwListFontsWithInfo(register xListFontsWithInfoReq *data) -{ - register char n; - swaps(&(data->length), n); - swaps(&(data->maxNames), n); - swaps(&(data->nbytes), n); -} - -void XETSwSetFontPath(register xSetFontPathReq *data) -{ - register char n; - swaps(&(data->length), n); - swaps(&(data->nFonts), n); -} - -void XETSwCreatePixmap(register xCreatePixmapReq *data) -{ - register char n; - - swaps(&(data->length), n); - swapl(&(data->pid), n); - swapl(&(data->drawable), n); - swaps(&(data->width), n); - swaps(&(data->height), n); -} - -void XETSwCreateGC(register xCreateGCReq *data, ClientPtr client) -{ - register char n; - swapl(&(data->gc), n); - swapl(&(data->drawable), n); - swapl(&(data->mask), n); - SwapRestL(data); - swaps(&(data->length), n); -} - -void XETSwChangeGC(register xChangeGCReq *data, ClientPtr client) -{ - register char n; - swapl(&(data->gc), n); - swapl(&(data->mask), n); - SwapRestL(data); - swaps(&(data->length), n); -} - -void XETSwCopyGC(register xCopyGCReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->srcGC), n); - swapl(&(data->dstGC), n); - swapl(&(data->mask), n); -} - -void XETSwSetDashes(register xSetDashesReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->gc), n); - swaps(&(data->dashOffset), n); - swaps(&(data->nDashes), n); -} - -void XETSwSetClipRectangles(register xSetClipRectanglesReq *data, ClientPtr -client) -{ - register char n; - swapl(&(data->gc), n); - swaps(&(data->xOrigin), n); - swaps(&(data->yOrigin), n); - SwapRestS(data); - swaps(&(data->length), n); -} - -void XETSwClearToBackground(register xClearAreaReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->window), n); - swaps(&(data->x), n); - swaps(&(data->y), n); - swaps(&(data->width), n); - swaps(&(data->height), n); -} - -void XETSwCopyArea(register xCopyAreaReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->srcDrawable), n); - swapl(&(data->dstDrawable), n); - swapl(&(data->gc), n); - swaps(&(data->srcX), n); - swaps(&(data->srcY), n); - swaps(&(data->dstX), n); - swaps(&(data->dstY), n); - swaps(&(data->width), n); - swaps(&(data->height), n); -} - -void XETSwCopyPlane(register xCopyPlaneReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->srcDrawable), n); - swapl(&(data->dstDrawable), n); - swapl(&(data->gc), n); - swaps(&(data->srcX), n); - swaps(&(data->srcY), n); - swaps(&(data->dstX), n); - swaps(&(data->dstY), n); - swaps(&(data->width), n); - swaps(&(data->height), n); - swapl(&(data->bitPlane), n); -} - -/* The following routine is used for all Poly drawing requests - (except FillPoly, which uses a different request format) */ -void XETSwPoly(register xPolyPointReq *data, ClientPtr client) -{ - register char n; - - swapl(&(data->drawable), n); - swapl(&(data->gc), n); - SwapRestS(data); - swaps(&(data->length), n); -} - /* cannot use XETSwPoly for this one, because xFillPolyReq - * is longer than xPolyPointReq, and we don't want to swap - * the difference as shorts! - */ -void XETSwFillPoly(register xFillPolyReq *data, ClientPtr client) -{ - register char n; - - swapl(&(data->drawable), n); - swapl(&(data->gc), n); - SwapRestS(data); - swaps(&(data->length), n); -} - -void XETSwPutImage(register xPutImageReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->drawable), n); - swapl(&(data->gc), n); - swaps(&(data->width), n); - swaps(&(data->height), n); - swaps(&(data->dstX), n); - swaps(&(data->dstY), n); - /* Image should already be swapped */ -} - -void XETSwGetImage(register xGetImageReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->drawable), n); - swaps(&(data->x), n); - swaps(&(data->y), n); - swaps(&(data->width), n); - swaps(&(data->height), n); - swapl(&(data->planeMask), n); -} - -/* ProcPolyText used for both PolyText8 and PolyText16 */ - -void XETSwPolyText(register xPolyTextReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->drawable), n); - swapl(&(data->gc), n); - swaps(&(data->x), n); - swaps(&(data->y), n); -} - -/* ProcImageText used for both ImageText8 and ImageText16 */ - -void XETSwImageText(register xImageTextReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->drawable), n); - swapl(&(data->gc), n); - swaps(&(data->x), n); - swaps(&(data->y), n); -} - -void XETSwCreateColormap(register xCreateColormapReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->mid), n); - swapl(&(data->window), n); - swapl(&(data->visual), n); -} - - -void XETSwCopyColormapAndFree(register xCopyColormapAndFreeReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->mid), n); - swapl(&(data->srcCmap), n); - -} - -void XETSwAllocColor (register xAllocColorReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->cmap), n); - swaps(&(data->red), n); - swaps(&(data->green), n); - swaps(&(data->blue), n); -} - -void XETSwAllocNamedColor (register xAllocNamedColorReq *data) -{ - register char n; - - swaps(&(data->length), n); - swapl(&(data->cmap), n); - swaps(&(data->nbytes), n); -} - -void XETSwAllocColorCells (register xAllocColorCellsReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->cmap), n); - swaps(&(data->colors), n); - swaps(&(data->planes), n); -} - -void XETSwAllocColorPlanes(register xAllocColorPlanesReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->cmap), n); - swaps(&(data->colors), n); - swaps(&(data->red), n); - swaps(&(data->green), n); - swaps(&(data->blue), n); -} - -void XETSwFreeColors (register xFreeColorsReq *data, ClientPtr -client) -{ - register char n; - swapl(&(data->cmap), n); - swapl(&(data->planeMask), n); - SwapRestL(data); - swaps(&(data->length), n); - -} - -void XETSwStoreColors (register xStoreColorsReq *data,ClientPtr -client) -{ - register char n; - unsigned long count; - xColorItem *pItem; - - swapl(&(data->cmap), n); - pItem = (xColorItem *) &(data[1]); - for(count = LengthRestB(data)/sizeof(xColorItem); count != 0; count--) - SwapColorItem(pItem++); - swaps(&(data->length), n); -} - -void XETSwStoreNamedColor (register xStoreNamedColorReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->cmap), n); - swapl(&(data->pixel), n); - swaps(&(data->nbytes), n); -} - -void XETSwQueryColors(register xQueryColorsReq *data, ClientPtr client) -{ - register char n; - swapl(&(data->cmap), n); - SwapRestL(data); - swaps(&(data->length), n); -} - -void XETSwLookupColor(register xLookupColorReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->cmap), n); - swaps(&(data->nbytes), n); -} - -void XETSwCreateCursor(register xCreateCursorReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->cid), n); - swapl(&(data->source), n); - swapl(&(data->mask), n); - swaps(&(data->foreRed), n); - swaps(&(data->foreGreen), n); - swaps(&(data->foreBlue), n); - swaps(&(data->backRed), n); - swaps(&(data->backGreen), n); - swaps(&(data->backBlue), n); - swaps(&(data->x), n); - swaps(&(data->y), n); -} - -void XETSwCreateGlyphCursor(register xCreateGlyphCursorReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->cid), n); - swapl(&(data->source), n); - swapl(&(data->mask), n); - swaps(&(data->sourceChar), n); - swaps(&(data->maskChar), n); - swaps(&(data->foreRed), n); - swaps(&(data->foreGreen), n); - swaps(&(data->foreBlue), n); - swaps(&(data->backRed), n); - swaps(&(data->backGreen), n); - swaps(&(data->backBlue), n); -} - - -void XETSwRecolorCursor(register xRecolorCursorReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->cursor), n); - swaps(&(data->foreRed), n); - swaps(&(data->foreGreen), n); - swaps(&(data->foreBlue), n); - swaps(&(data->backRed), n); - swaps(&(data->backGreen), n); - swaps(&(data->backBlue), n); -} - -void XETSwQueryBestSize (register xQueryBestSizeReq *data) -{ - register char n; - swaps(&(data->length), n); - swapl(&(data->drawable), n); - swaps(&(data->width), n); - swaps(&(data->height), n); - -} - -void XETSwQueryExtension (register xQueryExtensionReq *data) -{ - register char n; - swaps(&(data->length), n); - swaps(&(data->nbytes), n); -} - -void XETSwChangeKeyboardMapping (register xChangeKeyboardMappingReq *data) -{ - register char n; - register long *p; - register int i, count; - - swaps(&(data->length), n); - p = (long *)&(data[1]); - count = data->keyCodes * data->keySymsPerKeyCode; - for(i = 0; i < count; i++) - { - swapl(p, n); - p++; - } -} - - -void XETSwChangeKeyboardControl (register xChangeKeyboardControlReq *data, - ClientPtr client) -{ - register char n; - swapl(&(data->mask), n); - SwapRestL(data); - swaps(&(data->length), n); -} - -void XETSwChangePointerControl (register xChangePointerControlReq *data) -{ - register char n; - swaps(&(data->length), n); - swaps(&(data->accelNum), n); - swaps(&(data->accelDenum), n); - swaps(&(data->threshold), n); -} - - -void XETSwSetScreenSaver (register xSetScreenSaverReq *data) -{ - register char n; - swaps(&(data->length), n); - swaps(&(data->timeout), n); - swaps(&(data->interval), n); -} - -void XETSwChangeHosts(register xChangeHostsReq *data) -{ - register char n; - - swaps(&(data->length), n); - swaps(&(data->hostLength), n); - -} -void XETSwRotateProperties(register xRotatePropertiesReq *data, ClientPtr client) -{ - register char n; - swapl(&(data->window), n); - swaps(&(data->nAtoms), n); - swaps(&(data->nPositions), n); - SwapRestL(data); - swaps(&(data->length), n); -} - -/*ARGSUSED*/ -void XETSwNoOperation(xReq *data) -{ - /* noop -- don't do anything */ -} diff --git a/XTrap/xtrapditbl.c b/XTrap/xtrapditbl.c deleted file mode 100644 index db78c26e2..000000000 --- a/XTrap/xtrapditbl.c +++ /dev/null @@ -1,243 +0,0 @@ -/**************************************************************************** -Copyright 1987, 1988, 1989, 1990, 1991 by Digital Equipment Corp., Maynard, MA - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -*****************************************************************************/ -/* - * ABSTRACT: - * - * This module is contains Vector tables used for swapping and general - * dispatch by the XTrap server extension. - * - * CONTRIBUTORS: - * - * Ken Miller - * Marc Evans - * - */ - -/*-----------------* - * Include Files * - *-----------------*/ -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include -#define NEED_REPLIES -#define NEED_EVENTS -#include -#include -#include -#include "input.h" /* Server DevicePtr definitions */ -#include "misc.h" -#include "dixstruct.h" -#ifdef PC -# include "extnsist.h" -#else -# include "extnsionst.h" /* Server ExtensionEntry definitions */ -#endif -#include -#include - -globaldef void_function XETSwProcVector[256L] = -{ - (void_function)ProcBadRequest, - XETSwCreateWindow, - XETSwChangeWindowAttributes, - XETSwResourceReq, /* GetWindowAttributes */ - XETSwResourceReq, /* DestroyWindow */ - XETSwResourceReq, /* 5 DestroySubwindows */ - XETSwResourceReq, /* XETSwChangeSaveSet, */ - XETSwReparentWindow, - XETSwResourceReq, /* MapWindow */ - XETSwResourceReq, /* MapSubwindows */ - XETSwResourceReq, /* 10 UnmapWindow */ - XETSwResourceReq, /* UnmapSubwindows */ - XETSwConfigureWindow, - XETSwResourceReq, /* XETSwCirculateWindow, */ - XETSwResourceReq, /* GetGeometry */ - XETSwResourceReq, /* 15 QueryTree */ - XETSwInternAtom, - XETSwResourceReq, /* XETSwGetAtomName, */ - XETSwChangeProperty, - XETSwDeleteProperty, - XETSwGetProperty, /* 20 */ - XETSwResourceReq, /* XETSwListProperties, */ - XETSwSetSelectionOwner, - XETSwResourceReq, /* XETSwGetSelectionOwner, */ - XETSwConvertSelection, - XETSwSendEvent, /* 25 */ - XETSwGrabPointer, - XETSwResourceReq, /* XETSwUngrabPointer, */ - XETSwGrabButton, - XETSwUngrabButton, - XETSwChangeActivePointerGrab, /* 30 */ - XETSwGrabKeyboard, - XETSwResourceReq, /* XETSwUngrabKeyboard, */ - XETSwGrabKey, - XETSwUngrabKey, - XETSwResourceReq, /* 35 XETSwAllowEvents, */ - XETSwSimpleReq, /* XETSwGrabServer, */ - XETSwSimpleReq, /* XETSwUngrabServer, */ - XETSwResourceReq, /* XETSwQueryPointer, */ - XETSwGetMotionEvents, - XETSwTranslateCoords, /*40 */ - XETSwWarpPointer, - XETSwSetInputFocus, - XETSwSimpleReq, /* XETSwGetInputFocus, */ - XETSwSimpleReq, /* QueryKeymap, */ - XETSwOpenFont, /* 45 */ - XETSwResourceReq, /* XETSwCloseFont, */ - XETSwResourceReq, /* XETSwQueryFont, */ - XETSwResourceReq, /* XETSwQueryTextExtents, */ - XETSwListFonts, - XETSwListFontsWithInfo, /* 50 */ - XETSwSetFontPath, - XETSwSimpleReq, /* GetFontPath, */ - XETSwCreatePixmap, - XETSwResourceReq, /* XETSwFreePixmap, */ - XETSwCreateGC, /* 55 */ - XETSwChangeGC, - XETSwCopyGC, - XETSwSetDashes, - XETSwSetClipRectangles, - XETSwResourceReq, /* 60 XETSwFreeGC, */ - XETSwClearToBackground, - XETSwCopyArea, - XETSwCopyPlane, - XETSwPoly, /* PolyPoint, */ - XETSwPoly, /* 65 PolyLine */ - XETSwPoly, /* PolySegment, */ - XETSwPoly, /* PolyRectangle, */ - XETSwPoly, /* PolyArc, */ - XETSwFillPoly, - XETSwPoly, /* 70 PolyFillRectangle */ - XETSwPoly, /* PolyFillArc, */ - XETSwPutImage, - XETSwGetImage, - XETSwPolyText, - XETSwPolyText, /* 75 */ - XETSwImageText, - XETSwImageText, - XETSwCreateColormap, - XETSwResourceReq, /* XETSwFreeColormap, */ - XETSwCopyColormapAndFree, /* 80 */ - XETSwResourceReq, /* XETSwInstallColormap, */ - XETSwResourceReq, /* XETSwUninstallColormap, */ - XETSwResourceReq, /* XETSwListInstalledColormaps, */ - XETSwAllocColor, - XETSwAllocNamedColor, /* 85 */ - XETSwAllocColorCells, - XETSwAllocColorPlanes, - XETSwFreeColors, - XETSwStoreColors, - XETSwStoreNamedColor, /* 90 */ - XETSwQueryColors, - XETSwLookupColor, - XETSwCreateCursor, - XETSwCreateGlyphCursor, - XETSwResourceReq, /* 95 XETSwFreeCursor, */ - XETSwRecolorCursor, - XETSwQueryBestSize, - XETSwQueryExtension, - XETSwSimpleReq, /* ListExtensions, */ - XETSwChangeKeyboardMapping, /* 100 */ - XETSwSimpleReq, /* GetKeyboardMapping, */ - XETSwChangeKeyboardControl, - XETSwSimpleReq, /* GetKeyboardControl, */ - XETSwSimpleReq, /* Bell, */ - XETSwChangePointerControl, /* 105 */ - XETSwSimpleReq, /* GetPointerControl, */ - XETSwSetScreenSaver, - XETSwSimpleReq, /* GetScreenSaver, */ - XETSwChangeHosts, - XETSwSimpleReq, /* 110 ListHosts, */ - XETSwSimpleReq, /* XETSwChangeAccessControl, */ - XETSwSimpleReq, /* XETSwChangeCloseDownMode, */ - XETSwResourceReq, /* XETSwKillClient, */ - XETSwRotateProperties, - XETSwSimpleReq, /* 115 ForceScreenSaver */ - XETSwSimpleReq, /* SetPointerMapping, */ - XETSwSimpleReq, /* GetPointerMapping, */ - XETSwSimpleReq, /* SetModifierMapping, */ - XETSwSimpleReq, /* GetModifierMapping, */ - NotImplemented, /* 120 */ - NotImplemented, - NotImplemented, - NotImplemented, - NotImplemented, - NotImplemented, /* 125 */ - NotImplemented, - XETSwNoOperation -}; - -/* NOTE: This array must align with the values of the constants used - * as minor_opcode values in the request structure. Failure to do this - * could result in random code paths. - */ -globaldef int_function XETrapDispatchVector[10L] = -{ - XETrapReset, /* 0 XETrap_Reset */ - XETrapGetAvailable, /* 1 XETrap_GetAvailable */ - XETrapConfig, /* 2 XETrap_Config */ - XETrapStartTrap, /* 3 XETrap_StartTrap */ - XETrapStopTrap, /* 4 XETrap_StopTrap */ - XETrapGetCurrent, /* 5 XETrap_GetCurrent */ - XETrapGetStatistics, /* 6 XETrap_GetStatistics */ -#ifndef _XINPUT - XETrapSimulateXEvent, /* 7 XETrap_SimulateXEvent */ -#endif - XETrapGetVersion, /* 8 XETrap_GetVersion */ - XETrapGetLastInpTime, /* 9 XETrap_GetLastInpTime */ -}; - -/* NOTE: This array must align with the values of the constants used - * as minor_opcode values in the request structure. Failure to do this - * could result in random code paths. - */ -globaldef int_function XETSwDispatchVector[10L] = -{ - sXETrapReset, /* 0 XETrap_Reset */ - sXETrapGetAvailable, /* 1 XETrap_GetAvailable */ - sXETrapConfig, /* 2 XETrap_Config */ - sXETrapStartTrap, /* 3 XETrap_StartTrap */ - sXETrapStopTrap, /* 4 XETrap_StopTrap */ - sXETrapGetCurrent, /* 5 XETrap_GetCurrent */ - sXETrapGetStatistics, /* 6 XETrap_GetStatistics */ -#ifndef _XINPUT - sXETrapSimulateXEvent, /* 7 XETrap_SimulateXEvent */ -#endif - sXETrapGetVersion, /* 8 XETrap_GetVersion */ - sXETrapGetLastInpTime, /* 9 XETrap_GetLastInpTime */ -}; - -/* ProcVector shadow vector */ -globaldef int_function XETrapProcVector[256L] = {XETrapRequestVector}; -/* - * Events are faked as if they're vectored since that's - * the way it'll eventually be (X11 R5?). - */ -#ifndef VECTORED_EVENTS -globaldef int_function EventProcVector[XETrapCoreEvents] = {NULL}; -#endif -globaldef int_function XETrapEventProcVector[XETrapCoreEvents] = {NULL}; - - diff --git a/configure.ac b/configure.ac index ce2721df3..6b2f6ac9e 100644 --- a/configure.ac +++ b/configure.ac @@ -531,7 +531,6 @@ AC_ARG_ENABLE(registry, AS_HELP_STRING([--disable-registry], [Build string AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes]) AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-shm], [Build SHM extension (default: enabled)]), [MITSHM=$enableval], [MITSHM=yes]) AC_ARG_ENABLE(xres, AS_HELP_STRING([--disable-xres], [Build XRes extension (default: enabled)]), [RES=$enableval], [RES=yes]) -AC_ARG_ENABLE(xtrap, AS_HELP_STRING([--disable-xtrap], [Build XTrap extension (default: enabled)]), [XTRAP=$enableval], [XTRAP=yes]) AC_ARG_ENABLE(record, AS_HELP_STRING([--enable-record], [Build Record extension (default: disabled)]), [RECORD=$enableval], [RECORD=no]) AC_ARG_ENABLE(xv, AS_HELP_STRING([--disable-xv], [Build Xv extension (default: enabled)]), [XV=$enableval], [XV=yes]) AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Build XvMC extension (default: enabled)]), [XVMC=$enableval], [XVMC=yes]) @@ -819,13 +818,6 @@ if test "x$MITSHM" = xyes; then AC_DEFINE(HAS_SHM, 1, [Support SHM]) fi -AM_CONDITIONAL(XTRAP, [test "x$XTRAP" = xyes]) -if test "x$XTRAP" = xyes; then - AC_DEFINE(XTRAP, 1, [Support XTrap extension]) - REQUIRED_MODULES="$REQUIRED_MODULES trapproto" - XTRAP_LIB='$(top_builddir)/XTrap/libxtrap.la' -fi - AM_CONDITIONAL(RECORD, [test "x$RECORD" = xyes]) if test "x$RECORD" = xyes; then AC_DEFINE(XRECORD, 1, [Support Record extension]) @@ -1209,7 +1201,7 @@ AC_MSG_RESULT([$XVFB]) AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes]) if test "x$XVFB" = xyes; then - XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB" + XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB" XVFB_SYS_LIBS="$XVFBMODULES_LIBS" AC_SUBST([XVFB_LIBS]) AC_SUBST([XVFB_SYS_LIBS]) @@ -1227,7 +1219,7 @@ AC_MSG_RESULT([$XNEST]) AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes]) if test "x$XNEST" = xyes; then - XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DIX_LIB $OS_LIB $CONFIG_LIB" + XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DIX_LIB $OS_LIB $CONFIG_LIB" XNEST_SYS_LIBS="$XNESTMODULES_LIBS" AC_SUBST([XNEST_LIBS]) AC_SUBST([XNEST_SYS_LIBS]) @@ -1589,7 +1581,7 @@ if test "x$XQUARTZ" = xyes; then AC_DEFINE(ROOTLESS,1,[Build Rootless code]) DARWIN_GLX_LIBS='$(top_builddir)/hw/xquartz/GL/libCGLCore.la $(top_builddir)/glx/libglx.la' - DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $DARWIN_GLX_LIBS" + DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $DARWIN_GLX_LIBS" AC_SUBST([DARWIN_LIBS]) AC_CHECK_LIB([Xplugin],[xp_init],[:]) @@ -1631,9 +1623,9 @@ if test "x$DMX" = xyes; then AC_MSG_ERROR([Xdmx build explicitly requested, but required modules not found.]) fi - DMX_INCLUDES="$XEXT_INC $RENDER_INC $XTRAP_INC $RECORD_INC" + DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC" XDMX_CFLAGS="$DMXMODULES_CFLAGS" - XDMX_LIBS="$XEXT_LIB $FB_LIB $CONFIG_LIB $RENDER_LIB $XTRAP_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB" + XDMX_LIBS="$XEXT_LIB $FB_LIB $CONFIG_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB" XDMX_SYS_LIBS="$DMXMODULES_LIBS" AC_SUBST([XDMX_CFLAGS]) AC_SUBST([XDMX_LIBS]) @@ -1759,7 +1751,7 @@ if test "$KDRIVE" = yes; then KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS" - KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB" + KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB" KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.a' case $host_os in *linux*) @@ -1901,7 +1893,6 @@ dix/Makefile doc/Makefile fb/Makefile record/Makefile -XTrap/Makefile config/Makefile mi/Makefile miext/Makefile diff --git a/hw/xfree86/dixmods/Makefile.am b/hw/xfree86/dixmods/Makefile.am index ed15ca490..f19a852f8 100644 --- a/hw/xfree86/dixmods/Makefile.am +++ b/hw/xfree86/dixmods/Makefile.am @@ -6,10 +6,6 @@ if GLX GLXMODS = libglx.la endif -if XTRAP -XTRAPMOD = libxtrap.la -endif - if DBE DBEMOD = libdbe.la endif @@ -25,8 +21,7 @@ module_LTLIBRARIES = libfb.la \ extsmoduledir = $(moduledir)/extensions extsmodule_LTLIBRARIES = $(RECORDMOD) \ $(DBEMOD) \ - $(GLXMODS) \ - $(XTRAPMOD) + $(GLXMODS) fontsmoduledir = $(moduledir)/fonts fontsmodule_LTLIBRARIES = libfreetype.la @@ -77,7 +72,3 @@ libdixmods_la_CFLAGS = -DXFree86LOADER $(AM_CFLAGS) libxorgxkb_la_SOURCES = xkbVT.c xkbPrivate.c xkbKillSrv.c libxorgxkb_la_LIBADD = $(top_builddir)/dix/libdix.la - -libxtrap_la_LDFLAGS = -avoid-version -libxtrap_la_LIBADD = $(top_builddir)/XTrap/libxtrap.la -libxtrap_la_SOURCES = xf86XTrapModule.c diff --git a/hw/xfree86/dixmods/xf86XTrapModule.c b/hw/xfree86/dixmods/xf86XTrapModule.c deleted file mode 100644 index e89d7751d..000000000 --- a/hw/xfree86/dixmods/xf86XTrapModule.c +++ /dev/null @@ -1,45 +0,0 @@ -/* This is the xf86 module code for the DEC_XTRAP extension. */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "xf86Module.h" - -#include - -extern void DEC_XTRAPInit(INITARGS); - -static MODULESETUPPROTO(xtrapSetup); - -static ExtensionModule xtrapExt = -{ - DEC_XTRAPInit, - XTrapExtName, - NULL, - NULL, - NULL -}; - -static XF86ModuleVersionInfo xtrapVersRec = -{ - "xtrap", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_EXTENSION, /* needs the server extension ABI */ - ABI_EXTENSION_VERSION, - MOD_CLASS_EXTENSION, - {0,0,0,0} -}; - -_X_EXPORT XF86ModuleData xtrapModuleData = { &xtrapVersRec, xtrapSetup, NULL }; - -static pointer -xtrapSetup(pointer module, pointer opts, int *errmaj, int *errmin) { - LoadExtension(&xtrapExt, FALSE); - /* Need a non-NULL return value to indicate success */ - return (pointer)1; -} diff --git a/include/dix-config.h.in b/include/dix-config.h.in index ad74f773b..b088ef814 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -410,9 +410,6 @@ /* Support XTest extension */ #undef XTEST -/* Support XTrap extension */ -#undef XTRAP - /* Support Xv extension */ #undef XV diff --git a/include/xorg-server.h.in b/include/xorg-server.h.in index 5a253c7c6..0fee53da8 100644 --- a/include/xorg-server.h.in +++ b/include/xorg-server.h.in @@ -163,9 +163,6 @@ /* Support XTest extension */ #undef XTEST -/* Support XTrap extension */ -#undef XTRAP - /* Support Xv Extension */ #undef XV diff --git a/mi/miinitext.c b/mi/miinitext.c index 3740daae5..31f994554 100644 --- a/mi/miinitext.c +++ b/mi/miinitext.c @@ -240,9 +240,6 @@ extern void BigReqExtensionInit(INITARGS); #ifdef XIDLE extern void XIdleExtensionInit(INITARGS); #endif -#ifdef XTRAP -extern void DEC_XTRAPInit(INITARGS); -#endif #ifdef SCREENSAVER extern void ScreenSaverExtensionInit (INITARGS); #endif @@ -485,9 +482,6 @@ InitExtensions(int argc, char *argv[]) #ifdef XIDLE if (!noXIdleExtension) XIdleExtensionInit(); #endif -#ifdef XTRAP - if (!noTestExtensions) DEC_XTRAPInit(); -#endif #if defined(SCREENSAVER) if (!noScreenSaverExtension) ScreenSaverExtensionInit (); #endif From 7ce6dcef118139d0ccfc136b9a07f5bf0c078d70 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Wed, 25 Jun 2008 15:06:49 -0700 Subject: [PATCH 48/83] Don't log null device name in XkbDDXLoadKeymapByNames --- xkb/ddxLoad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c index ade13c3af..d6b5f7589 100644 --- a/xkb/ddxLoad.c +++ b/xkb/ddxLoad.c @@ -351,7 +351,7 @@ unsigned missing; (names->compat==NULL)&&(names->symbols==NULL)&& (names->geometry==NULL)) { LogMessage(X_ERROR, "XKB: No components provided for device %s\n", - keybd->name); + keybd->name ? keybd->name : "(unnamed keyboard)"); return 0; } else if (!XkbDDXCompileKeymapByNames(xkb,names,want,need, From 01f0b9c9784c55c94104bafa6dd545b373c64104 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Wed, 25 Jun 2008 19:23:20 -0700 Subject: [PATCH 49/83] xf86GetOptValFreq wants a pointer to double, but maxPixClock is an int --- hw/xfree86/common/xf86Config.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index f0ae730af..ee018eb61 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -2041,6 +2041,7 @@ configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor) XF86ConfModesLinkPtr modeslnk = conf_monitor->mon_modes_sect_lst; Gamma zeros = {0.0, 0.0, 0.0}; float badgamma = 0.0; + double maxPixClock; xf86Msg(X_CONFIG, "| |-->Monitor \"%s\"\n", conf_monitor->mon_identifier); @@ -2175,8 +2176,11 @@ configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor) xf86ProcessOptions(-1, monitorp->options, MonitorOptions); xf86GetOptValBool(MonitorOptions, MON_REDUCEDBLANKING, &monitorp->reducedblanking); - xf86GetOptValFreq(MonitorOptions, MON_MAX_PIX_CLOCK, OPTUNITS_KHZ, - &monitorp->maxPixClock); + if (xf86GetOptValFreq(MonitorOptions, MON_MAX_PIX_CLOCK, OPTUNITS_KHZ, + &maxPixClock) == TRUE) { + monitorp->maxPixClock = (int) maxPixClock; + } + return TRUE; } From f0c56ffd980db19bea271aeebf118bd931f6f40d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 24 Jun 2008 12:58:49 +0930 Subject: [PATCH 50/83] dix: don't dereference dev->key if it doesn't exist. This may happen if we check for a passive grab on a floating pointer device. --- dix/events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dix/events.c b/dix/events.c index f6309f29d..a4deaaa08 100644 --- a/dix/events.c +++ b/dix/events.c @@ -3389,7 +3389,7 @@ CheckPassiveGrabsOnWindow( else gdev = device; } - if (gdev) + if (gdev && gdev->key) xkbi= gdev->key->xkbInfo; #endif tempGrab.modifierDevice = grab->modifierDevice; From 15e4b6c57484b6afb790c7dc1db9f529ba2219cf Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 24 Jun 2008 13:46:40 +0930 Subject: [PATCH 51/83] input: for non-device events (e.g. DevicePresence) use MAX_DEVICES as id. Using id = 0 only worked pre-MPX since XInput didn't allow XOpenDevice for the core devices (0 and 1). Now we can now legally register for events so we may overwrite our device-independent classes with the ones selected for the VCP. So, increase the EMASKSIZE to MAX_DEVICES + 1 and use MAX_DEVICES as the ID when we don't have a device. --- Xi/selectev.c | 4 ++-- dix/devices.c | 7 ++++--- include/inputstr.h | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Xi/selectev.c b/Xi/selectev.c index d3670ab1b..53d8f7408 100644 --- a/Xi/selectev.c +++ b/Xi/selectev.c @@ -106,10 +106,10 @@ HandleDevicePresenceMask(ClientPtr client, WindowPtr win, if (mask == 0) return Success; - /* We always only use mksidx = 0 for events not bound to + /* We always only use mksidx = MAX_DEVICES for events not bound to * devices */ - if (AddExtensionClient (win, client, mask, 0) != Success) + if (AddExtensionClient (win, client, mask, MAX_DEVICES) != Success) return BadAlloc; RecalculateDeviceDeliverableEvents(win); diff --git a/dix/devices.c b/dix/devices.c index 91a43f342..0a68c0e61 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -275,7 +275,7 @@ EnableDevice(DeviceIntPtr dev) ev.time = currentTime.milliseconds; ev.devchange = DeviceEnabled; ev.deviceid = dev->id; - dummyDev.id = 0; + dummyDev.id = MAX_DEVICES; SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask, (xEvent *) &ev, 1); @@ -339,7 +339,7 @@ DisableDevice(DeviceIntPtr dev) ev.time = currentTime.milliseconds; ev.devchange = DeviceDisabled; ev.deviceid = dev->id; - dummyDev.id = 0; + dummyDev.id = MAX_DEVICES; SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask, (xEvent *) &ev, 1); @@ -379,6 +379,7 @@ ActivateDevice(DeviceIntPtr dev) ev.deviceid = dev->id; memset(&dummyDev, 0, sizeof(DeviceIntRec)); + dummyDev.id = MAX_DEVICES; SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask, (xEvent *) &ev, 1); @@ -937,7 +938,7 @@ RemoveDevice(DeviceIntPtr dev) ev.time = currentTime.milliseconds; ev.devchange = DeviceRemoved; ev.deviceid = deviceid; - dummyDev.id = 0; + dummyDev.id = MAX_DEVICES; SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask, (xEvent *) &ev, 1); } diff --git a/include/inputstr.h b/include/inputstr.h index 4c7ec2eb9..e5de6fc31 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -66,7 +66,7 @@ SOFTWARE. #define MAX_DEVICES 20 -#define EMASKSIZE MAX_DEVICES +#define EMASKSIZE MAX_DEVICES + 1 extern DevPrivateKey CoreDevicePrivateKey; From 7ddfb2f1587da3ec1cd27ae270e42700adf4f560 Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Thu, 26 Jun 2008 21:23:31 -0400 Subject: [PATCH 52/83] Fix a leak of window devPrivates in window.c/CrushTree(). --- dix/window.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dix/window.c b/dix/window.c index 137afa0b4..541d19902 100644 --- a/dix/window.c +++ b/dix/window.c @@ -929,6 +929,7 @@ CrushTree(WindowPtr pWin) (*UnrealizeWindow)(pChild); } FreeWindowResources(pChild); + dixFreePrivates(pChild->devPrivates); xfree(pChild); if ( (pChild = pSib) ) break; From d6b8d9eaffaf3f976db330bc35da3d30eb656bac Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Fri, 27 Jun 2008 17:16:35 -0700 Subject: [PATCH 53/83] DRI: Ensure we have the DRI headers from Mesa Change the DRI configure check to look for the dri pkg-config file. This prevents people who built an Xlib libGL from bombing later in the build. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6b2f6ac9e..8abc9a91f 100644 --- a/configure.ac +++ b/configure.ac @@ -867,7 +867,7 @@ if test "x$DRI" = xyes; then AC_DEFINE(XF86DRI, 1, [Build DRI extension]) PKG_CHECK_MODULES([DRIPROTO], [xf86driproto]) PKG_CHECK_MODULES([LIBDRM], [libdrm >= 2.3.0]) - PKG_CHECK_MODULES([GL], [glproto >= 1.4.1 gl >= 7.1.0]) + PKG_CHECK_MODULES([GL], [glproto >= 1.4.1 dri >= 7.1.0]) PKG_CHECK_EXISTS(libdrm >= 2.2.0, [AC_DEFINE([HAVE_LIBDRM_2_2], 1, [Has version 2.2 (or newer) of the drm library])]) From 211e2bdcc677122145998829a7f26610c7c567e6 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 30 Jun 2008 10:29:17 -0400 Subject: [PATCH 54/83] Bump ABI minor numbers for the devPrivate ABI functions. --- hw/xfree86/common/xf86Module.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index 78a22ecd4..fdcd5674b 100644 --- a/hw/xfree86/common/xf86Module.h +++ b/hw/xfree86/common/xf86Module.h @@ -82,11 +82,11 @@ typedef enum { * changed. The minor revision mask is 0x0000FFFF and the major revision * mask is 0xFFFF0000. */ -#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 3) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(4, 0) -#define ABI_XINPUT_VERSION SET_ABI_VERSION(3, 0) -#define ABI_EXTENSION_VERSION SET_ABI_VERSION(1, 0) -#define ABI_FONT_VERSION SET_ABI_VERSION(0, 5) +#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(4, 1) +#define ABI_XINPUT_VERSION SET_ABI_VERSION(3, 1) +#define ABI_EXTENSION_VERSION SET_ABI_VERSION(1, 1) +#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) #define MODINFOSTRING1 0xef23fdc5 #define MODINFOSTRING2 0x10dc023a From b4fbc31e109f1efe78613597f9a91d5363523493 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Sat, 21 Jun 2008 16:00:05 -0400 Subject: [PATCH 55/83] Actually fetch all blocks of EEDID if asked to. --- hw/xfree86/ddc/edid.h | 5 ++++- hw/xfree86/ddc/interpret_edid.c | 14 ++++++++++++++ hw/xfree86/ddc/xf86DDC.c | 32 ++++++++++++++++---------------- hw/xfree86/ddc/xf86DDC.h | 2 +- hw/xfree86/loader/xf86sym.c | 1 + 5 files changed, 36 insertions(+), 18 deletions(-) diff --git a/hw/xfree86/ddc/edid.h b/hw/xfree86/ddc/edid.h index a4e79dae0..45caf6ea9 100644 --- a/hw/xfree86/ddc/edid.h +++ b/hw/xfree86/ddc/edid.h @@ -531,6 +531,9 @@ struct detailed_monitor_section { } section; /* max: 80 */ }; +/* flags */ +#define EDID_COMPLETE_RAWDATA 0x1 + typedef struct { int scrnIndex; struct vendor vendor; @@ -539,7 +542,7 @@ typedef struct { struct established_timings timings1; struct std_timings timings2[8]; struct detailed_monitor_section det_mon[4]; - void *vdif; /* unused */ + unsigned long flags; int no_sections; Uchar *rawData; } xf86Monitor, *xf86MonPtr; diff --git a/hw/xfree86/ddc/interpret_edid.c b/hw/xfree86/ddc/interpret_edid.c index b31969914..941fec2fd 100644 --- a/hw/xfree86/ddc/interpret_edid.c +++ b/hw/xfree86/ddc/interpret_edid.c @@ -118,6 +118,20 @@ xf86InterpretEDID(int scrnIndex, Uchar *block) return NULL; } +xf86MonPtr +xf86InterpretEEDID(int scrnIndex, Uchar *block) +{ + xf86MonPtr m; + + m = xf86InterpretEDID(scrnIndex, block); + if (!m) + return NULL; + + /* extension parse */ + + return m; +} + static void get_vendor_section(Uchar *c, struct vendor *r) { diff --git a/hw/xfree86/ddc/xf86DDC.c b/hw/xfree86/ddc/xf86DDC.c index 8dda35ac4..0d8677637 100644 --- a/hw/xfree86/ddc/xf86DDC.c +++ b/hw/xfree86/ddc/xf86DDC.c @@ -197,21 +197,17 @@ DDC2Read(I2CDevPtr dev, int block, unsigned char *R_Buffer) * Attempts to probe the monitor for EDID information, if NoDDC and NoDDC2 are * unset. EDID information blocks are interpreted and the results returned in * an xf86MonPtr. Unlike xf86DoEDID_DDC[12](), this function will return - * the complete EDID data, including all extension blocks. + * the complete EDID data, including all extension blocks, if the 'complete' + * parameter is TRUE; * * This function does not affect the list of modes used by drivers -- it is up * to the driver to decide policy on what to do with EDID information. * * @return pointer to a new xf86MonPtr containing the EDID information. * @return NULL if no monitor attached or failure to interpret the EDID. - * - * nblocks is an in/out parameter. If non-zero, it defines the number of - * blocks to read from the monitor; zero (or NULL pointer) means read all. - * If non-NULL, on return it will be filled in with the number of blocks - * read. */ xf86MonPtr -xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, int *nblocks) +xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool complete) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; unsigned char *EDID_block = NULL; @@ -242,15 +238,20 @@ xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, int *nblocks) return NULL; if (DDC2Read(dev, 0, EDID_block)) { - tmp = xf86InterpretEDID(scrnIndex, EDID_block); + int i, n = EDID_block[0x7e]; + + if (complete && n) { + EDID_block = xrealloc(EDID_block, EDID1_LEN * (1+n)); + + for (i = 0; i < n; i++) + DDC2Read(dev, i+1, EDID_block + (EDID1_LEN * (1+i))); + } + + tmp = xf86InterpretEEDID(scrnIndex, EDID_block); } - if (nblocks) { - if (tmp) - *nblocks = tmp->no_sections; - else - *nblocks = 0; - } + if (tmp && complete) + tmp->flags |= EDID_COMPLETE_RAWDATA; return tmp; } @@ -269,8 +270,7 @@ xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, int *nblocks) xf86MonPtr xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus) { - int nblocks = 1; - return xf86DoEEDID(scrnIndex, pBus, &nblocks); + return xf86DoEEDID(scrnIndex, pBus, FALSE); } /* diff --git a/hw/xfree86/ddc/xf86DDC.h b/hw/xfree86/ddc/xf86DDC.h index 6e5bf6f7a..8e1eaaca3 100644 --- a/hw/xfree86/ddc/xf86DDC.h +++ b/hw/xfree86/ddc/xf86DDC.h @@ -35,7 +35,7 @@ extern xf86MonPtr xf86DoEDID_DDC2( I2CBusPtr pBus ); -extern xf86MonPtr xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, int *nblocks); +extern xf86MonPtr xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool); extern xf86MonPtr xf86PrintEDID( xf86MonPtr monPtr diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c index 91ca4f71a..6576fe8e9 100644 --- a/hw/xfree86/loader/xf86sym.c +++ b/hw/xfree86/loader/xf86sym.c @@ -1007,6 +1007,7 @@ _X_HIDDEN void *xfree86LookupTab[] = { SYMFUNC(xf86DoEDID_DDC2) SYMFUNC(xf86InterpretEDID) SYMFUNC(xf86PrintEDID) + SYMFUNC(xf86DoEEDID) SYMFUNC(xf86DDCMonitorSet) SYMFUNC(xf86SetDDCproperties) From 4fc18b5fc31aa287e807ee520dc9117296e3d306 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Sat, 21 Jun 2008 16:07:36 -0400 Subject: [PATCH 56/83] Hexdump the whole EDID block if extensions present. --- hw/xfree86/ddc/print_edid.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/hw/xfree86/ddc/print_edid.c b/hw/xfree86/ddc/print_edid.c index f5442adb7..5e89b40c4 100644 --- a/hw/xfree86/ddc/print_edid.c +++ b/hw/xfree86/ddc/print_edid.c @@ -462,22 +462,28 @@ print_number_sections(int scrnIndex, int num) xf86MonPtr xf86PrintEDID(xf86MonPtr m) { - CARD16 i, j; + CARD16 i, j, n; char buf[EDID_WIDTH * 2 + 1]; - if (!(m)) return NULL; + if (!m) return NULL; - print_vendor(m->scrnIndex,&m->vendor); - print_version(m->scrnIndex,&m->ver); - print_display(m->scrnIndex,&m->features, &m->ver); - print_established_timings(m->scrnIndex,&m->timings1); - print_std_timings(m->scrnIndex,m->timings2); - print_detailed_monitor_section(m->scrnIndex,m->det_mon); - print_number_sections(m->scrnIndex,m->no_sections); + print_vendor(m->scrnIndex, &m->vendor); + print_version(m->scrnIndex, &m->ver); + print_display(m->scrnIndex, &m->features, &m->ver); + print_established_timings(m->scrnIndex, &m->timings1); + print_std_timings(m->scrnIndex, m->timings2); + print_detailed_monitor_section(m->scrnIndex, m->det_mon); + print_number_sections(m->scrnIndex, m->no_sections); + + /* extension block section stuff */ xf86DrvMsg(m->scrnIndex, X_INFO, "EDID (in hex):\n"); - - for (i = 0; i < 128; i += j) { + + n = 128; + if (m->flags & EDID_COMPLETE_RAWDATA) + n += m->no_sections * 128; + + for (i = 0; i < n; i += j) { for (j = 0; j < EDID_WIDTH; ++j) { sprintf(&buf[j * 2], "%02x", m->rawData[i + j]); } From bed12dd3df0129b7f28d0a42d470266bd3ae6b38 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Sat, 21 Jun 2008 16:07:54 -0400 Subject: [PATCH 57/83] Do EEDID in RANDR 1.2. --- hw/xfree86/modes/xf86Crtc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index fd72053c7..5a71bcfea 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -2625,15 +2625,16 @@ xf86OutputGetEDIDModes (xf86OutputPtr output) return xf86DDCGetModes(scrn->scrnIndex, edid_mon); } +/* maybe we should care about DDC1? meh. */ _X_EXPORT xf86MonPtr xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus) { ScrnInfoPtr scrn = output->scrn; xf86MonPtr mon; - mon = xf86DoEDID_DDC2 (scrn->scrnIndex, pDDCBus); + mon = xf86DoEEDID(scrn->scrnIndex, pDDCBus, TRUE); if (mon) - xf86DDCApplyQuirks (scrn->scrnIndex, mon); + xf86DDCApplyQuirks(scrn->scrnIndex, mon); return mon; } From 76576c87b0de106e006d1cfa59d42d3a483e966c Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 30 Jun 2008 16:10:37 -0400 Subject: [PATCH 58/83] XInput ABI is 2.1, not 3.1. --- hw/xfree86/common/xf86Module.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index fdcd5674b..5ce6e8a26 100644 --- a/hw/xfree86/common/xf86Module.h +++ b/hw/xfree86/common/xf86Module.h @@ -84,7 +84,7 @@ typedef enum { */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) #define ABI_VIDEODRV_VERSION SET_ABI_VERSION(4, 1) -#define ABI_XINPUT_VERSION SET_ABI_VERSION(3, 1) +#define ABI_XINPUT_VERSION SET_ABI_VERSION(2, 1) #define ABI_EXTENSION_VERSION SET_ABI_VERSION(1, 1) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) From 6447f80c17077f924b2d58e07b38d32429edcb9b Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 30 Jun 2008 13:16:49 -0700 Subject: [PATCH 59/83] Use AC_CHECK_LIB before PKG_CHECK_MODULES for openssl Previously, the code was using PKG_CHECK_EXISTS before PKG_CHECK_MODULES, (to cater to OpenBSD systems that include openssl by default but without a .pc file). But this meant that systems that didn't have openssl installed at all would not get any error message at configure time. Now, if the SHA1_Init function is found in -lcrypto without any additional flags, then that's used. Otherwise, pkg-config is used to find the right flags to link against libcrypto. And if that fails, a nice error message is now generated. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8abc9a91f..d7a3d6893 100644 --- a/configure.ac +++ b/configure.ac @@ -1110,7 +1110,7 @@ if test "x$SHA1_LIB" = "x" ; then [Define to use libmd SHA1 functions instead of OpenSSL libcrypto])]) fi if test "x$SHA1_LIB" = "x" ; then - PKG_CHECK_EXISTS([openssl], + AC_CHECK_LIB([crypto], [SHA1_Init], [], [PKG_CHECK_MODULES([OPENSSL], [openssl], [OPENSSL_LIB_FLAGS=`$PKG_CONFIG --libs-only-L --libs-only-other openssl`])]) SHA1_LIB="$OPENSSL_LIB_FLAGS -lcrypto" From e4335e876d254e446a965259e845ad955da5b5c2 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 30 Jun 2008 15:29:04 -0700 Subject: [PATCH 60/83] Revert "XInput ABI is 2.1, not 3.1." This reverts commit 76576c87b0de106e006d1cfa59d42d3a483e966c. which was an incorrect revert of previous ABI bumps. Those responsible for the accidental ABI bumps in both directions have all been sacked. This allows xf86-input-mouse to build again, for example. --- hw/xfree86/common/xf86Module.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index 5ce6e8a26..fdcd5674b 100644 --- a/hw/xfree86/common/xf86Module.h +++ b/hw/xfree86/common/xf86Module.h @@ -84,7 +84,7 @@ typedef enum { */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) #define ABI_VIDEODRV_VERSION SET_ABI_VERSION(4, 1) -#define ABI_XINPUT_VERSION SET_ABI_VERSION(2, 1) +#define ABI_XINPUT_VERSION SET_ABI_VERSION(3, 1) #define ABI_EXTENSION_VERSION SET_ABI_VERSION(1, 1) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) From 66d7c9de82b5e733e4995f079a96efe612fca881 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 1 Jul 2008 10:55:54 -0400 Subject: [PATCH 61/83] Declare xf86InterpretEEDID() properly. --- hw/xfree86/ddc/xf86DDC.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/xfree86/ddc/xf86DDC.h b/hw/xfree86/ddc/xf86DDC.h index 8e1eaaca3..42d9ce694 100644 --- a/hw/xfree86/ddc/xf86DDC.h +++ b/hw/xfree86/ddc/xf86DDC.h @@ -45,6 +45,10 @@ extern xf86MonPtr xf86InterpretEDID( int screenIndex, Uchar *block ); +extern xf86MonPtr xf86InterpretEEDID( + int screenIndex, Uchar *block +); + extern void xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC); From e2bbf2d248a2d2a2db4adfe9d1bda94cf184d8bd Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 1 Jul 2008 12:01:56 -0400 Subject: [PATCH 62/83] Don't try to load DRI2 if built without it. --- hw/xfree86/common/xf86Config.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index ee018eb61..6fd0273bc 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -121,7 +121,9 @@ static ModuleDefault ModuleDefaults[] = { {.name = "record", .toLoad = TRUE, .load_opt=NULL}, #endif {.name = "dri", .toLoad = TRUE, .load_opt=NULL}, +#ifdef DRI2 {.name = "dri2", .toLoad = TRUE, .load_opt=NULL}, +#endif {.name = NULL, .toLoad = FALSE, .load_opt=NULL} }; From 2e8daee05343b2853b677acf4554def0ceeada00 Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Mon, 30 Jun 2008 17:29:35 -0700 Subject: [PATCH 63/83] Work around the DIX losing mmWidth/mmHeight for RandR 1.1 DDXen. RandR 1.1 has a physical size for each mode. It used to be that the DIX would remember these modes and pass them back up to the DDX when changing the screen configuration. The DDX uses RR_GET_MODE_MM to query the driver for the physical dimensions of the screen, allowing it to preserve the DPI. With RandR 1.2, the physical dimensions are stored as part of the output, rather than per mode. The DIX only uses the sizes passed in from the DDX to select the mode pool for the "default" output, and forgets the physical sizes. Then, when reconfiguring the screen, it makes up a new RRScreenSizeRec using the dimensions from the output, screwing up the DPI. This change works around this problem by ignoring the DIX and querying the real size from the driver. --- hw/xfree86/common/xf86RandR.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c index f6157518e..47023926c 100644 --- a/hw/xfree86/common/xf86RandR.c +++ b/hw/xfree86/common/xf86RandR.c @@ -171,6 +171,25 @@ xf86RandRSetMode (ScreenPtr pScreen, scrp->virtualX = mode->HDisplay; scrp->virtualY = mode->VDisplay; } + + /* + * The DIX forgets the physical dimensions we passed into RRRegisterSize, so + * reconstruct them if possible. + */ + if(scrp->DriverFunc) { + xorgRRModeMM RRModeMM; + + RRModeMM.mode = mode; + RRModeMM.virtX = scrp->virtualX; + RRModeMM.virtY = scrp->virtualY; + RRModeMM.mmWidth = mmWidth; + RRModeMM.mmHeight = mmHeight; + + (*scrp->DriverFunc)(scrp, RR_GET_MODE_MM, &RRModeMM); + + mmWidth = RRModeMM.mmWidth; + mmHeight = RRModeMM.mmHeight; + } if(randrp->rotation & (RR_Rotate_90 | RR_Rotate_270)) { /* If the screen is rotated 90 or 270 degrees, swap the sizes. */ From c8216aede6c4ac41976947521d884fa010913204 Mon Sep 17 00:00:00 2001 From: Jeremy Uejio Date: Tue, 1 Jul 2008 13:37:12 -0700 Subject: [PATCH 64/83] Sun bug #6685465: Xephyr uses wrong or bad colortable in 8-bit mode This bug is caused by Xephyr not handling the RGB byte order correctly of the server where Xephyr is displaying on. The previous code just assumed that the order was RGB and did not take into account that Xservers may use different order (such as BGR). The fix is to add a function to calculate the byte order and bits to shift based on the visual mask and the visual bits_per_rgb (which is usually 8, but could be server dependent). Since the shifts won't change once the display connection has been made, I can cache these values so that Xephyr doesn't have to keep recalculating them everytime it tries to translate the Xephyr colormap entries for Xephyr clients to the actual server colormap entries (i.e. calling the function hostx_set_cmap_entry() repeatedly for every colormap entry). --- hw/kdrive/ephyr/hostx.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index 74f9f1628..171d78c9a 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -565,14 +565,40 @@ hostx_get_visual_masks (EphyrScreenInfo screen, } } +static int +hostx_calculate_color_shift(unsigned long mask, + int bits_per_rgb) +{ + int shift = 0; + while(mask) { + mask = mask >> bits_per_rgb; + if (mask) shift += bits_per_rgb; + } + return shift; +} + void hostx_set_cmap_entry(unsigned char idx, unsigned char r, unsigned char g, unsigned char b) { - /* XXX Will likely break for 8 on 16, not sure if this is correct */ - HostX.cmap[idx] = (r << 16) | (g << 8) | (b); +/* need to calculate the shifts for RGB because server could be BGR. */ +/* XXX Not sure if this is correct for 8 on 16, but this works for 8 on 24.*/ + static int rshift, bshift, gshift = 0; + static int first_time = 1; + if (first_time) { + first_time = 0; + rshift = hostx_calculate_color_shift(HostX.visual->red_mask, + HostX.visual->bits_per_rgb); + gshift = hostx_calculate_color_shift(HostX.visual->green_mask, + HostX.visual->bits_per_rgb); + bshift = hostx_calculate_color_shift(HostX.visual->blue_mask, + HostX.visual->bits_per_rgb); + } + HostX.cmap[idx] = ((r << rshift) & HostX.visual->red_mask) | + ((g << gshift) & HostX.visual->green_mask) | + ((b << bshift) & HostX.visual->blue_mask); } /** From 703a9645f3d547144ea62dd81c41f5356a5f87d8 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 1 Jul 2008 17:50:48 -0400 Subject: [PATCH 65/83] Auf wiedersehen, KAA. --- hw/kdrive/src/Makefile.am | 4 - hw/kdrive/src/kaa.c | 1081 ------------------------------------ hw/kdrive/src/kaa.h | 120 ---- hw/kdrive/src/kaapict.c | 719 ------------------------ hw/kdrive/src/kasync.c | 341 ------------ hw/kdrive/src/kdrive.h | 139 ----- hw/kdrive/src/koffscreen.c | 1 - 7 files changed, 2405 deletions(-) delete mode 100644 hw/kdrive/src/kaa.c delete mode 100644 hw/kdrive/src/kaa.h delete mode 100644 hw/kdrive/src/kaapict.c delete mode 100644 hw/kdrive/src/kasync.c diff --git a/hw/kdrive/src/Makefile.am b/hw/kdrive/src/Makefile.am index 29098c32e..fbb5e511a 100644 --- a/hw/kdrive/src/Makefile.am +++ b/hw/kdrive/src/Makefile.am @@ -20,10 +20,6 @@ endif libkdrive_a_SOURCES = \ fourcc.h \ - kaa.c \ - kaa.h \ - kaapict.c \ - kasync.c \ kcmap.c \ kcurscol.c \ kdrive.c \ diff --git a/hw/kdrive/src/kaa.c b/hw/kdrive/src/kaa.c deleted file mode 100644 index db09e9dba..000000000 --- a/hw/kdrive/src/kaa.c +++ /dev/null @@ -1,1081 +0,0 @@ -/* - * Copyright © 2001 Keith Packard - * - * Partly based on code that is Copyright © The XFree86 Project Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "kdrive.h" -#include "kaa.h" -#include "dixfontstr.h" - -#define DEBUG_MIGRATE 0 -#define DEBUG_PIXMAP 0 -#if DEBUG_MIGRATE -#define DBG_MIGRATE(a) ErrorF a -#else -#define DBG_MIGRATE(a) -#endif -#if DEBUG_PIXMAP -#define DBG_PIXMAP(a) ErrorF a -#else -#define DBG_PIXMAP(a) -#endif - -DevPrivateKey kaaScreenPrivateKey = &kaaScreenPrivateKey; -DevPrivateKey kaaPixmapPrivateKey = &kaaPixmapPrivateKey; - -#define KAA_PIXMAP_SCORE_MOVE_IN 10 -#define KAA_PIXMAP_SCORE_MAX 20 -#define KAA_PIXMAP_SCORE_MOVE_OUT -10 -#define KAA_PIXMAP_SCORE_MIN -20 -#define KAA_PIXMAP_SCORE_PINNED 1000 -#define KAA_PIXMAP_SCORE_INIT 1001 - -void -kaaDrawableDirty (DrawablePtr pDrawable) -{ - PixmapPtr pPixmap; - KaaPixmapPrivPtr pKaaPixmap; - - if (pDrawable->type == DRAWABLE_WINDOW) - pPixmap = (*pDrawable->pScreen->GetWindowPixmap)((WindowPtr) pDrawable); - else - pPixmap = (PixmapPtr)pDrawable; - - pKaaPixmap = KaaGetPixmapPriv(pPixmap); - if (pKaaPixmap != NULL) - pKaaPixmap->dirty = TRUE; -} - -static void -kaaPixmapSave (ScreenPtr pScreen, KdOffscreenArea *area) -{ - PixmapPtr pPixmap = area->privData; - KaaPixmapPriv(pPixmap); - int dst_pitch, src_pitch, bytes; - unsigned char *dst, *src; - int i; - - DBG_MIGRATE (("Save 0x%08x (0x%x) (%dx%d)\n", - pPixmap->drawable.id, - KaaGetPixmapPriv(pPixmap)->area ? - KaaGetPixmapPriv(pPixmap)->area->offset : -1, - pPixmap->drawable.width, - pPixmap->drawable.height)); - - src_pitch = pPixmap->devKind; - dst_pitch = pKaaPixmap->devKind; - - src = pPixmap->devPrivate.ptr; - dst = pKaaPixmap->devPrivate.ptr; - - pPixmap->devKind = dst_pitch; - pPixmap->devPrivate.ptr = dst; - pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pKaaPixmap->area = NULL; - -#if 0 - if (!pKaaPixmap->dirty) - return; -#endif - - kaaWaitSync (pPixmap->drawable.pScreen); - - bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch; - - i = pPixmap->drawable.height; - while (i--) { - memcpy (dst, src, bytes); - dst += dst_pitch; - src += src_pitch; - } -} - -static int -kaaLog2(int val) -{ - int bits; - - if (!val) - return 0; - for (bits = 0; val != 0; bits++) - val >>= 1; - return bits - 1; -} - -static Bool -kaaPixmapAllocArea (PixmapPtr pPixmap) -{ - ScreenPtr pScreen = pPixmap->drawable.pScreen; - KaaScreenPriv (pScreen); - KaaPixmapPriv (pPixmap); - KdScreenPriv (pScreen); - int bpp = pPixmap->drawable.bitsPerPixel; - CARD16 h = pPixmap->drawable.height; - CARD16 w = pPixmap->drawable.width; - int pitch; - - if (pKaaScr->info->flags & KAA_OFFSCREEN_ALIGN_POT && w != 1) - w = 1 << (kaaLog2(w - 1) + 1); - pitch = (w * bpp / 8 + pKaaScr->info->pitchAlign - 1) & - ~(pKaaScr->info->pitchAlign - 1); - - pKaaPixmap->devKind = pPixmap->devKind; - pKaaPixmap->devPrivate = pPixmap->devPrivate; - pKaaPixmap->area = KdOffscreenAlloc (pScreen, pitch * h, - pKaaScr->info->offsetAlign, - FALSE, - kaaPixmapSave, (pointer) pPixmap); - if (!pKaaPixmap->area) - return FALSE; - - DBG_PIXMAP(("++ 0x%08x (0x%x) (%dx%d)\n", - pPixmap->drawable.id, - KaaGetPixmapPriv(pPixmap)->area ? - KaaGetPixmapPriv(pPixmap)->area->offset : -1, - pPixmap->drawable.width, - pPixmap->drawable.height)); - pPixmap->devKind = pitch; - pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pScreenPriv->screen->memory_base + pKaaPixmap->area->offset); - pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - return TRUE; -} - -void -kaaMoveInPixmap (PixmapPtr pPixmap) -{ - ScreenPtr pScreen = pPixmap->drawable.pScreen; - KaaScreenPriv (pScreen); - KaaPixmapPriv (pPixmap); - int dst_pitch, src_pitch, bytes; - unsigned char *dst, *src; - int i; - - DBG_MIGRATE (("-> 0x%08x (0x%x) (%dx%d)\n", - pPixmap->drawable.id, - KaaGetPixmapPriv(pPixmap)->area ? - KaaGetPixmapPriv(pPixmap)->area->offset : -1, - pPixmap->drawable.width, - pPixmap->drawable.height)); - - src = pPixmap->devPrivate.ptr; - src_pitch = pPixmap->devKind; - - if (!kaaPixmapAllocArea (pPixmap)) - return; - - pKaaPixmap->dirty = FALSE; - - if (pKaaScr->info->UploadToScreen) - { - if (pKaaScr->info->UploadToScreen(pPixmap, (char *) src, src_pitch)) - return; - } - - dst = pPixmap->devPrivate.ptr; - dst_pitch = pPixmap->devKind; - - bytes = src_pitch < dst_pitch ? src_pitch : dst_pitch; - - kaaWaitSync (pPixmap->drawable.pScreen); - - i = pPixmap->drawable.height; - while (i--) { - memcpy (dst, src, bytes); - dst += dst_pitch; - src += src_pitch; - } -} - -static void -kaaMoveOutPixmap (PixmapPtr pPixmap) -{ - KaaPixmapPriv (pPixmap); - KdOffscreenArea *area = pKaaPixmap->area; - - DBG_MIGRATE (("<- 0x%08x (0x%x) (%dx%d)\n", - pPixmap->drawable.id, - KaaGetPixmapPriv(pPixmap)->area ? - KaaGetPixmapPriv(pPixmap)->area->offset : -1, - pPixmap->drawable.width, - pPixmap->drawable.height)); - if (area) - { - kaaPixmapSave (pPixmap->drawable.pScreen, area); - KdOffscreenFree (pPixmap->drawable.pScreen, area); - } -} - -void -kaaPixmapUseScreen (PixmapPtr pPixmap) -{ - KaaPixmapPriv (pPixmap); - - if (pKaaPixmap->score == KAA_PIXMAP_SCORE_PINNED) - return; - - if (pKaaPixmap->score == KAA_PIXMAP_SCORE_INIT) { - kaaMoveInPixmap(pPixmap); - pKaaPixmap->score = 0; - } - - if (pKaaPixmap->score < KAA_PIXMAP_SCORE_MAX) - { - pKaaPixmap->score++; - if (!kaaPixmapIsOffscreen(pPixmap) && - pKaaPixmap->score >= KAA_PIXMAP_SCORE_MOVE_IN) - kaaMoveInPixmap (pPixmap); - } - KdOffscreenMarkUsed (pPixmap); -} - -void -kaaPixmapUseMemory (PixmapPtr pPixmap) -{ - KaaPixmapPriv (pPixmap); - - if (pKaaPixmap->score == KAA_PIXMAP_SCORE_PINNED) - return; - - if (pKaaPixmap->score == KAA_PIXMAP_SCORE_INIT) - pKaaPixmap->score = 0; - - if (pKaaPixmap->score > KAA_PIXMAP_SCORE_MIN) - { - pKaaPixmap->score--; - if (pKaaPixmap->area && - pKaaPixmap->score <= KAA_PIXMAP_SCORE_MOVE_OUT) - kaaMoveOutPixmap (pPixmap); - } -} - -static Bool -kaaDestroyPixmap (PixmapPtr pPixmap) -{ - if (pPixmap->refcnt == 1) - { - KaaPixmapPriv (pPixmap); - if (pKaaPixmap->area) - { - DBG_PIXMAP(("-- 0x%08x (0x%x) (%dx%d)\n", - pPixmap->drawable.id, - KaaGetPixmapPriv(pPixmap)->area->offset, - pPixmap->drawable.width, - pPixmap->drawable.height)); - /* Free the offscreen area */ - KdOffscreenFree (pPixmap->drawable.pScreen, pKaaPixmap->area); - pPixmap->devPrivate = pKaaPixmap->devPrivate; - pPixmap->devKind = pKaaPixmap->devKind; - } - } - return fbDestroyPixmap (pPixmap); -} - -static PixmapPtr -kaaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint) -{ - PixmapPtr pPixmap; - KaaPixmapPrivPtr pKaaPixmap; - int bpp; - - bpp = BitsPerPixel (depth); - if (bpp == 32 && depth == 24) - { - int fb; - KdScreenPriv (pScreen); - - for (fb = 0; fb < KD_MAX_FB && pScreenPriv->screen->fb[fb].depth; fb++) - if (pScreenPriv->screen->fb[fb].depth == 24) - { - bpp = pScreenPriv->screen->fb[fb].bitsPerPixel; - break; - } - } - - pPixmap = fbCreatePixmapBpp (pScreen, w, h, depth, bpp, usage_hint); - if (!pPixmap) - return NULL; - pKaaPixmap = KaaGetPixmapPriv(pPixmap); - if (!w || !h) - pKaaPixmap->score = KAA_PIXMAP_SCORE_PINNED; - else - pKaaPixmap->score = KAA_PIXMAP_SCORE_INIT; - - pKaaPixmap->area = NULL; - pKaaPixmap->dirty = FALSE; - - return pPixmap; -} - -Bool -kaaPixmapIsOffscreen(PixmapPtr p) -{ - ScreenPtr pScreen = p->drawable.pScreen; - KdScreenPriv(pScreen); - - return ((unsigned long) ((CARD8 *) p->devPrivate.ptr - - (CARD8 *) pScreenPriv->screen->memory_base) < - pScreenPriv->screen->memory_size); -} - -PixmapPtr -kaaGetOffscreenPixmap (DrawablePtr pDrawable, int *xp, int *yp) -{ - PixmapPtr pPixmap; - int x, y; - - if (pDrawable->type == DRAWABLE_WINDOW) { - pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable); -#ifdef COMPOSITE - x = -pPixmap->screen_x; - y = -pPixmap->screen_y; -#else - x = 0; - y = 0; -#endif - } - else - { - pPixmap = (PixmapPtr) pDrawable; - x = 0; - y = 0; - } - *xp = x; - *yp = y; - if (kaaPixmapIsOffscreen (pPixmap)) - return pPixmap; - else - return NULL; -} - -Bool -kaaDrawableIsOffscreen (DrawablePtr pDrawable) -{ - PixmapPtr pPixmap; - if (pDrawable->type == DRAWABLE_WINDOW) - pPixmap = (*pDrawable->pScreen->GetWindowPixmap) ((WindowPtr) pDrawable); - else - pPixmap = (PixmapPtr) pDrawable; - return kaaPixmapIsOffscreen (pPixmap); -} - -#if 0 -static void -kaaFillTiled(int dst_x, - int dst_y, - int width, - int height, - int src_x, - int src_y, - int src_width, - int src_height, - void (*Copy) (int srcX, - int srcY, - int dstX, - int dstY, - int width, - int height)) -{ - modulus (src_x, src_width, src_x); - modulus (src_y, src_height, src_y); - - while (height) - { - int dst_x_tmp = dst_x; - int src_x_tmp = src_x; - int width_tmp = width; - int height_left = src_height - src_y; - int height_this = min (height, height_left); - - while (width_tmp) - { - int width_left = src_width - src_x_tmp; - int width_this = min (width_tmp, width_left); - - (*Copy) (src_x_tmp, src_y, - dst_x_tmp, dst_y, - width_this, height_this); - - width_tmp -= width_this; - dst_x_tmp += width_this; - } - height -= height_this; - dst_y += height_this; - src_y = 0; - } -} -#endif - -static void -kaaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n, - DDXPointPtr ppt, int *pwidth, int fSorted) -{ - ScreenPtr pScreen = pDrawable->pScreen; - KdScreenPriv (pScreen); - KaaScreenPriv (pScreen); - RegionPtr pClip = fbGetCompositeClip(pGC); - PixmapPtr pPixmap; - BoxPtr pextent, pbox; - int nbox; - int extentX1, extentX2, extentY1, extentY2; - int fullX1, fullX2, fullY1; - int partX1, partX2; - int off_x, off_y; - - if (!pScreenPriv->enabled || - pGC->fillStyle != FillSolid || - !(pPixmap = kaaGetOffscreenPixmap (pDrawable, &off_x, &off_y)) || - !(*pKaaScr->info->PrepareSolid) (pPixmap, - pGC->alu, - pGC->planemask, - pGC->fgPixel)) - { - KdCheckFillSpans (pDrawable, pGC, n, ppt, pwidth, fSorted); - return; - } - - pextent = REGION_EXTENTS(pGC->pScreen, pClip); - extentX1 = pextent->x1; - extentY1 = pextent->y1; - extentX2 = pextent->x2; - extentY2 = pextent->y2; - while (n--) - { - fullX1 = ppt->x; - fullY1 = ppt->y; - fullX2 = fullX1 + (int) *pwidth; - ppt++; - pwidth++; - - if (fullY1 < extentY1 || extentY2 <= fullY1) - continue; - - if (fullX1 < extentX1) - fullX1 = extentX1; - - if (fullX2 > extentX2) - fullX2 = extentX2; - - if (fullX1 >= fullX2) - continue; - - nbox = REGION_NUM_RECTS (pClip); - if (nbox == 1) - { - (*pKaaScr->info->Solid) (fullX1 + off_x, fullY1 + off_y, - fullX2 + off_x, fullY1 + 1 + off_y); - } - else - { - pbox = REGION_RECTS(pClip); - while(nbox--) - { - if (pbox->y1 <= fullY1 && fullY1 < pbox->y2) - { - partX1 = pbox->x1; - if (partX1 < fullX1) - partX1 = fullX1; - partX2 = pbox->x2; - if (partX2 > fullX2) - partX2 = fullX2; - if (partX2 > partX1) - (*pKaaScr->info->Solid) (partX1 + off_x, fullY1 + off_y, - partX2 + off_x, fullY1 + 1 + off_y); - } - pbox++; - } - } - } - (*pKaaScr->info->DoneSolid) (); - kaaDrawableDirty (pDrawable); - kaaMarkSync (pDrawable->pScreen); -} - -void -kaaCopyNtoN (DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - GCPtr pGC, - BoxPtr pbox, - int nbox, - int dx, - int dy, - Bool reverse, - Bool upsidedown, - Pixel bitplane, - void *closure) -{ - KdScreenPriv (pDstDrawable->pScreen); - KaaScreenPriv (pDstDrawable->pScreen); - PixmapPtr pSrcPixmap, pDstPixmap; - int src_off_x, src_off_y; - int dst_off_x, dst_off_y; - - /* Migrate pixmaps to same place as destination */ - if (pScreenPriv->enabled && pSrcDrawable->type == DRAWABLE_PIXMAP) { - if (kaaDrawableIsOffscreen (pDstDrawable)) - kaaPixmapUseScreen ((PixmapPtr) pSrcDrawable); - else - kaaPixmapUseMemory ((PixmapPtr) pSrcDrawable); - } - - if (pScreenPriv->enabled && - (pSrcPixmap = kaaGetOffscreenPixmap (pSrcDrawable, &src_off_x, &src_off_y)) && - (pDstPixmap = kaaGetOffscreenPixmap (pDstDrawable, &dst_off_x, &dst_off_y)) && - (*pKaaScr->info->PrepareCopy) (pSrcPixmap, - pDstPixmap, - dx, - dy, - pGC ? pGC->alu : GXcopy, - pGC ? pGC->planemask : FB_ALLONES)) - { - while (nbox--) - { - (*pKaaScr->info->Copy) (pbox->x1 + dx + src_off_x, - pbox->y1 + dy + src_off_y, - pbox->x1 + dst_off_x, pbox->y1 + dst_off_y, - pbox->x2 - pbox->x1, - pbox->y2 - pbox->y1); - pbox++; - } - (*pKaaScr->info->DoneCopy) (); - kaaMarkSync (pDstDrawable->pScreen); - } - else - { - kaaWaitSync (pDstDrawable->pScreen); - fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, - pbox, nbox, dx, dy, reverse, upsidedown, - bitplane, closure); - } - kaaDrawableDirty (pDstDrawable); -} - -static RegionPtr -kaaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, - int srcx, int srcy, int width, int height, int dstx, int dsty) -{ - return fbDoCopy (pSrcDrawable, pDstDrawable, pGC, - srcx, srcy, width, height, - dstx, dsty, kaaCopyNtoN, 0, 0); -} - -static void -kaaPolyFillRect(DrawablePtr pDrawable, - GCPtr pGC, - int nrect, - xRectangle *prect) -{ - KdScreenPriv (pDrawable->pScreen); - KaaScreenPriv (pDrawable->pScreen); - RegionPtr pClip = fbGetCompositeClip(pGC); - PixmapPtr pPixmap; - register BoxPtr pbox; - BoxPtr pextent; - int extentX1, extentX2, extentY1, extentY2; - int fullX1, fullX2, fullY1, fullY2; - int partX1, partX2, partY1, partY2; - int xoff, yoff; - int xorg, yorg; - int n; - - if (!pScreenPriv->enabled || - pGC->fillStyle != FillSolid || - !(pPixmap = kaaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) || - !(*pKaaScr->info->PrepareSolid) (pPixmap, - pGC->alu, - pGC->planemask, - pGC->fgPixel)) - { - KdCheckPolyFillRect (pDrawable, pGC, nrect, prect); - return; - } - - xorg = pDrawable->x; - yorg = pDrawable->y; - - pextent = REGION_EXTENTS(pGC->pScreen, pClip); - extentX1 = pextent->x1; - extentY1 = pextent->y1; - extentX2 = pextent->x2; - extentY2 = pextent->y2; - while (nrect--) - { - fullX1 = prect->x + xorg; - fullY1 = prect->y + yorg; - fullX2 = fullX1 + (int) prect->width; - fullY2 = fullY1 + (int) prect->height; - prect++; - - if (fullX1 < extentX1) - fullX1 = extentX1; - - if (fullY1 < extentY1) - fullY1 = extentY1; - - if (fullX2 > extentX2) - fullX2 = extentX2; - - if (fullY2 > extentY2) - fullY2 = extentY2; - - if ((fullX1 >= fullX2) || (fullY1 >= fullY2)) - continue; - n = REGION_NUM_RECTS (pClip); - if (n == 1) - { - (*pKaaScr->info->Solid) (fullX1 + xoff, fullY1 + yoff, - fullX2 + xoff, fullY2 + yoff); - } - else - { - pbox = REGION_RECTS(pClip); - /* - * clip the rectangle to each box in the clip region - * this is logically equivalent to calling Intersect() - */ - while(n--) - { - partX1 = pbox->x1; - if (partX1 < fullX1) - partX1 = fullX1; - partY1 = pbox->y1; - if (partY1 < fullY1) - partY1 = fullY1; - partX2 = pbox->x2; - if (partX2 > fullX2) - partX2 = fullX2; - partY2 = pbox->y2; - if (partY2 > fullY2) - partY2 = fullY2; - - pbox++; - - if (partX1 < partX2 && partY1 < partY2) - (*pKaaScr->info->Solid) (partX1 + xoff, partY1 + yoff, - partX2 + xoff, partY2 + yoff); - } - } - } - (*pKaaScr->info->DoneSolid) (); - kaaDrawableDirty (pDrawable); - kaaMarkSync (pDrawable->pScreen); -} - -static void -kaaSolidBoxClipped (DrawablePtr pDrawable, - RegionPtr pClip, - FbBits pm, - FbBits fg, - int x1, - int y1, - int x2, - int y2) -{ - KdScreenPriv (pDrawable->pScreen); - KaaScreenPriv (pDrawable->pScreen); - PixmapPtr pPixmap; - BoxPtr pbox; - int nbox; - int xoff, yoff; - int partX1, partX2, partY1, partY2; - - if (!pScreenPriv->enabled || - !(pPixmap = kaaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) || - !(*pKaaScr->info->PrepareSolid) (pPixmap, GXcopy, pm, fg)) - { - kaaWaitSync (pDrawable->pScreen); - fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel); - fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2, - fbAnd (GXcopy, fg, pm), - fbXor (GXcopy, fg, pm)); - kaaDrawableDirty (pDrawable); - return; - } - for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip); - nbox--; - pbox++) - { - partX1 = pbox->x1; - if (partX1 < x1) - partX1 = x1; - - partX2 = pbox->x2; - if (partX2 > x2) - partX2 = x2; - - if (partX2 <= partX1) - continue; - - partY1 = pbox->y1; - if (partY1 < y1) - partY1 = y1; - - partY2 = pbox->y2; - if (partY2 > y2) - partY2 = y2; - - if (partY2 <= partY1) - continue; - - (*pKaaScr->info->Solid) (partX1 + xoff, partY1 + yoff, - partX2 + xoff, partY2 + yoff); - } - (*pKaaScr->info->DoneSolid) (); - kaaDrawableDirty (pDrawable); - kaaMarkSync (pDrawable->pScreen); -} - -static void -kaaImageGlyphBlt (DrawablePtr pDrawable, - GCPtr pGC, - int x, - int y, - unsigned int nglyph, - CharInfoPtr *ppciInit, - pointer pglyphBase) -{ - FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); - CharInfoPtr *ppci; - CharInfoPtr pci; - unsigned char *pglyph; /* pointer bits in glyph */ - int gWidth, gHeight; /* width and height of glyph */ - FbStride gStride; /* stride of glyph */ - Bool opaque; - int n; - int gx, gy; - void (*glyph) (FbBits *, - FbStride, - int, - FbStip *, - FbBits, - int, - int); - FbBits *dst; - FbStride dstStride; - int dstBpp; - int dstXoff, dstYoff; - FbBits depthMask; - - depthMask = FbFullMask(pDrawable->depth); - if ((pGC->planemask & depthMask) != depthMask) - { - KdCheckImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppciInit, pglyphBase); - return; - } - glyph = 0; - fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); - switch (dstBpp) { - case 8: glyph = fbGlyph8; break; - case 16: glyph = fbGlyph16; break; - case 24: glyph = fbGlyph24; break; - case 32: glyph = fbGlyph32; break; - } - - x += pDrawable->x; - y += pDrawable->y; - - if (TERMINALFONT (pGC->font) && !glyph) - { - opaque = TRUE; - } - else - { - int xBack, widthBack; - int yBack, heightBack; - - ppci = ppciInit; - n = nglyph; - widthBack = 0; - while (n--) - widthBack += (*ppci++)->metrics.characterWidth; - - xBack = x; - if (widthBack < 0) - { - xBack += widthBack; - widthBack = -widthBack; - } - yBack = y - FONTASCENT(pGC->font); - heightBack = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font); - kaaSolidBoxClipped (pDrawable, - fbGetCompositeClip(pGC), - pGC->planemask, - pGC->bgPixel, - xBack, - yBack, - xBack + widthBack, - yBack + heightBack); - opaque = FALSE; - } - - kaaWaitSync (pDrawable->pScreen); - kaaDrawableDirty (pDrawable); - - ppci = ppciInit; - while (nglyph--) - { - pci = *ppci++; - pglyph = FONTGLYPHBITS(pglyphBase, pci); - gWidth = GLYPHWIDTHPIXELS(pci); - gHeight = GLYPHHEIGHTPIXELS(pci); - if (gWidth && gHeight) - { - gx = x + pci->metrics.leftSideBearing; - gy = y - pci->metrics.ascent; - if (glyph && gWidth <= sizeof (FbStip) * 8 && - fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight)) - { - (*glyph) (dst + (gy + dstYoff) * dstStride, - dstStride, - dstBpp, - (FbStip *) pglyph, - pPriv->fg, - gx + dstXoff, - gHeight); - } - else - { - gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip); - fbPutXYImage (pDrawable, - fbGetCompositeClip(pGC), - pPriv->fg, - pPriv->bg, - pPriv->pm, - GXcopy, - opaque, - - gx, - gy, - gWidth, gHeight, - - (FbStip *) pglyph, - gStride, - 0); - } - } - x += pci->metrics.characterWidth; - } -} - -static const GCOps kaaOps = { - kaaFillSpans, - KdCheckSetSpans, - KdCheckPutImage, - kaaCopyArea, - KdCheckCopyPlane, - KdCheckPolyPoint, - KdCheckPolylines, - KdCheckPolySegment, - miPolyRectangle, - KdCheckPolyArc, - miFillPolygon, - kaaPolyFillRect, - miPolyFillArc, - miPolyText8, - miPolyText16, - miImageText8, - miImageText16, - kaaImageGlyphBlt, - KdCheckPolyGlyphBlt, - KdCheckPushPixels, -}; - -static void -kaaValidateGC (GCPtr pGC, Mask changes, DrawablePtr pDrawable) -{ - fbValidateGC (pGC, changes, pDrawable); - - if (kaaDrawableIsOffscreen (pDrawable)) - pGC->ops = (GCOps *) &kaaOps; - else - pGC->ops = (GCOps *) &kdAsyncPixmapGCOps; -} - -GCFuncs kaaGCFuncs = { - kaaValidateGC, - miChangeGC, - miCopyGC, - miDestroyGC, - miChangeClip, - miDestroyClip, - miCopyClip -}; - -static int -kaaCreateGC (GCPtr pGC) -{ - if (!fbCreateGC (pGC)) - return FALSE; - - pGC->funcs = &kaaGCFuncs; - - return TRUE; -} - - -static void -kaaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) -{ - RegionRec rgnDst; - int dx, dy; - PixmapPtr pPixmap = (*pWin->drawable.pScreen->GetWindowPixmap) (pWin); - - dx = ptOldOrg.x - pWin->drawable.x; - dy = ptOldOrg.y - pWin->drawable.y; - REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); - - REGION_INIT (pWin->drawable.pScreen, &rgnDst, NullBox, 0); - - REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc); -#ifdef COMPOSITE - if (pPixmap->screen_x || pPixmap->screen_y) - REGION_TRANSLATE (pWin->drawable.pScreen, &rgnDst, - -pPixmap->screen_x, -pPixmap->screen_y); -#endif - - fbCopyRegion (&pPixmap->drawable, &pPixmap->drawable, - 0, - &rgnDst, dx, dy, kaaCopyNtoN, 0, 0); - - REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); -} - -static void -kaaFillRegionSolid (DrawablePtr pDrawable, - RegionPtr pRegion, - Pixel pixel) -{ - KdScreenPriv(pDrawable->pScreen); - KaaScreenPriv(pDrawable->pScreen); - PixmapPtr pPixmap; - int xoff, yoff; - - if (pScreenPriv->enabled && - (pPixmap = kaaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) && - (*pKaaScr->info->PrepareSolid) (pPixmap, GXcopy, FB_ALLONES, pixel)) - { - int nbox = REGION_NUM_RECTS (pRegion); - BoxPtr pBox = REGION_RECTS (pRegion); - - while (nbox--) - { - (*pKaaScr->info->Solid) (pBox->x1 + xoff, pBox->y1 + yoff, - pBox->x2 + xoff, pBox->y2 + yoff); - pBox++; - } - (*pKaaScr->info->DoneSolid) (); - kaaMarkSync (pDrawable->pScreen); - } - else - { - kaaWaitSync (pDrawable->pScreen); - fbFillRegionSolid (pDrawable, pRegion, 0, - fbReplicatePixel (pixel, pDrawable->bitsPerPixel)); - } - kaaDrawableDirty (pDrawable); -} - -Bool -kaaDrawInit (ScreenPtr pScreen, - KaaScreenInfoPtr pScreenInfo) -{ - KaaScreenPrivPtr pKaaScr; - KdScreenPriv(pScreen); - KdScreenInfo *screen = pScreenPriv->screen; -#ifdef RENDER - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); -#endif - - pKaaScr = xalloc (sizeof (KaaScreenPrivRec)); - - if (!pKaaScr) - return FALSE; - - pKaaScr->info = pScreenInfo; - - dixSetPrivate(&pScreen->devPrivates, kaaScreenPrivateKey, pKaaScr); - - /* - * Hook up asynchronous drawing - */ - KdScreenInitAsync (pScreen); - /* - * Replace various fb screen functions - */ - pScreen->CreateGC = kaaCreateGC; - pScreen->CopyWindow = kaaCopyWindow; -#ifdef RENDER - if (ps) { - ps->Composite = kaaComposite; - ps->RasterizeTrapezoid = kaaRasterizeTrapezoid; - } -#endif - - /* - * Hookup offscreen pixmaps - */ - if ((pKaaScr->info->flags & KAA_OFFSCREEN_PIXMAPS) && - screen->off_screen_base < screen->memory_size) - { - if (!dixRequestPrivate(kaaPixmapPrivateKey, sizeof (KaaPixmapPrivRec))) - return FALSE; - pScreen->CreatePixmap = kaaCreatePixmap; - pScreen->DestroyPixmap = kaaDestroyPixmap; - } - - return TRUE; -} - -void -kaaDrawFini (ScreenPtr pScreen) -{ - KaaScreenPriv(pScreen); - - xfree (pKaaScr); -} - -void -kaaMarkSync (ScreenPtr pScreen) -{ - KdScreenPriv(pScreen); - KaaScreenPriv(pScreen); - - pScreenPriv->card->needSync = TRUE; - if (pKaaScr->info->markSync != NULL) { - pScreenPriv->card->lastMarker = (*pKaaScr->info->markSync) (pScreen); - } -} - -void -kaaWaitSync (ScreenPtr pScreen) -{ - KdScreenPriv(pScreen); - KaaScreenPriv(pScreen); - KdCardInfo *card = pScreenPriv->card; - - if (card->needSync) { - (*pKaaScr->info->waitMarker) (pScreen, card->lastMarker); - card->needSync = FALSE; - } -} diff --git a/hw/kdrive/src/kaa.h b/hw/kdrive/src/kaa.h deleted file mode 100644 index 90b963b10..000000000 --- a/hw/kdrive/src/kaa.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright © 2001 Keith Packard - * - * Partly based on code that is Copyright © The XFree86 Project Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _KAA_H_ -#define _KAA_H_ - -#include "picturestr.h" - -#define KaaGetScreenPriv(s) ((KaaScreenPrivPtr) \ - dixLookupPrivate(&(s)->devPrivates, kaaScreenPrivateKey)) -#define KaaScreenPriv(s) KaaScreenPrivPtr pKaaScr = KaaGetScreenPriv(s) - -#define KaaGetPixmapPriv(p) ((KaaPixmapPrivPtr) \ - dixLookupPrivate(&(p)->devPrivates, kaaPixmapPrivateKey)) -#define KaaSetPixmapPriv(p,a) \ - dixSetPrivate(&(p)->devPrivates, kaaPixmapPrivateKey, a) -#define KaaPixmapPriv(p) KaaPixmapPrivPtr pKaaPixmap = KaaGetPixmapPriv(p) - -typedef struct { - KaaScreenInfoPtr info; -} KaaScreenPrivRec, *KaaScreenPrivPtr; - -typedef struct { - KdOffscreenArea *area; - int score; - int devKind; - DevUnion devPrivate; - Bool dirty; -} KaaPixmapPrivRec, *KaaPixmapPrivPtr; - -extern DevPrivateKey kaaScreenPrivateKey; -extern DevPrivateKey kaaPixmapPrivateKey; - - -void -kaaPixmapUseScreen (PixmapPtr pPixmap); - -void -kaaPixmapUseMemory (PixmapPtr pPixmap); - -void -kaaDrawableDirty(DrawablePtr pDrawable); - -Bool -kaaDrawableIsOffscreen (DrawablePtr pDrawable); - -Bool -kaaPixmapIsOffscreen(PixmapPtr p); - -PixmapPtr -kaaGetOffscreenPixmap (DrawablePtr pDrawable, int *xp, int *yp); - -void -kaaMoveInPixmap (PixmapPtr pPixmap); - -void -kaaMarkSync (ScreenPtr pScreen); - -void -kaaWaitSync (ScreenPtr pScreen); - -void -kaaCopyNtoN (DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - GCPtr pGC, - BoxPtr pbox, - int nbox, - int dx, - int dy, - Bool reverse, - Bool upsidedown, - Pixel bitplane, - void *closure); - -void -kaaComposite(CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - -void -kaaRasterizeTrapezoid(PicturePtr pPict, - xTrapezoid *trap, - int xoff, - int yoff); - -void -kaaInitTrapOffsets(int grid_order, float *x_offsets, float *y_offsets, - float x_offset, float y_offset); - -#endif /* _KAA_H_ */ diff --git a/hw/kdrive/src/kaapict.c b/hw/kdrive/src/kaapict.c deleted file mode 100644 index 501b6b9c4..000000000 --- a/hw/kdrive/src/kaapict.c +++ /dev/null @@ -1,719 +0,0 @@ -/* - * Copyright © 2001 Keith Packard - * - * Partly based on code that is Copyright © The XFree86 Project Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "kdrive.h" -#include "kaa.h" - -#ifdef RENDER -#include "mipict.h" - -#define KAA_DEBUG_FALLBACKS 0 - -#if KAA_DEBUG_FALLBACKS -static void kaaCompositeFallbackPictDesc(PicturePtr pict, char *string, int n) -{ - char format[20]; - char size[20]; - char loc; - int temp; - - if (!pict) { - snprintf(string, n, "None"); - return; - } - - switch (pict->format) - { - case PICT_a8r8g8b8: - snprintf(format, 20, "ARGB8888"); - break; - case PICT_r5g6b5: - snprintf(format, 20, "RGB565 "); - break; - case PICT_x1r5g5b5: - snprintf(format, 20, "RGB555 "); - break; - case PICT_a8: - snprintf(format, 20, "A8 "); - break; - case PICT_a1: - snprintf(format, 20, "A1 "); - break; - default: - snprintf(format, 20, "0x%x", (int)pict->format); - break; - } - - loc = kaaGetOffscreenPixmap(pict->pDrawable, &temp, &temp) ? 's' : 'm'; - - snprintf(size, 20, "%dx%d%s", pict->pDrawable->width, - pict->pDrawable->height, pict->repeat ? - " R" : ""); - - snprintf(string, n, "0x%lx:%c fmt %s (%s)", (long)pict, loc, format, size); -} - -static void -kaaPrintCompositeFallback(CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst) -{ - char sop[20]; - char srcdesc[40], maskdesc[40], dstdesc[40]; - - switch(op) - { - case PictOpSrc: - sprintf(sop, "Src"); - break; - case PictOpOver: - sprintf(sop, "Over"); - break; - default: - sprintf(sop, "0x%x", (int)op); - break; - } - - kaaCompositeFallbackPictDesc(pSrc, srcdesc, 40); - kaaCompositeFallbackPictDesc(pMask, maskdesc, 40); - kaaCompositeFallbackPictDesc(pDst, dstdesc, 40); - - ErrorF("Composite fallback: op %s, \n" - " src %s, \n" - " mask %s, \n" - " dst %s, \n", - sop, srcdesc, maskdesc, dstdesc); -} - -static void -kaaPrintTrapezoidFallback(PicturePtr pDst) -{ - char dstdesc[40]; - - kaaCompositeFallbackPictDesc(pDst, dstdesc, 40); - - ErrorF("Trapezoid fallback: dst %s, %c/%s\n", - dstdesc, - (pDst->polyMode == PolyModePrecise) ? 'p' : 'i', - (pDst->polyEdge == PolyEdgeSharp) ? "a" : "aa"); -} -#endif - -static Bool -kaaGetPixelFromRGBA(CARD32 *pixel, - CARD16 red, - CARD16 green, - CARD16 blue, - CARD16 alpha, - CARD32 format) -{ - int rbits, bbits, gbits, abits; - int rshift, bshift, gshift, ashift; - - *pixel = 0; - - if (!PICT_FORMAT_COLOR(format)) - return FALSE; - - rbits = PICT_FORMAT_R(format); - gbits = PICT_FORMAT_G(format); - bbits = PICT_FORMAT_B(format); - abits = PICT_FORMAT_A(format); - - if (PICT_FORMAT_TYPE(format) == PICT_TYPE_ARGB) { - bshift = 0; - gshift = bbits; - rshift = gshift + gbits; - ashift = rshift + rbits; - } else { /* PICT_TYPE_ABGR */ - rshift = 0; - gshift = rbits; - bshift = gshift + gbits; - ashift = bshift + bbits; - } - - *pixel |= ( blue >> (16 - bbits)) << bshift; - *pixel |= ( red >> (16 - rbits)) << rshift; - *pixel |= (green >> (16 - gbits)) << gshift; - *pixel |= (alpha >> (16 - abits)) << ashift; - - return TRUE; -} - - -static Bool -kaaGetRGBAFromPixel(CARD32 pixel, - CARD16 *red, - CARD16 *green, - CARD16 *blue, - CARD16 *alpha, - CARD32 format) -{ - int rbits, bbits, gbits, abits; - int rshift, bshift, gshift, ashift; - - if (!PICT_FORMAT_COLOR(format)) - return FALSE; - - rbits = PICT_FORMAT_R(format); - gbits = PICT_FORMAT_G(format); - bbits = PICT_FORMAT_B(format); - abits = PICT_FORMAT_A(format); - - if (PICT_FORMAT_TYPE(format) == PICT_TYPE_ARGB) { - bshift = 0; - gshift = bbits; - rshift = gshift + gbits; - ashift = rshift + rbits; - } else { /* PICT_TYPE_ABGR */ - rshift = 0; - gshift = rbits; - bshift = gshift + gbits; - ashift = bshift + bbits; - } - - *red = ((pixel >> rshift ) & ((1 << rbits) - 1)) << (16 - rbits); - while (rbits < 16) { - *red |= *red >> rbits; - rbits <<= 1; - } - - *green = ((pixel >> gshift ) & ((1 << gbits) - 1)) << (16 - gbits); - while (gbits < 16) { - *green |= *green >> gbits; - gbits <<= 1; - } - - *blue = ((pixel >> bshift ) & ((1 << bbits) - 1)) << (16 - bbits); - while (bbits < 16) { - *blue |= *blue >> bbits; - bbits <<= 1; - } - - if (abits) { - *alpha = ((pixel >> ashift ) & ((1 << abits) - 1)) << (16 - abits); - while (abits < 16) { - *alpha |= *alpha >> abits; - abits <<= 1; - } - } else - *alpha = 0xffff; - - return TRUE; -} - -static int -kaaTryDriverSolidFill(PicturePtr pSrc, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height) -{ - KaaScreenPriv (pDst->pDrawable->pScreen); - RegionRec region; - BoxPtr pbox; - int nbox; - int dst_off_x, dst_off_y; - PixmapPtr pSrcPix, pDstPix; - CARD32 pixel; - CARD16 red, green, blue, alpha; - - xDst += pDst->pDrawable->x; - yDst += pDst->pDrawable->y; - xSrc += pSrc->pDrawable->x; - ySrc += pSrc->pDrawable->y; - - if (!miComputeCompositeRegion (®ion, pSrc, NULL, pDst, - xSrc, ySrc, 0, 0, xDst, yDst, - width, height)) - return 1; - - if (pSrc->pDrawable->type == DRAWABLE_PIXMAP) - kaaPixmapUseMemory ((PixmapPtr) pSrc->pDrawable); - if (pDst->pDrawable->type == DRAWABLE_PIXMAP) - kaaPixmapUseScreen ((PixmapPtr) pDst->pDrawable); - - pDstPix = kaaGetOffscreenPixmap (pDst->pDrawable, &dst_off_x, &dst_off_y); - if (!pDstPix) { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); - return 0; - } - - if (pSrc->pDrawable->type == DRAWABLE_WINDOW) - pSrcPix = (*pSrc->pDrawable->pScreen->GetWindowPixmap)( - (WindowPtr) (pSrc->pDrawable)); - else - pSrcPix = (PixmapPtr) (pSrc->pDrawable); - - /* If source is offscreen, we need to sync the accelerator - * before accessing it. We'd prefer for it to be in memory. - */ - if (kaaPixmapIsOffscreen(pSrcPix)) { - kaaWaitSync(pDst->pDrawable->pScreen); - } - - pixel = *(CARD32 *)(pSrcPix->devPrivate.ptr); - if (!kaaGetRGBAFromPixel(pixel, &red, &green, &blue, &alpha, - pSrc->format)) - { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); - return -1; - } - kaaGetPixelFromRGBA(&pixel, red, green, blue, alpha, - pDst->format); - - if (!(*pKaaScr->info->PrepareSolid) (pDstPix, GXcopy, 0xffffffff, pixel)) - { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); - return -1; - } - - nbox = REGION_NUM_RECTS(®ion); - pbox = REGION_RECTS(®ion); - while (nbox--) - { - (*pKaaScr->info->Solid) (pbox->x1 + dst_off_x, - pbox->y1 + dst_off_y, - pbox->x2 + dst_off_x, - pbox->y2 + dst_off_y); - pbox++; - } - - (*pKaaScr->info->DoneSolid) (); - kaaMarkSync (pDst->pDrawable->pScreen); - kaaDrawableDirty (pDst->pDrawable); - - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); - return 1; -} - -static int -kaaTryDriverBlend(CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height) -{ - KaaScreenPriv (pDst->pDrawable->pScreen); - RegionRec region; - BoxPtr pbox; - int nbox; - int src_off_x, src_off_y, dst_off_x, dst_off_y; - PixmapPtr pSrcPix, pDstPix; - struct _Pixmap srcScratch; - - xDst += pDst->pDrawable->x; - yDst += pDst->pDrawable->y; - - xSrc += pSrc->pDrawable->x; - ySrc += pSrc->pDrawable->y; - - if (!miComputeCompositeRegion (®ion, pSrc, NULL, pDst, - xSrc, ySrc, 0, 0, xDst, yDst, - width, height)) - return 1; - - - if (pSrc->pDrawable->type == DRAWABLE_PIXMAP) - kaaPixmapUseScreen ((PixmapPtr) pSrc->pDrawable); - if (pDst->pDrawable->type == DRAWABLE_PIXMAP) - kaaPixmapUseScreen ((PixmapPtr) pDst->pDrawable); - - pSrcPix = kaaGetOffscreenPixmap (pSrc->pDrawable, &src_off_x, &src_off_y); - pDstPix = kaaGetOffscreenPixmap (pDst->pDrawable, &dst_off_x, &dst_off_y); - - if (!pDstPix) { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); - return 0; - } - - if (!pSrcPix && pKaaScr->info->UploadToScratch) { - if ((*pKaaScr->info->UploadToScratch) ((PixmapPtr) pSrc->pDrawable, - &srcScratch)) - pSrcPix = &srcScratch; - } - - if (!pSrcPix) { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); - return 0; - } - - if (!(*pKaaScr->info->PrepareBlend) (op, pSrc, pDst, pSrcPix, - pDstPix)) - { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); - return -1; - } - - nbox = REGION_NUM_RECTS(®ion); - pbox = REGION_RECTS(®ion); - - xSrc -= xDst; - ySrc -= yDst; - - while (nbox--) - { - (*pKaaScr->info->Blend) (pbox->x1 + xSrc + src_off_x, - pbox->y1 + ySrc + src_off_y, - pbox->x1 + dst_off_x, - pbox->y1 + dst_off_y, - pbox->x2 - pbox->x1, - pbox->y2 - pbox->y1); - pbox++; - } - - (*pKaaScr->info->DoneBlend) (); - kaaMarkSync (pDst->pDrawable->pScreen); - kaaDrawableDirty (pDst->pDrawable); - - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); - return 1; -} - -static int -kaaTryDriverComposite(CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height) -{ - KaaScreenPriv (pDst->pDrawable->pScreen); - RegionRec region; - BoxPtr pbox; - int nbox; - int src_off_x, src_off_y, mask_off_x, mask_off_y, dst_off_x, dst_off_y; - PixmapPtr pSrcPix, pMaskPix = NULL, pDstPix; - struct _Pixmap scratch; - - xDst += pDst->pDrawable->x; - yDst += pDst->pDrawable->y; - - if (pMask) { - xMask += pMask->pDrawable->x; - yMask += pMask->pDrawable->y; - } - - xSrc += pSrc->pDrawable->x; - ySrc += pSrc->pDrawable->y; - - if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, - xSrc, ySrc, xMask, yMask, xDst, yDst, - width, height)) - return 1; - - if (pKaaScr->info->CheckComposite && - !(*pKaaScr->info->CheckComposite) (op, pSrc, pMask, pDst)) - { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); - return -1; - } - - if (pSrc->pDrawable->type == DRAWABLE_PIXMAP) - kaaPixmapUseScreen ((PixmapPtr) pSrc->pDrawable); - if (pMask && pMask->pDrawable->type == DRAWABLE_PIXMAP) - kaaPixmapUseScreen ((PixmapPtr) pMask->pDrawable); - if (pDst->pDrawable->type == DRAWABLE_PIXMAP) - kaaPixmapUseScreen ((PixmapPtr) pDst->pDrawable); - - pSrcPix = kaaGetOffscreenPixmap (pSrc->pDrawable, &src_off_x, &src_off_y); - if (pMask) - pMaskPix = kaaGetOffscreenPixmap (pMask->pDrawable, &mask_off_x, - &mask_off_y); - pDstPix = kaaGetOffscreenPixmap (pDst->pDrawable, &dst_off_x, &dst_off_y); - - if (!pDstPix) { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); - return 0; - } - - if (!pSrcPix && (!pMask || pMaskPix) && pKaaScr->info->UploadToScratch) { - if (pSrc->pDrawable->type == DRAWABLE_WINDOW) - pSrcPix = (*pSrc->pDrawable->pScreen->GetWindowPixmap) ( - (WindowPtr) pSrc->pDrawable); - else - pSrcPix = (PixmapPtr) pSrc->pDrawable; - if ((*pKaaScr->info->UploadToScratch) (pSrcPix, &scratch)) - pSrcPix = &scratch; - } else if (pSrcPix && pMask && !pMaskPix && pKaaScr->info->UploadToScratch) { - if (pMask->pDrawable->type == DRAWABLE_WINDOW) - pMaskPix = (*pMask->pDrawable->pScreen->GetWindowPixmap) ( - (WindowPtr) pMask->pDrawable); - else - pMaskPix = (PixmapPtr) pMask->pDrawable; - if ((*pKaaScr->info->UploadToScratch) (pMaskPix, &scratch)) - pMaskPix = &scratch; - } - - if (!pSrcPix || (pMask && !pMaskPix)) { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); - return 0; - } - - if (!(*pKaaScr->info->PrepareComposite) (op, pSrc, pMask, pDst, pSrcPix, - pMaskPix, pDstPix)) - { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); - return -1; - } - - nbox = REGION_NUM_RECTS(®ion); - pbox = REGION_RECTS(®ion); - - xMask -= xDst; - yMask -= yDst; - - xSrc -= xDst; - ySrc -= yDst; - - while (nbox--) - { - (*pKaaScr->info->Composite) (pbox->x1 + xSrc + src_off_x, - pbox->y1 + ySrc + src_off_y, - pbox->x1 + xMask + mask_off_x, - pbox->y1 + yMask + mask_off_y, - pbox->x1 + dst_off_x, - pbox->y1 + dst_off_y, - pbox->x2 - pbox->x1, - pbox->y2 - pbox->y1); - pbox++; - } - - (*pKaaScr->info->DoneComposite) (); - kaaMarkSync (pDst->pDrawable->pScreen); - kaaDrawableDirty (pDst->pDrawable); - - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); - return 1; -} - - -void -kaaComposite(CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height) -{ - KdScreenPriv (pDst->pDrawable->pScreen); - KaaScreenPriv (pDst->pDrawable->pScreen); - int ret = -1; - - if (!pMask && pSrc->pDrawable) - { - if (op == PictOpSrc) - { - if (pScreenPriv->enabled && pSrc->pDrawable && pSrc->pDrawable->width == 1 && - pSrc->pDrawable->height == 1 && pSrc->repeat) - { - ret = kaaTryDriverSolidFill(pSrc, pDst, xSrc, ySrc, xDst, yDst, - width, height); - if (ret == 1) - return; - } - else if (!pSrc->repeat && !pSrc->transform && - pSrc->format == pDst->format) - { - RegionRec region; - - xDst += pDst->pDrawable->x; - yDst += pDst->pDrawable->y; - xSrc += pSrc->pDrawable->x; - ySrc += pSrc->pDrawable->y; - - if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, - xSrc, ySrc, xMask, yMask, xDst, - yDst, width, height)) - return; - - - kaaCopyNtoN (pSrc->pDrawable, pDst->pDrawable, 0, - REGION_RECTS(®ion), REGION_NUM_RECTS(®ion), - xSrc - xDst, ySrc - yDst, - FALSE, FALSE, 0, 0); - return; - } - } - - if (pScreenPriv->enabled && pKaaScr->info->PrepareBlend && - !pSrc->alphaMap && !pDst->alphaMap) - { - ret = kaaTryDriverBlend(op, pSrc, pDst, xSrc, ySrc, xDst, yDst, - width, height); - if (ret == 1) - return; - } - } - - if (pSrc->pDrawable && (!pMask || pMask->pDrawable) && - pScreenPriv->enabled && pKaaScr->info->PrepareComposite && - !pSrc->alphaMap && (!pMask || !pMask->alphaMap) && !pDst->alphaMap) - { - ret = kaaTryDriverComposite(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, - yMask, xDst, yDst, width, height); - if (ret == 1) - return; - } - - if (ret != 0) { - /* failure to accelerate was not due to pixmaps being in the wrong - * locations. - */ - if (pSrc->pDrawable->type == DRAWABLE_PIXMAP) - kaaPixmapUseMemory ((PixmapPtr) pSrc->pDrawable); - if (pMask && pMask->pDrawable->type == DRAWABLE_PIXMAP) - kaaPixmapUseMemory ((PixmapPtr) pMask->pDrawable); - if (pDst->pDrawable->type == DRAWABLE_PIXMAP) - kaaPixmapUseMemory ((PixmapPtr) pDst->pDrawable); - } - -#if KAA_DEBUG_FALLBACKS - kaaPrintCompositeFallback (op, pSrc, pMask, pDst); -#endif - - KdCheckComposite (op, pSrc, pMask, pDst, xSrc, ySrc, - xMask, yMask, xDst, yDst, width, height); -} -#endif - -static xFixed -miLineFixedX (xLineFixed *l, xFixed y, Bool ceil) -{ - xFixed dx = l->p2.x - l->p1.x; - xFixed_32_32 ex = (xFixed_32_32) (y - l->p1.y) * dx; - xFixed dy = l->p2.y - l->p1.y; - if (ceil) - ex += (dy - 1); - return l->p1.x + (xFixed) (ex / dy); -} - -/* Need to decide just how much to trim, to maintain translation independence - * when converted to floating point. - */ -#define XFIXED_TO_FLOAT(x) (((float)((x) & 0xffffff00)) / 65536.0) - -/* This is just to allow us to work on the hardware side of the problem while - * waiting for cairo to get a new tesselator. We may not be able to support - * RasterizeTrapezoid at all due to the abutting edges requirement, but it might - * be technically legal if we widened the trap by some epsilon, so that alpha - * values at abutting edges were a little too big and capped at one, rather than - * a little too small and looked bad. - */ -void kaaRasterizeTrapezoid(PicturePtr pDst, - xTrapezoid *trap, - int xoff, - int yoff) -{ - KdScreenPriv (pDst->pDrawable->pScreen); - KaaScreenPriv (pDst->pDrawable->pScreen); - KaaTrapezoid ktrap; - PixmapPtr pPix; - xFixed x1, x2; - - if (!pScreenPriv->enabled || - !pKaaScr->info->PrepareTrapezoids || - pDst->pDrawable->type != DRAWABLE_PIXMAP || - pDst->alphaMap || pDst->format != PICT_a8) - { - KdCheckRasterizeTrapezoid (pDst, trap, xoff, yoff); -#if KAA_DEBUG_FALLBACKS - kaaPrintTrapezoidFallback (pDst); -#endif - return; - } - pPix = (PixmapPtr)pDst->pDrawable; - - kaaPixmapUseScreen (pPix); - - if (!kaaPixmapIsOffscreen (pPix) || - !(*pKaaScr->info->PrepareTrapezoids) (pDst, pPix)) - { -#if KAA_DEBUG_FALLBACKS - kaaPrintTrapezoidFallback (pDst); -#endif - KdCheckRasterizeTrapezoid (pDst, trap, xoff, yoff); - return; - } - - ktrap.ty = XFIXED_TO_FLOAT(trap->top) + yoff; - x1 = miLineFixedX (&trap->left, trap->top, FALSE); - x2 = miLineFixedX (&trap->right, trap->top, TRUE); - ktrap.tl = XFIXED_TO_FLOAT(x1) + xoff; - ktrap.tr = XFIXED_TO_FLOAT(x2) + xoff; - ktrap.by = XFIXED_TO_FLOAT(trap->bottom) + yoff; - x1 = miLineFixedX (&trap->left, trap->bottom, FALSE); - x2 = miLineFixedX (&trap->right, trap->bottom, TRUE); - ktrap.bl = XFIXED_TO_FLOAT(x1) + xoff; - ktrap.br = XFIXED_TO_FLOAT(x2) + xoff; - - (*pKaaScr->info->Trapezoids) (&ktrap, 1); - (*pKaaScr->info->DoneTrapezoids) (); -} - -void -kaaInitTrapOffsets(int grid_order, float *x_offsets, float *y_offsets, - float x_offset, float y_offset) -{ - int i = 0; - float x, y, x_count, y_count; - - x_count = (1 << (grid_order / 2)) + 1; - y_count = (1 << (grid_order / 2)) - 1; - - x_offset += 1.0 / x_count / 2.0; - y_offset += 1.0 / y_count / 2.0; - - for (x = 0; x < x_count; x++) { - for (y = 0; y < y_count; y++) { - x_offsets[i] = x / x_count + x_offset; - y_offsets[i] = y / y_count + y_offset; - i++; - } - } -} - diff --git a/hw/kdrive/src/kasync.c b/hw/kdrive/src/kasync.c deleted file mode 100644 index 5388f217d..000000000 --- a/hw/kdrive/src/kasync.c +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Copyright © 1999 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "kdrive.h" -#include "kaa.h" -#include "picturestr.h" -#include "mipict.h" -#include "fbpict.h" - -/* - * These functions wrap the low-level fb rendering functions and - * synchronize framebuffer/accelerated drawing by stalling until - * the accelerator is idle - */ - -void -KdCheckFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nspans, - DDXPointPtr ppt, int *pwidth, int fSorted) -{ - kaaWaitSync (pDrawable->pScreen); - kaaDrawableDirty (pDrawable); - fbFillSpans (pDrawable, pGC, nspans, ppt, pwidth, fSorted); -} - -void -KdCheckSetSpans (DrawablePtr pDrawable, GCPtr pGC, char *psrc, - DDXPointPtr ppt, int *pwidth, int nspans, int fSorted) -{ - kaaWaitSync (pDrawable->pScreen); - kaaDrawableDirty (pDrawable); - fbSetSpans (pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted); -} - -void -KdCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, - int x, int y, int w, int h, int leftPad, int format, - char *bits) -{ - kaaWaitSync (pDrawable->pScreen); - kaaDrawableDirty (pDrawable); - fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits); -} - -RegionPtr -KdCheckCopyArea (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, - int srcx, int srcy, int w, int h, int dstx, int dsty) -{ - kaaWaitSync (pSrc->pScreen); - kaaDrawableDirty (pDst); - return fbCopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty); -} - -RegionPtr -KdCheckCopyPlane (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, - int srcx, int srcy, int w, int h, int dstx, int dsty, - unsigned long bitPlane) -{ - kaaWaitSync (pSrc->pScreen); - kaaDrawableDirty (pDst); - return fbCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, - bitPlane); -} - -void -KdCheckPolyPoint (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, - DDXPointPtr pptInit) -{ - kaaWaitSync (pDrawable->pScreen); - kaaDrawableDirty (pDrawable); - fbPolyPoint (pDrawable, pGC, mode, npt, pptInit); -} - -void -KdCheckPolylines (DrawablePtr pDrawable, GCPtr pGC, - int mode, int npt, DDXPointPtr ppt) -{ - - if (pGC->lineWidth == 0) { - kaaWaitSync(pDrawable->pScreen); - kaaDrawableDirty (pDrawable); - } - kaaDrawableDirty (pDrawable); - fbPolyLine (pDrawable, pGC, mode, npt, ppt); -} - -void -KdCheckPolySegment (DrawablePtr pDrawable, GCPtr pGC, - int nsegInit, xSegment *pSegInit) -{ - if (pGC->lineWidth == 0) { - kaaWaitSync(pDrawable->pScreen); - kaaDrawableDirty (pDrawable); - } - kaaDrawableDirty (pDrawable); - fbPolySegment (pDrawable, pGC, nsegInit, pSegInit); -} - -void -KdCheckPolyRectangle (DrawablePtr pDrawable, GCPtr pGC, - int nrects, xRectangle *prect) -{ - if (pGC->lineWidth == 0) { - kaaWaitSync(pDrawable->pScreen); - kaaDrawableDirty (pDrawable); - } - fbPolyRectangle (pDrawable, pGC, nrects, prect); -} - -void -KdCheckPolyArc (DrawablePtr pDrawable, GCPtr pGC, - int narcs, xArc *pArcs) -{ - if (pGC->lineWidth == 0) - { - kaaWaitSync(pDrawable->pScreen); - kaaDrawableDirty (pDrawable); - fbPolyArc (pDrawable, pGC, narcs, pArcs); - } - else - miPolyArc (pDrawable, pGC, narcs, pArcs); -} - -#if 0 -void -KdCheckFillPolygon (DrawablePtr pDrawable, GCPtr pGC, - int shape, int mode, int count, DDXPointPtr pPts) -{ - kaaWaitSync(pDrawable->pScreen); - kaaDrawableDirty (pDrawable); - fbFillPolygon (pDrawable, pGC, mode, count, pPts); -} -#endif - -void -KdCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC, - int nrect, xRectangle *prect) -{ - kaaWaitSync(pDrawable->pScreen); - kaaDrawableDirty (pDrawable); - fbPolyFillRect (pDrawable, pGC, nrect, prect); -} - -void -KdCheckPolyFillArc (DrawablePtr pDrawable, GCPtr pGC, - int narcs, xArc *pArcs) -{ - kaaWaitSync(pDrawable->pScreen); - kaaDrawableDirty (pDrawable); - fbPolyFillArc (pDrawable, pGC, narcs, pArcs); -} - -void -KdCheckImageGlyphBlt (DrawablePtr pDrawable, GCPtr pGC, - int x, int y, unsigned int nglyph, - CharInfoPtr *ppci, pointer pglyphBase) -{ - kaaWaitSync(pDrawable->pScreen); - kaaDrawableDirty (pDrawable); - fbImageGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); -} - -void -KdCheckPolyGlyphBlt (DrawablePtr pDrawable, GCPtr pGC, - int x, int y, unsigned int nglyph, - CharInfoPtr *ppci, pointer pglyphBase) -{ - kaaWaitSync(pDrawable->pScreen); - kaaDrawableDirty (pDrawable); - fbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); -} - -void -KdCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap, - DrawablePtr pDrawable, - int w, int h, int x, int y) -{ - kaaWaitSync(pDrawable->pScreen); - kaaDrawableDirty (pDrawable); - fbPushPixels (pGC, pBitmap, pDrawable, w, h, x, y); -} - -void -KdCheckGetImage (DrawablePtr pDrawable, - int x, int y, int w, int h, - unsigned int format, unsigned long planeMask, - char *d) -{ - kaaWaitSync(pDrawable->pScreen); - fbGetImage (pDrawable, x, y, w, h, format, planeMask, d); -} - -void -KdCheckGetSpans (DrawablePtr pDrawable, - int wMax, - DDXPointPtr ppt, - int *pwidth, - int nspans, - char *pdstStart) -{ - kaaWaitSync(pDrawable->pScreen); - fbGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart); -} - -void -KdCheckCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) -{ - kaaWaitSync (pWin->drawable.pScreen); - kaaDrawableDirty ((DrawablePtr)pWin); - fbCopyWindow (pWin, ptOldOrg, prgnSrc); -} - -#if KD_MAX_FB > 1 -void -KdCheckPaintKey(DrawablePtr pDrawable, - RegionPtr pRegion, - CARD32 pixel, - int layer) -{ - kaaWaitSync (pDrawable->pScreen); - kaaDrawableDirty (pDrawable); - fbOverlayPaintKey (pDrawable, pRegion, pixel, layer); -} - -void -KdCheckOverlayCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) -{ - kaaWaitSync (pWin->drawable.pScreen); - kaaDrawableDirty ((DrawablePtr)pWin); - fbOverlayCopyWindow (pWin, ptOldOrg, prgnSrc); -} -#endif - -void -KdScreenInitAsync (ScreenPtr pScreen) -{ - pScreen->GetImage = KdCheckGetImage; - pScreen->GetSpans = KdCheckGetSpans; - pScreen->CopyWindow = KdCheckCopyWindow; -#ifdef RENDER - KdPictureInitAsync (pScreen); -#endif -} - -void -KdCheckComposite (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height) -{ - kaaWaitSync (pDst->pDrawable->pScreen); - kaaDrawableDirty (pDst->pDrawable); - fbComposite (op, - pSrc, - pMask, - pDst, - xSrc, - ySrc, - xMask, - yMask, - xDst, - yDst, - width, - height); -} - -void -KdCheckRasterizeTrapezoid(PicturePtr pMask, - xTrapezoid *trap, - int x_off, - int y_off) -{ - kaaWaitSync (pMask->pDrawable->pScreen); - kaaDrawableDirty (pMask->pDrawable); - fbRasterizeTrapezoid (pMask, trap, x_off, y_off); -} - -/* - * Only need to stall for copyarea/copyplane - */ -const GCOps kdAsyncPixmapGCOps = { - fbFillSpans, - fbSetSpans, - fbPutImage, - KdCheckCopyArea, - KdCheckCopyPlane, - fbPolyPoint, - fbPolyLine, - fbPolySegment, - fbPolyRectangle, - fbPolyArc, - fbFillPolygon, - fbPolyFillRect, - fbPolyFillArc, - miPolyText8, - miPolyText16, - miImageText8, - miImageText16, - fbImageGlyphBlt, - fbPolyGlyphBlt, - fbPushPixels -}; - -void -KdPictureInitAsync (ScreenPtr pScreen) -{ - PictureScreenPtr ps; - - ps = GetPictureScreen(pScreen); - ps->Composite = KdCheckComposite; - ps->RasterizeTrapezoid = KdCheckRasterizeTrapezoid; -} diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h index 4e04b59f7..3e5af3a1a 100644 --- a/hw/kdrive/src/kdrive.h +++ b/hw/kdrive/src/kdrive.h @@ -515,119 +515,6 @@ extern KdOsFuncs *kdOsFuncs; dixSetPrivate(&(pScreen)->devPrivates, kdScreenPrivateKey, v) #define KdScreenPriv(pScreen) KdPrivScreenPtr pScreenPriv = KdGetScreenPriv(pScreen) -/* kaa.c */ -Bool -kaaDrawInit (ScreenPtr pScreen, - KaaScreenInfoPtr pScreenInfo); - -void -kaaDrawFini (ScreenPtr pScreen); - -void -kaaWrapGC (GCPtr pGC); - -void -kaaUnwrapGC (GCPtr pGC); - -/* kasync.c */ -void -KdCheckFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nspans, - DDXPointPtr ppt, int *pwidth, int fSorted); - -void -KdCheckSetSpans (DrawablePtr pDrawable, GCPtr pGC, char *psrc, - DDXPointPtr ppt, int *pwidth, int nspans, int fSorted); - -void -KdCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, - int x, int y, int w, int h, int leftPad, int format, - char *bits); - -RegionPtr -KdCheckCopyArea (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, - int srcx, int srcy, int w, int h, int dstx, int dsty); - -RegionPtr -KdCheckCopyPlane (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, - int srcx, int srcy, int w, int h, int dstx, int dsty, - unsigned long bitPlane); - -void -KdCheckPolyPoint (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, - DDXPointPtr pptInit); - -void -KdCheckPolylines (DrawablePtr pDrawable, GCPtr pGC, - int mode, int npt, DDXPointPtr ppt); - -void -KdCheckPolySegment (DrawablePtr pDrawable, GCPtr pGC, - int nsegInit, xSegment *pSegInit); - -void -KdCheckPolyRectangle (DrawablePtr pDrawable, GCPtr pGC, - int nrects, xRectangle *prect); - -void -KdCheckPolyArc (DrawablePtr pDrawable, GCPtr pGC, - int narcs, xArc *pArcs); - -#define KdCheckFillPolygon miFillPolygon - -void -KdCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC, - int nrect, xRectangle *prect); - -void -KdCheckPolyFillArc (DrawablePtr pDrawable, GCPtr pGC, - int narcs, xArc *pArcs); - -void -KdCheckImageGlyphBlt (DrawablePtr pDrawable, GCPtr pGC, - int x, int y, unsigned int nglyph, - CharInfoPtr *ppci, pointer pglyphBase); - -void -KdCheckPolyGlyphBlt (DrawablePtr pDrawable, GCPtr pGC, - int x, int y, unsigned int nglyph, - CharInfoPtr *ppci, pointer pglyphBase); - -void -KdCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap, - DrawablePtr pDrawable, - int w, int h, int x, int y); - -void -KdCheckGetImage (DrawablePtr pDrawable, - int x, int y, int w, int h, - unsigned int format, unsigned long planeMask, - char *d); - -void -KdCheckGetSpans (DrawablePtr pDrawable, - int wMax, - DDXPointPtr ppt, - int *pwidth, - int nspans, - char *pdstStart); - -void -KdCheckCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); - -void -KdCheckPaintKey(DrawablePtr pDrawable, - RegionPtr pRegion, - CARD32 pixel, - int layer); - -void -KdCheckOverlayCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); - -void -KdScreenInitAsync (ScreenPtr pScreen); - -extern const GCOps kdAsyncPixmapGCOps; - /* knoop.c */ extern GCOps kdNoopOps; @@ -921,32 +808,6 @@ KdRandRGetTiming (ScreenPtr pScreen, RRScreenSizePtr pSize); #endif -/* kpict.c */ -void -KdPictureInitAsync (ScreenPtr pScreen); - -#ifdef RENDER -void -KdCheckComposite (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - -void -KdCheckRasterizeTrapezoid(PicturePtr pMask, - xTrapezoid *trap, - int x_off, - int y_off); -#endif - /* kshadow.c */ Bool KdShadowFbAlloc (KdScreenInfo *screen, int fb, Bool rotate); diff --git a/hw/kdrive/src/koffscreen.c b/hw/kdrive/src/koffscreen.c index efe03642f..f6ef52fc2 100644 --- a/hw/kdrive/src/koffscreen.c +++ b/hw/kdrive/src/koffscreen.c @@ -24,7 +24,6 @@ #include #endif #include "kdrive.h" -#include "kaa.h" #define DEBUG_OFFSCREEN 0 #if DEBUG_OFFSCREEN From b84a27fd9fdcb579437cfa38f10cb12cf55dc7c3 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 2 Jul 2008 06:25:03 -0700 Subject: [PATCH 66/83] VBO: Regenerate files based on recent changes to gl_API.xml Since GL_ARB_vertex_buffer_object protocol isn't supported yet, these changes are innocuous. --- glx/indirect_dispatch.h | 4 ++-- glx/indirect_size_get.c | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/glx/indirect_dispatch.h b/glx/indirect_dispatch.h index e81c382f0..014e417c9 100644 --- a/glx/indirect_dispatch.h +++ b/glx/indirect_dispatch.h @@ -251,8 +251,6 @@ extern HIDDEN int __glXDisp_AreTexturesResident(struct __GLXclientStateRec *, GL extern HIDDEN int __glXDispSwap_AreTexturesResident(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDisp_AreTexturesResidentEXT(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDispSwap_AreTexturesResidentEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDisp_IsRenderbufferEXT(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN int __glXDispSwap_IsRenderbufferEXT(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN void __glXDisp_PointParameterfvEXT(GLbyte * pc); extern HIDDEN void __glXDispSwap_PointParameterfvEXT(GLbyte * pc); extern HIDDEN void __glXDisp_Color3bv(GLbyte * pc); @@ -423,6 +421,8 @@ extern HIDDEN void __glXDisp_FramebufferTexture1DEXT(GLbyte * pc); extern HIDDEN void __glXDispSwap_FramebufferTexture1DEXT(GLbyte * pc); extern HIDDEN int __glXDisp_GetDrawableAttributes(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDispSwap_GetDrawableAttributes(struct __GLXclientStateRec *, GLbyte *); +extern HIDDEN int __glXDisp_IsRenderbufferEXT(struct __GLXclientStateRec *, GLbyte *); +extern HIDDEN int __glXDispSwap_IsRenderbufferEXT(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN void __glXDisp_RasterPos2sv(GLbyte * pc); extern HIDDEN void __glXDispSwap_RasterPos2sv(GLbyte * pc); extern HIDDEN void __glXDisp_Color4ubv(GLbyte * pc); diff --git a/glx/indirect_size_get.c b/glx/indirect_size_get.c index 8f726904f..80f81dec6 100644 --- a/glx/indirect_size_get.c +++ b/glx/indirect_size_get.c @@ -714,6 +714,17 @@ __glGetBooleanv_size(GLenum e) case GL_MAX_TEXTURE_COORDS_ARB: case GL_MAX_TEXTURE_IMAGE_UNITS_ARB: case GL_DEPTH_BOUNDS_TEST_EXT: + case GL_ARRAY_BUFFER_BINDING_ARB: + case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: + case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: + case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: + case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: + case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: + case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: + case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: + case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: + case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: + case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB: case GL_MAX_ARRAY_TEXTURE_LAYERS_EXT: case GL_STENCIL_TEST_TWO_SIDE_EXT: case GL_ACTIVE_STENCIL_FACE_EXT: @@ -1072,6 +1083,7 @@ __glGetVertexAttribdvARB_size(GLenum e) case GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB: case GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB: case GL_CURRENT_VERTEX_ATTRIB_ARB: + case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB: return 1; default: return 0; From 9a73bca859be12721ef62304b1422c455d4aec49 Mon Sep 17 00:00:00 2001 From: Chris Ball Date: Wed, 2 Jul 2008 09:46:06 -0400 Subject: [PATCH 67/83] Remove KdOffscreenMarkUsed() as all its callers are gone. --- hw/kdrive/src/kdrive.h | 3 --- hw/kdrive/src/koffscreen.c | 23 ----------------------- 2 files changed, 26 deletions(-) diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h index 3e5af3a1a..212e01607 100644 --- a/hw/kdrive/src/kdrive.h +++ b/hw/kdrive/src/kdrive.h @@ -842,9 +842,6 @@ KdOffscreenAlloc (ScreenPtr pScreen, int size, int align, KdOffscreenArea * KdOffscreenFree (ScreenPtr pScreen, KdOffscreenArea *area); -void -KdOffscreenMarkUsed (PixmapPtr pPixmap); - void KdOffscreenSwapOut (ScreenPtr pScreen); diff --git a/hw/kdrive/src/koffscreen.c b/hw/kdrive/src/koffscreen.c index f6ef52fc2..24ba7ffb3 100644 --- a/hw/kdrive/src/koffscreen.c +++ b/hw/kdrive/src/koffscreen.c @@ -309,29 +309,6 @@ KdOffscreenFree (ScreenPtr pScreen, KdOffscreenArea *area) return area; } -void -KdOffscreenMarkUsed (PixmapPtr pPixmap) -{ - KaaPixmapPriv (pPixmap); - KdScreenPriv (pPixmap->drawable.pScreen); - static int iter = 0; - - if (!pKaaPixmap->area) - return; - - /* The numbers here are arbitrary. We may want to tune these. */ - pKaaPixmap->area->score += 100; - if (++iter == 10) { - KdOffscreenArea *area; - for (area = pScreenPriv->off_screen_areas; area != NULL; - area = area->next) - { - if (area->state == KdOffscreenRemovable) - area->score = (area->score * 7) / 8; - } - } -} - Bool KdOffscreenInit (ScreenPtr pScreen) { From 689292e58cc5242cbfeaa29fcf65b6dcd9dfabb9 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 2 Jul 2008 11:25:50 -0400 Subject: [PATCH 68/83] Fix GLX in Xvfb and kdrive. --- hw/kdrive/ephyr/Makefile.am | 2 ++ hw/kdrive/fake/Makefile.am | 2 ++ hw/kdrive/fbdev/Makefile.am | 2 ++ hw/kdrive/sdl/Makefile.am | 2 ++ hw/kdrive/vesa/Makefile.am | 2 ++ hw/vfb/Makefile.am | 1 + 6 files changed, 11 insertions(+) diff --git a/hw/kdrive/ephyr/Makefile.am b/hw/kdrive/ephyr/Makefile.am index 140cccbc8..bf1f47567 100644 --- a/hw/kdrive/ephyr/Makefile.am +++ b/hw/kdrive/ephyr/Makefile.am @@ -78,6 +78,8 @@ Xephyr_DEPENDENCIES = \ $(LIBXEPHYR_HOSTDRI) \ @KDRIVE_LOCAL_LIBS@ +Xephyr_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) + relink: rm -f $(bin_PROGRAMS) && make $(bin_PROGRAMS) diff --git a/hw/kdrive/fake/Makefile.am b/hw/kdrive/fake/Makefile.am index 09d179eb0..76ed9fc8b 100644 --- a/hw/kdrive/fake/Makefile.am +++ b/hw/kdrive/fake/Makefile.am @@ -21,6 +21,8 @@ Xfake_LDADD = \ @KDRIVE_LIBS@ \ @XSERVER_LIBS@ +Xfake_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) + Xfake_DEPENDENCIES = \ libfake.a \ @KDRIVE_LOCAL_LIBS@ diff --git a/hw/kdrive/fbdev/Makefile.am b/hw/kdrive/fbdev/Makefile.am index 420855b8d..cb1292802 100644 --- a/hw/kdrive/fbdev/Makefile.am +++ b/hw/kdrive/fbdev/Makefile.am @@ -22,6 +22,8 @@ Xfbdev_DEPENDENCIES = \ libfbdev.a \ $(KDRIVE_PURE_LIBS) +Xfbdev_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) + relink: rm -f $(bin_PROGRAMS) && make $(bin_PROGRAMS) endif diff --git a/hw/kdrive/sdl/Makefile.am b/hw/kdrive/sdl/Makefile.am index fe9309e46..0973cb4ea 100644 --- a/hw/kdrive/sdl/Makefile.am +++ b/hw/kdrive/sdl/Makefile.am @@ -13,5 +13,7 @@ Xsdl_LDADD = \ Xsdl_DEPENDENCIES = @KDRIVE_LOCAL_LIBS@ +Xsdl_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) + relink: rm -f $(bin_PROGRAMS) && make $(bin_PROGRAMS) diff --git a/hw/kdrive/vesa/Makefile.am b/hw/kdrive/vesa/Makefile.am index ac50d2bf5..4225dcfbc 100644 --- a/hw/kdrive/vesa/Makefile.am +++ b/hw/kdrive/vesa/Makefile.am @@ -27,5 +27,7 @@ Xvesa_DEPENDENCIES = \ libvesa.a \ @KDRIVE_LOCAL_LIBS@ +Xvesa_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) + relink: rm -f $(bin_PROGRAMS) && make $(bin_PROGRAMS) diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am index 9ceecccc0..a4a120a05 100644 --- a/hw/vfb/Makefile.am +++ b/hw/vfb/Makefile.am @@ -26,6 +26,7 @@ XVFB_LIBS = \ Xvfb_LDADD = $(XVFB_LIBS) $(XVFB_SYS_LIBS) $(XSERVER_SYS_LIBS) Xvfb_DEPENDENCIES = $(XVFB_LIBS) +Xvfb_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) # Man page include $(top_srcdir)/cpprules.in From 1771edcb44b564f83f509748b4e4cd5b7586e2a8 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 3 Jul 2008 18:57:09 +1000 Subject: [PATCH 69/83] modes: check the crtc is valid before using its desired modes. this fixes a crash I was getting on radeon rotate when gnome is running. I'm sure g-s-d was doing something bad, but really not crashing ftw. --- hw/xfree86/modes/xf86Crtc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 5a71bcfea..733106c4f 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -1714,9 +1714,11 @@ xf86SetScrnInfoModes (ScrnInfoPtr scrn) /* Set scrn->modes to the mode list for the 'compat' output */ scrn->modes = xf86DuplicateModes(scrn, output->probed_modes); - for (mode = scrn->modes; mode; mode = mode->next) - if (xf86ModesEqual (mode, &crtc->desiredMode)) - break; + if (crtc) { + for (mode = scrn->modes; mode; mode = mode->next) + if (xf86ModesEqual (mode, &crtc->desiredMode)) + break; + } if (scrn->modes != NULL) { /* For some reason, scrn->modes is circular, unlike the other mode From 1e96782011f0b4ba6ed1d3d3df118964a58d15fd Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 3 Jul 2008 20:00:22 +1000 Subject: [PATCH 70/83] dri2: bump libdrm numbers as 2.3.1 is released without ttm interface --- configure.ac | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index d7a3d6893..fed80371c 100644 --- a/configure.ac +++ b/configure.ac @@ -381,7 +381,7 @@ case $host_os in AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console]) AC_DEFINE(SYSCONS_SUPPORT, 1, [System has syscons console]) DRI=yes - PKG_CHECK_EXISTS([dri2proto >= 1.1 libdrm >= 2.3.1], DRI2=yes, DRI2=no) + PKG_CHECK_EXISTS([dri2proto >= 1.1 libdrm >= 2.3.2], DRI2=yes, DRI2=no) ;; *netbsd*) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) @@ -389,7 +389,7 @@ case $host_os in AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console]) AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console]) DRI=yes - PKG_CHECK_EXISTS([dri2proto >= 1.1 libdrm >= 2.3.1], DRI2=yes, DRI2=no) + PKG_CHECK_EXISTS([dri2proto >= 1.1 libdrm >= 2.3.2], DRI2=yes, DRI2=no) ;; *openbsd*) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) @@ -398,7 +398,7 @@ case $host_os in ;; *linux*) DRI=yes - PKG_CHECK_EXISTS([dri2proto >= 1.1 libdrm >= 2.3.1], DRI2=yes, DRI2=no) + PKG_CHECK_EXISTS([dri2proto >= 1.1 libdrm >= 2.3.2], DRI2=yes, DRI2=no) KDRIVE_HW=yes ;; *solaris*) @@ -882,7 +882,7 @@ if test "x$DRI2" = xyes; then # FIXME: Bump the versions once we have releases of these. AC_DEFINE(DRI2, 1, [Build DRI2 extension]) PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= 1.1]) - PKG_CHECK_MODULES([LIBDRM], [libdrm >= 2.3.1]) + PKG_CHECK_MODULES([LIBDRM], [libdrm >= 2.3.2]) fi AM_CONDITIONAL(XINERAMA, [test "x$XINERAMA" = xyes]) From 6674b87a7dca7d6ffd9dd9af888c5256b13d7877 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Sun, 29 Jun 2008 20:05:27 +0930 Subject: [PATCH 71/83] xfree86: move declaration of configured_device to start of function. Last I checked C doesn't allow declarations halfway down a block. --- hw/xfree86/common/xf86Init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 46c4a96b8..5418ca0ff 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -472,6 +472,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) MessageType pix24From = X_DEFAULT; Bool pix24Fail = FALSE; Bool autoconfig = FALSE; + GDevPtr configured_device; xf86Initialising = TRUE; @@ -555,7 +556,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) /* If there aren't any specified in the config file, autoconfig them */ /* FIXME: Does not handle multiple active screen sections, but I'm not * sure if we really want to handle that case*/ - GDevPtr configured_device = xf86ConfigLayout.screens->screen->device; + configured_device = xf86ConfigLayout.screens->screen->device; if ((!configured_device) || (!configured_device->driver)) { if (!autoConfigDevice(configured_device)) { xf86Msg(X_ERROR, "Automatic driver configuration failed\n"); From fe5cf7cb00fd926cefff933adbdbceea7353f4c2 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 1 Jul 2008 13:18:54 +0930 Subject: [PATCH 72/83] xfree86: handle missing Screen lines in the ServerLayout #16301 If no Screen is specified in the ServerLayout section, either take the first one from the config file or autogenerate a default screen. X.Org Bug 16301 --- hw/xfree86/common/xf86Config.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 6fd0273bc..35a48ee55 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -1608,10 +1608,14 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout, count++; adjp = (XF86ConfAdjacencyPtr)adjp->list.next; } + #ifdef DEBUG ErrorF("Found %d screens in the layout section %s", count, conf_layout->lay_identifier); #endif + if (!count) /* alloc enough storage even if no screen is specified */ + count = 1; + slp = xnfcalloc(1, (count + 1) * sizeof(screenLayoutRec)); slp[count].screen = NULL; /* @@ -1666,6 +1670,20 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout, adjp = (XF86ConfAdjacencyPtr)adjp->list.next; } + /* No screen was specified in the layout. take the first one from the + * config file, or - if it is NULL - configScreen autogenerates one for + * us */ + if (!count) + { + slp[0].screen = xnfcalloc(1, sizeof(confScreenRec)); + if (!configScreen(slp[0].screen, xf86configptr->conf_screen_lst, + 0, X_CONFIG)) { + xfree(slp[0].screen); + xfree(slp); + return FALSE; + } + } + /* XXX Need to tie down the upper left screen. */ /* Fill in the refscreen and top/bottom/left/right values */ From e317943c125d7fdbe62c750324640eb30c88fa15 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 2 Jul 2008 12:23:03 +0930 Subject: [PATCH 73/83] xfree86: AllowEmptyInput is now enabled by default if hotplugging is enabled. Remove AEI check from configImpliedLayout as the setting isn't actually parsed at this point anyway (written by Sasha Hlusiak). Resurrect checkInput() and check for devices there if AEI is false (this also creates the default devices if required). Set AllowEmptyInput to enabled by default if hotplugging is enabled. --- hw/xfree86/common/xf86Config.c | 18 ++++++++++++------ hw/xfree86/doc/man/xorg.conf.man.pre | 3 ++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 35a48ee55..bea213060 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -1087,9 +1087,9 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) } #endif - xf86Info.allowEmptyInput = FALSE; - if (xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &value)) - xf86Info.allowEmptyInput = TRUE; + /* AllowEmptyInput is automatically true if we're hotplugging */ + xf86Info.allowEmptyInput = (xf86Info.autoAddDevices && xf86Info.autoEnableDevices); + xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &xf86Info.allowEmptyInput); xf86Info.useDefaultFontPath = TRUE; xf86Info.useDefaultFontPathFrom = X_DEFAULT; @@ -1874,9 +1874,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen) indp = xnfalloc(sizeof(IDevPtr)); *indp = NULL; servlayoutp->inputs = indp; - if (!xf86Info.allowEmptyInput && !checkCoreInputDevices(servlayoutp, TRUE)) - return FALSE; - + return TRUE; } @@ -2479,6 +2477,12 @@ addDefaultModes(MonPtr monitorp) return TRUE; } +static void +checkInput(serverLayoutPtr layout) { + if (!xf86Info.allowEmptyInput) + checkCoreInputDevices(layout, FALSE); +} + /* * load the config file and fill the global data structure */ @@ -2599,6 +2603,8 @@ xf86HandleConfigFile(Bool autoconfig) configDRI(xf86configptr->conf_dri); #endif + checkInput(&xf86ConfigLayout); + /* * Handle some command line options that can override some of the * ServerFlags settings. diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre index 8b66f89a6..3af1b7843 100644 --- a/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/hw/xfree86/doc/man/xorg.conf.man.pre @@ -696,7 +696,8 @@ the X server to load. Disabled by default. .TP 7 .BI "Option \*qAllowEmptyInput\*q \*q" boolean \*q If enabled, don't add the standard keyboard and mouse drivers, if there are no -input devices in the config file. Disabled by default. +input devices in the config file. Enabled by default if AutoAddDevices and +AutoEnableDevices is enabled, otherwise disabled. .TP 7 .BI "Option \*qAutoAddDevices\*q \*q" boolean \*q If this option is disabled, then no devices will be added from HAL events. From 0b9ef835a0fe900c121b84e43989591e58ab1126 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 4 Jul 2008 07:29:32 +1000 Subject: [PATCH 74/83] modes: fix initial xorg.conf mode selection. This was all kinds of broken, we ignored user preferred modes for multiple monitors and also for side-by-side configurations. --- hw/xfree86/modes/xf86Crtc.c | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 733106c4f..a5a0a6392 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -1006,6 +1006,54 @@ xf86DefaultScreenLimits (ScrnInfoPtr scrn, int *widthp, int *heightp, #define POSITION_UNSET -100000 +/* + * check if the user configured any outputs at all + * with either a position or a relative setting or a mode. + */ +static Bool +xf86UserConfiguredOutputs(ScrnInfoPtr scrn, DisplayModePtr *modes) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int o; + Bool user_conf = FALSE; + + for (o = 0; o < config->num_output; o++) + { + xf86OutputPtr output = config->output[o]; + char *position; + char *relative_name; + OutputOpts relation; + int r; + static const OutputOpts relations[] = { + OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF + }; + + position = xf86GetOptValString (output->options, + OPTION_POSITION); + if (position) + user_conf = TRUE; + + relation = 0; + relative_name = NULL; + for (r = 0; r < 4; r++) + { + relation = relations[r]; + relative_name = xf86GetOptValString (output->options, + relation); + if (relative_name) + break; + } + if (relative_name) + user_conf = TRUE; + + modes[o] = xf86OutputHasUserPreferredMode(output); + if (modes[o]) + user_conf = TRUE; + } + + return user_conf; +} + static Bool xf86InitialOutputPositions (ScrnInfoPtr scrn, DisplayModePtr *modes) { @@ -1993,6 +2041,9 @@ xf86TargetUserpref(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, { int o; + if (xf86UserConfiguredOutputs(scrn, modes)) + return xf86TargetFallback(scrn, config, modes, enabled, width, height); + for (o = -1; nextEnabledOutput(config, enabled, &o); ) if (xf86OutputHasUserPreferredMode(config->output[o])) return From 3fd5fab5663fbdce2fc0b5377155aedf9a70b6c2 Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Fri, 4 Jul 2008 02:51:42 -0300 Subject: [PATCH 75/83] Remove inexistent function headers. --- hw/xfree86/common/xf86Priv.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h index 88b80be2b..a29f22c7f 100644 --- a/hw/xfree86/common/xf86Priv.h +++ b/hw/xfree86/common/xf86Priv.h @@ -163,8 +163,6 @@ void DoConfigure(void); /* xf86Events.c */ -void xf86PostKbdEvent(unsigned key); -void xf86PostMseEvent(DeviceIntPtr device, int buttons, int dx, int dy); void xf86Wakeup(pointer blockData, int err, pointer pReadmask); void xf86SigHandler(int signo); void xf86HandlePMEvents(int fd, pointer data); From f72500c4a09cce5dbbd16639b1951a4bf943e4ac Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Fri, 4 Jul 2008 03:45:18 -0300 Subject: [PATCH 76/83] Nuke libc wrapper remaining stuffs. --- hw/xfree86/common/xf86.h | 1 - hw/xfree86/common/xf86Helper.c | 14 --- hw/xfree86/utils/xorgcfg/loadmod.c | 183 ----------------------------- 3 files changed, 198 deletions(-) diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h index 065102fb5..70b32b9da 100644 --- a/hw/xfree86/common/xf86.h +++ b/hw/xfree86/common/xf86.h @@ -340,7 +340,6 @@ Bool xf86IsUnblank(int mode); _X_DEPRECATED void xf86AddModuleInfo(pointer info, pointer module); _X_DEPRECATED void xf86DeleteModuleInfo(int idx); -void xf86getsecs(long *, long *); /* xf86Debug.c */ #ifdef BUILDDEBUG diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index eaa6c76fb..d58ce9326 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -2937,17 +2937,3 @@ xf86GetMotionEvents(DeviceIntPtr pDev, xTimecoord *buff, unsigned long start, { return GetMotionHistory(pDev, buff, start, stop, pScreen, core); } - -_X_EXPORT void -xf86getsecs(long * secs, long * usecs) -{ - struct timeval tv; - - X_GETTIMEOFDAY(&tv); - if (secs) - *secs = tv.tv_sec; - if (usecs) - *usecs= tv.tv_usec; - - return; -} diff --git a/hw/xfree86/utils/xorgcfg/loadmod.c b/hw/xfree86/utils/xorgcfg/loadmod.c index 748bd3a0b..6dbc65ea4 100644 --- a/hw/xfree86/utils/xorgcfg/loadmod.c +++ b/hw/xfree86/utils/xorgcfg/loadmod.c @@ -110,189 +110,6 @@ LOOKUP xfree86LookupTab[] = { SYMFUNC(LoaderFreeDirList) SYMFUNC(LoaderGetOS) - /* - * these here are our own interfaces to libc functions - */ - SYMFUNC(xf86abort) - SYMFUNC(xf86abs) - SYMFUNC(xf86acos) - SYMFUNC(xf86asin) - SYMFUNC(xf86atan) - SYMFUNC(xf86atan2) - SYMFUNC(xf86atof) - SYMFUNC(xf86atoi) - SYMFUNC(xf86atol) - SYMFUNC(xf86bsearch) - SYMFUNC(xf86ceil) - SYMFUNC(xf86calloc) - SYMFUNC(xf86clearerr) - SYMFUNC(xf86close) - SYMFUNC(xf86cos) - SYMFUNC(xf86exit) - SYMFUNC(xf86exp) - SYMFUNC(xf86fabs) - SYMFUNC(xf86fclose) - SYMFUNC(xf86feof) - SYMFUNC(xf86ferror) - SYMFUNC(xf86fflush) - SYMFUNC(xf86fgetc) - SYMFUNC(xf86fgetpos) - SYMFUNC(xf86fgets) - SYMFUNC(xf86finite) - SYMFUNC(xf86floor) - SYMFUNC(xf86fmod) - SYMFUNC(xf86fopen) - SYMFUNC(xf86fprintf) - SYMFUNC(xf86fputc) - SYMFUNC(xf86fputs) - SYMFUNC(xf86fread) - SYMFUNC(xf86free) - SYMFUNC(xf86freopen) - SYMFUNC(xf86frexp) - SYMFUNC(xf86fscanf) - SYMFUNC(xf86fseek) - SYMFUNC(xf86fsetpos) - SYMFUNC(xf86ftell) - SYMFUNC(xf86fwrite) - SYMFUNC(xf86getc) - SYMFUNC(xf86getenv) - SYMFUNC(xf86getpagesize) - SYMFUNC(xf86hypot) - SYMFUNC(xf86ioctl) - SYMFUNC(xf86isalnum) - SYMFUNC(xf86isalpha) - SYMFUNC(xf86iscntrl) - SYMFUNC(xf86isdigit) - SYMFUNC(xf86isgraph) - SYMFUNC(xf86islower) - SYMFUNC(xf86isprint) - SYMFUNC(xf86ispunct) - SYMFUNC(xf86isspace) - SYMFUNC(xf86isupper) - SYMFUNC(xf86isxdigit) - SYMFUNC(xf86labs) - SYMFUNC(xf86ldexp) - SYMFUNC(xf86log) - SYMFUNC(xf86log10) - SYMFUNC(xf86lseek) - SYMFUNC(xf86malloc) - SYMFUNC(xf86memchr) - SYMFUNC(xf86memcmp) - SYMFUNC(xf86memcpy) -#if (defined(__powerpc__) && (defined(Lynx) || defined(linux))) || \ - defined(__sparc__) || defined(__sparc) || defined(__ia64__) || \ - defined (__amd64__) - /* - * Some PPC, SPARC, and IA64 compilers generate calls to memcpy to handle - * structure copies. This causes a problem both here and in shared - * libraries as there is no way to map the name of the call to the - * correct function. - */ - SYMFUNC(memcpy) - /* - * Some PPC, SPARC, and IA64 compilers generate calls to memset to handle - * aggregate initializations. - */ - SYMFUNC(memset) -#endif - SYMFUNC(xf86memmove) - SYMFUNC(xf86memset) - SYMFUNC(xf86mmap) - SYMFUNC(xf86modf) - SYMFUNC(xf86munmap) - SYMFUNC(xf86open) - SYMFUNC(xf86perror) - SYMFUNC(xf86pow) - SYMFUNC(xf86printf) - SYMFUNC(xf86qsort) - SYMFUNC(xf86read) - SYMFUNC(xf86realloc) - SYMFUNC(xf86remove) - SYMFUNC(xf86rename) - SYMFUNC(xf86rewind) - SYMFUNC(xf86setbuf) - SYMFUNC(xf86setvbuf) - SYMFUNC(xf86sin) - SYMFUNC(xf86snprintf) - SYMFUNC(xf86sprintf) - SYMFUNC(xf86sqrt) - SYMFUNC(xf86sscanf) - SYMFUNC(xf86strcat) - SYMFUNC(xf86strcmp) - SYMFUNC(xf86strcasecmp) - SYMFUNC(xf86strcpy) - SYMFUNC(xf86strcspn) - SYMFUNC(xf86strerror) - SYMFUNC(xf86strlen) - SYMFUNC(xf86strncmp) - SYMFUNC(xf86strncasecmp) - SYMFUNC(xf86strncpy) - SYMFUNC(xf86strpbrk) - SYMFUNC(xf86strchr) - SYMFUNC(xf86strrchr) - SYMFUNC(xf86strspn) - SYMFUNC(xf86strstr) - SYMFUNC(xf86strtod) - SYMFUNC(xf86strtok) - SYMFUNC(xf86strtol) - SYMFUNC(xf86strtoul) - SYMFUNC(xf86tan) - SYMFUNC(xf86tmpfile) - SYMFUNC(xf86tolower) - SYMFUNC(xf86toupper) - SYMFUNC(xf86ungetc) - SYMFUNC(xf86vfprintf) - SYMFUNC(xf86vsnprintf) - SYMFUNC(xf86vsprintf) - SYMFUNC(xf86write) - -/* non-ANSI C functions */ - SYMFUNC(xf86opendir) - SYMFUNC(xf86closedir) - SYMFUNC(xf86readdir) - SYMFUNC(xf86rewinddir) - SYMFUNC(xf86ffs) - SYMFUNC(xf86strdup) - SYMFUNC(xf86bzero) - SYMFUNC(xf86usleep) - SYMFUNC(xf86execl) - - SYMFUNC(xf86getsecs) - SYMFUNC(xf86fpossize) /* for returning sizeof(fpos_t) */ - - SYMFUNC(xf86stat) - SYMFUNC(xf86fstat) - SYMFUNC(xf86access) - SYMFUNC(xf86geteuid) - SYMFUNC(xf86getegid) - SYMFUNC(xf86getpid) - SYMFUNC(xf86mknod) - SYMFUNC(xf86chmod) - SYMFUNC(xf86chown) - SYMFUNC(xf86sleep) - SYMFUNC(xf86mkdir) - SYMFUNC(xf86shmget) - SYMFUNC(xf86shmat) - SYMFUNC(xf86shmdt) - SYMFUNC(xf86shmctl) -#ifdef HAS_GLIBC_SIGSETJMP - SYMFUNC(xf86setjmp) - SYMFUNC(xf86setjmp0) -#if defined(__GLIBC__) && (__GLIBC__ >= 2) - SYMFUNCALIAS("xf86setjmp1",__sigsetjmp) -#else - SYMFUNC(xf86setjmp1) -#endif -#else - SYMFUNCALIAS("xf86setjmp",setjmp) - SYMFUNCALIAS("xf86setjmp0",setjmp) - SYMFUNC(xf86setjmp1) -#endif - SYMFUNCALIAS("xf86longjmp",longjmp) - SYMFUNC(xf86getjmptype) - SYMFUNC(xf86setjmp1_arg2) - SYMFUNC(xf86setjmperror) - SYMFUNC(xf86AddDriver) SYMFUNC(xf86ServerIsOnlyDetecting) SYMFUNC(xf86AddInputDriver) From d1031a8972490ebf0ef6dc2762036a7a7172466b Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Fri, 4 Jul 2008 03:46:21 -0300 Subject: [PATCH 77/83] Update README.OS-lib to reflect reality. --- hw/xfree86/os-support/README.OS-lib | 283 ---------------------------- 1 file changed, 283 deletions(-) diff --git a/hw/xfree86/os-support/README.OS-lib b/hw/xfree86/os-support/README.OS-lib index e410906f9..c815cb032 100644 --- a/hw/xfree86/os-support/README.OS-lib +++ b/hw/xfree86/os-support/README.OS-lib @@ -36,7 +36,6 @@ have been made in implementation. OS library. bsd/ OS support for the 386BSD/NetBSD/FreeBSD operating systems. - bsdi/ OS support for the BSD/386 operating system. linux/ OS support for the Linux operating system. sco/ OS support for the SCO SVR3.x operating system. solx86/ OS support for the Solaris x86 operating system. @@ -214,288 +213,6 @@ void xf86UseMsg(void) */ } -void xf86SoundKbdBell(int loudness, int pitch, int duration) -{ - /* - * Sound the keyboard bell. pitch is in Hz, duration in ms, - * loudness is in the range 0-100 (0 -> off). For systems - * where the loudness can't be controlled, scale the duration - * by loudness/50. - */ -} - -void xf86SetKbdLeds(int leds) -{ - /* - * Set the keyboard LEDs to the state indicated in leds - */ -} - -int xf86GetKbdLeds(void) -{ - /* - * Return the state of the keyboard LEDs. If the OS doesn't - * support this, return 0. - */ -} - -void xf86SetKbdRepeat(char rad) -{ - /* - * Set the keyboard repeat rate and delay according the - * the rad value. The lower 5 bits determine the repeat - * rate (lower value -> higher rate). The next 2 bits - * determine the delay. - * This should possibly be changed to take separate rate and - * delay parameters. - */ -} - -void xf86KbdInit(void) -{ - /* - * Save initial keyboard state. This is called at the start of - * each server generation. - */ -} - -int xf86KbdOn(void) -{ - /* - * Set the keyboard up for use with X. This is called whenever - * the server becomes active (ie at the start of each generation and - * whenever its VT becomes active). Return the file descriptor - * for keyboard input. Return -1 if there is no file descriptor - * to add as an input device. If there are errors encountered, - * call FatalError(). A return value of -1 is not considered an - * error condition. - */ -} - -int xf86KbdOff(void) -{ - /* - * Return the keyboard to the state saved by xf86KbdInit(). This is - * called at the end of a server generation, and also when the - * server's VT ceases being active. Returns the keyboard file - * descriptor. Returns -1 if there is no file descriptor to be - * removed as an input device. Errors should be handled the same - * way as in xf86KbdOn(). - */ -} - -void xf86KbdEvents(void) -{ - /* - * Read characters from the keyboard device, and post the events - * by calling xf86PostKbdEvent(). Read as much as is available - * without waiting. - */ -} - -void xf86SetMouseSpeed(int old, int new, unsigned cflag) -{ - /* - * Set the speed of the mouse port. old is the previous speed, - * new is the new speed, and cflag is the value of the termio[s] - * c_cflag field. For mice that have programmable speed operation, - * this should send the appropriate commands to the mouse. - */ -} - -void xf86MouseInit(void) -{ - /* - * This is called at the start of each server generation. In most - * cases this is a noop. If the mouse must not be opened/closed - * when VT switching, the open should be done here. - */ -} - -int xf86MousedOn(void) -{ - /* - * Set the mouse up for use with X. This is called whenever - * the server becomes active (ie at the start of each generation and - * whenever its VT becomes active). This function normally opens - * the mouse device, and may call xf86SetupMouse() to initialise - * the mouse parameters. Return the file descriptor for mouse input. - * Return -1 if there is no file descriptor to add as an input - * device. If there are errors encountered, call FatalError(). - * A return value of -1 is not considered an error condition. - */ -} - -int xf86MouseOff(Bool doclose) -{ - /* - * Release the mouse from use with X. This is called at the end - * of a server generation (with doclose==TRUE), and also when the - * server's VT ceases being active (with doclose==FALSE). If the - * mouse should not be opened/closed when VT switching, the close - * should be done here when doclose==TRUE. For other systems, the - * mouse device should be closed regardless of the doclose value. - * Returns the mouse file descriptor. Returns -1 if there is no - * file descriptor to be removed as an input device. Errors - * should be handled the same way as in xf86MouseOn(). - */ -} - -void xf86MouseEvents(void) -{ - /* - * Read characters from the mouse device, and post the events - * by calling xf86PostMseEvent(). Read as much as is available - * without waiting. If the OS doesn't handle the mouse protocol - * translation, xf86MouseProtocol() may be called to do the - * translation and event posting. If the OS does handle the protocol - * translation, MOUSE_PROTOCOL_IN_KERNEL should be #define'd in - * xf86_OSlib.h. - */ -} - -int xf86OsMouseProc(DevicePtr pPointer, int what) -{ - /* - * Implements the device-proc for the pointer device when an - * OS-based mouse driver is being used (as opposed to the - * server's internal mouse driver). Implemented as any other - * device-proc in the server. - * - * This function only needs to be implemented if USE_OSMOUSE is - * defined for the OS. - */ -} - -int xf86OsMouseEvents(void) -{ - /* - * When supporting an OS-based mouse driver (as opposed to the - * server's internal mouse driver), read some events from the device - * and post them to the DIX layer through xf86PostMseEvent(). - * - * This function only needs to be implemented if USE_OSMOUSE is - * defined for the OS. - */ -} - -void xf86OsMouseOption(int token, pointer lex_ptr) -{ - /* - * Used in parsing an OsMouse keyword from the Xconfig file. - * Passed the token type and a pointer to the token value. - * The function should do whatever is appropriate for the OS's - * mouse driver. - * - * This function only needs to be implemented if USE_OSMOUSE is - * defined for the OS. - */ -} - -/* - * The following functions are simply wrappers around the OS specific - * libc functions - */ - -void * -xf86memmove(void * dest, const void * src, INT32 n) -{ - return(memmove(dest,src,n)); -} - -void * -xf86memset(void * s, int c, INT32 n) -{ - return(memset(s,c,n)); -} - -void * -xf86memcpy(void * dest, const void * src, INT32 n) -{ - return(memcpy(dest,src,n)); -} - -int -xf86memcmp(const void * s1, const void * s2, INT32 n) -{ - return(memcmp(s1,s2,n)); -} - -char * -xf86strcat(char * dest, const char * src) -{ - return(strcat(dest,src)); -} - -char * -xf86strcpy(char * dest, const char * src) -{ - return(strcpy(dest,src)); -} - -int -xf86strcmp(const char * s1, const char * s2) -{ - return(strcmp(s1,s2)); -} - -int -xf86strncmp(const char * s1, const char * s2, INT32 n) -{ - return(strncmp(s1,s2,n)); -} - -size_t -xf86strlen(const char * s) -{ - return(strlen(s)); -} - -void -xf86getsecs(INT32 * secs, INT32 * usecs) -{ - struct timeval tv; - - gettimeofday(&tv, NULL); - *secs = tv.tv_sec; - *usecs= tv.tv_usec; - - return; -} - -double -xf86exp(double x) -{ - return(exp(x)); -} - -double -xf86log(double x) -{ - return(log(x)); -} - -double -xf86pow(double x, double y) -{ - return(pow(x,y)); -} - -double -xf86sqrt(double x) -{ - return(sqrt(x)); -} - -double -xf86cos(double x) -{ - return(cos(x)); -} - - - - $XFree86: xc/programs/Xserver/hw/xfree86/os-support/README.OS-lib,v 3.10 2001/12/17 20:00:45 dawes Exp $ From 3164288b121990a5990747c0f92d4af13b1c929a Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Fri, 4 Jul 2008 03:55:59 -0300 Subject: [PATCH 78/83] Remove deprecated function miPointerPosition(). --- hw/xfree86/common/xf86RandR.c | 2 +- hw/xfree86/dri/dri.c | 2 +- hw/xfree86/loader/misym.c | 1 - mi/mipointer.c | 6 ------ mi/mipointer.h | 6 ------ 5 files changed, 2 insertions(+), 15 deletions(-) diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c index 47023926c..b71924f09 100644 --- a/hw/xfree86/common/xf86RandR.c +++ b/hw/xfree86/common/xf86RandR.c @@ -243,7 +243,7 @@ xf86RandRSetConfig (ScreenPtr pScreen, Bool useVirtual = FALSE; Rotation oldRotation = randrp->rotation; - miPointerPosition (&px, &py); + miPointerGetPosition(inputInfo.pointermi, &px, &py); for (mode = scrp->modes; ; mode = mode->next) { if (mode->HDisplay == pSize->width && diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index ae8818932..ac40e0fe0 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -2301,7 +2301,7 @@ DRIAdjustFrame(int scrnIndex, int x, int y, int flags) pScrn->frameY1 = pScrn->frameY0 + pDRIPriv->pSAREA->frame.height - 1; /* Fix up cursor */ - miPointerPosition(&px, &py); + miPointerGetPosition(inputInfo.pointer, &px, &py); if (px < pScrn->frameX0) px = pScrn->frameX0; if (px > pScrn->frameX1) px = pScrn->frameX1; if (py < pScrn->frameY0) py = pScrn->frameY0; diff --git a/hw/xfree86/loader/misym.c b/hw/xfree86/loader/misym.c index aa712c03a..c7542288e 100644 --- a/hw/xfree86/loader/misym.c +++ b/hw/xfree86/loader/misym.c @@ -160,7 +160,6 @@ _X_HIDDEN void *miLookupTab[] = { SYMFUNC(miPutImage) SYMFUNC(miPushPixels) SYMFUNC(miPointerInitialize) - SYMFUNC(miPointerPosition) SYMFUNC(miRecolorCursor) SYMFUNC(miPointerWarpCursor) SYMFUNC(miDCInitialize) diff --git a/mi/mipointer.c b/mi/mipointer.c index 4763e1269..809ce5e8b 100644 --- a/mi/mipointer.c +++ b/mi/mipointer.c @@ -559,12 +559,6 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y, unsigned long time) miPointerMoved(pDev, pScreen, *x, *y, time); } -_X_EXPORT void -miPointerPosition (int *x, int *y) -{ - miPointerGetPosition(inputInfo.pointer, x, y); -} - _X_EXPORT void miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y) { diff --git a/mi/mipointer.h b/mi/mipointer.h index d2e4455eb..179e4f371 100644 --- a/mi/mipointer.h +++ b/mi/mipointer.h @@ -134,12 +134,6 @@ extern void miPointerAbsoluteCursor( unsigned long /*time*/ ) _X_DEPRECATED; -/* Deprecated in favour of miPointerGetPosition. */ -extern void miPointerPosition( - int * /*x*/, - int * /*y*/ -) _X_DEPRECATED; - /* Deprecated in favour of miPointerSetScreen. */ extern void miPointerSetNewScreen( int, /*screen_no*/ From a8c4727f01949da0ae266369f0d12a96c2bf0da5 Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Fri, 4 Jul 2008 04:03:46 -0300 Subject: [PATCH 79/83] Fix typo in the last commit. --- hw/xfree86/common/xf86RandR.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c index b71924f09..f30674f72 100644 --- a/hw/xfree86/common/xf86RandR.c +++ b/hw/xfree86/common/xf86RandR.c @@ -243,7 +243,7 @@ xf86RandRSetConfig (ScreenPtr pScreen, Bool useVirtual = FALSE; Rotation oldRotation = randrp->rotation; - miPointerGetPosition(inputInfo.pointermi, &px, &py); + miPointerGetPosition(inputInfo.pointer, &px, &py); for (mode = scrp->modes; ; mode = mode->next) { if (mode->HDisplay == pSize->width && From d78bebb20a00e8519788c75c90b467a5750c78be Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Fri, 4 Jul 2008 04:04:19 -0300 Subject: [PATCH 80/83] Remove unused function and variables. --- hw/xfree86/common/xf86Xinput.c | 1 - hw/xfree86/exa/examodule.c | 7 ------- hw/xfree86/modes/xf86Modes.c | 3 +-- mi/misprite.c | 1 - 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index b98e903fa..498f79706 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -467,7 +467,6 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev) LocalDevicePtr pInfo = (LocalDevicePtr) pDev->public.devicePrivate; InputDriverPtr drv; IDevRec *idev; - BOOL found; IDevPtr *it; if (pInfo) /* need to get these before RemoveDevice */ diff --git a/hw/xfree86/exa/examodule.c b/hw/xfree86/exa/examodule.c index 63ea8c56b..4a8d8f26a 100644 --- a/hw/xfree86/exa/examodule.c +++ b/hw/xfree86/exa/examodule.c @@ -179,13 +179,6 @@ exaDDXDriverInit(ScreenPtr pScreen) } -/*ARGSUSED*/ -static const OptionInfoRec * -EXAAvailableOptions(void *unused) -{ - return (EXAOptions); -} - static XF86ModuleVersionInfo exaVersRec = { "exa", diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c index 3a9f3ff24..dd5ce6483 100644 --- a/hw/xfree86/modes/xf86Modes.c +++ b/hw/xfree86/modes/xf86Modes.c @@ -526,7 +526,6 @@ xf86ValidateModesBandwidth(ScrnInfoPtr pScrn, DisplayModePtr modeList, _X_EXPORT void xf86ValidateModesReducedBlanking(ScrnInfoPtr pScrn, DisplayModePtr modeList) { - Bool mode_is_reduced = FALSE; DisplayModePtr mode; for (mode = modeList; mode != NULL; mode = mode->next) { @@ -682,7 +681,7 @@ xf86GetMonitorModes (ScrnInfoPtr pScrn, XF86ConfMonitorPtr conf_monitor) _X_EXPORT DisplayModePtr xf86GetDefaultModes (Bool interlaceAllowed, Bool doubleScanAllowed) { - DisplayModePtr head = NULL, prev = NULL, mode; + DisplayModePtr head = NULL, mode; int i; for (i = 0; i < xf86NumDefaultModes; i++) diff --git a/mi/misprite.c b/mi/misprite.c index 6f0cbe730..122cea43b 100644 --- a/mi/misprite.c +++ b/mi/misprite.c @@ -268,7 +268,6 @@ static Bool miSpriteCloseScreen (int i, ScreenPtr pScreen) { miSpriteScreenPtr pScreenPriv; - DeviceIntPtr pDev; pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, miSpriteScreenKey); From d8af9d9ab1cd98c07fdf42490dcc0cab3c655b89 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 7 Jul 2008 13:14:49 +0200 Subject: [PATCH 81/83] Export xkbfile.h in the SDK It's needed by xkbsrv.h --- include/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/Makefile.am b/include/Makefile.am index 7d5fee70b..5edefe7b5 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -50,6 +50,7 @@ sdk_HEADERS = \ validate.h \ window.h \ windowstr.h \ + xkbfile.h \ xkbsrv.h \ xkbstr.h \ xorg-server.h @@ -58,4 +59,4 @@ endif AM_CFLAGS = $(DIX_CFLAGS) EXTRA_DIST = $(sdk_HEADERS) do-not-use-config.h dix-config.h xorg-config.h \ - xkb-config.h xkbfile.h + xkb-config.h From 235fea0e1a2101fb76a54e6505db321674530c60 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 7 Jul 2008 15:21:59 -0700 Subject: [PATCH 82/83] Update bsd & solaris descriptions in README.OS-lib --- hw/xfree86/os-support/README.OS-lib | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/os-support/README.OS-lib b/hw/xfree86/os-support/README.OS-lib index c815cb032..308d7628a 100644 --- a/hw/xfree86/os-support/README.OS-lib +++ b/hw/xfree86/os-support/README.OS-lib @@ -34,11 +34,11 @@ have been made in implementation. at build time via Imakefile rules. This is alway preferable to reproducing functions in more than one OS library. - bsd/ OS support for the 386BSD/NetBSD/FreeBSD operating + bsd/ OS support for the NetBSD/FreeBSD/OpenBSD operating systems. linux/ OS support for the Linux operating system. sco/ OS support for the SCO SVR3.x operating system. - solx86/ OS support for the Solaris x86 operating system. + solaris/ OS support for the Solaris operating system. sysv/ OS support for all SVR4.0 and SVR4.2, and for ISC and AT&T SVR3.2 operating systems. From 5e847c1d4fc30a0d263a861a76982660f11998cd Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 7 Jul 2008 17:08:01 -0700 Subject: [PATCH 83/83] Improved driver selection when autoconfiguring driver without xorg.conf - Allow returning multiple drivers to try for a given PCI id (for instance, try "geode" then "amd" for AMD Geode hardware) - On Solaris, use VIS_GETIDENTIFIER ioctl as well as PCI id to choose drivers - Use wsfb instead of fbdev as a fallback on non-Linux SPARC platforms --- hw/xfree86/common/xf86AutoConfig.c | 227 ++++++++++++++++++----------- 1 file changed, 144 insertions(+), 83 deletions(-) diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index a786eed3e..45c42e1d8 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -41,6 +41,11 @@ #include "xf86_OSlib.h" #include "dirent.h" +#ifdef sun +# include +# include +#endif + /* Sections for the default built-in configuration. */ #define BUILTIN_DEVICE_NAME \ @@ -79,11 +84,8 @@ static const char **builtinConfig = NULL; static int builtinLines = 0; -static const char *deviceList[] = { - "fbdev", - "vesa", - NULL -}; + +static void listPossibleVideoDrivers(char *matches[], int nmatches); /* * A built-in config file is stored as an array of strings, with each string @@ -135,87 +137,91 @@ AppendToConfig(const char *s) AppendToList(s, &builtinConfig, &builtinLines); } -static const char * -videoPtrToDriverName(struct pci_device *dev) +static int +videoPtrToDriverList(struct pci_device *dev, + char *returnList[], int returnListMax) { /* * things not handled yet: * cyrix/nsc. should be merged into geode anyway. * xgi. */ + int i; + /* Add more entries here if we ever return more than 4 drivers for + any device */ + char *driverList[5] = { NULL, NULL, NULL, NULL, NULL }; switch (dev->vendor_id) { case 0x1022: - if (dev->device_id == 0x2081) - return "geode"; - else - return NULL; - case 0x1142: return "apm"; - case 0xedd8: return "ark"; - case 0x1a03: return "ast"; - case 0x1002: return "ati"; - case 0x102c: return "chips"; - case 0x1013: return "cirrus"; + if (dev->device_id == 0x2081) { + driverList[0] = "geode"; + driverList[1] = "amd"; + } + break; + case 0x1142: driverList[0] = "apm"; break; + case 0xedd8: driverList[0] = "ark"; break; + case 0x1a03: driverList[0] = "ast"; break; + case 0x1002: driverList[0] = "ati"; break; + case 0x102c: driverList[0] = "chips"; break; + case 0x1013: driverList[0] = "cirrus"; break; case 0x8086: - if ((dev->device_id == 0x00d1) || (dev->device_id == 0x7800)) - return "i740"; - else return "intel"; - case 0x102b: return "mga"; - case 0x10c8: return "neomagic"; - case 0x105d: return "i128"; - case 0x10de: case 0x12d2: return "nv"; - case 0x1163: return "rendition"; + if ((dev->device_id == 0x00d1) || (dev->device_id == 0x7800)) { + driverList[0] = "i740"; + } else { + driverList[0] = "intel"; + driverList[1] = "i810"; + } + break; + case 0x102b: driverList[0] = "mga"; break; + case 0x10c8: driverList[0] = "neomagic"; break; + case 0x105d: driverList[0] = "i128"; break; + case 0x10de: case 0x12d2: driverList[0] = "nv"; break; + case 0x1163: driverList[0] = "rendition"; break; case 0x5333: switch (dev->device_id) { case 0x88d0: case 0x88d1: case 0x88f0: case 0x8811: case 0x8812: case 0x8814: case 0x8901: - return "s3"; + driverList[0] = "s3"; break; case 0x5631: case 0x883d: case 0x8a01: case 0x8a10: case 0x8c01: case 0x8c03: case 0x8904: case 0x8a13: - return "s3virge"; + driverList[0] = "s3virge"; break; default: - return "savage"; + driverList[0] = "savage"; break; } - case 0x1039: return "sis"; - case 0x126f: return "siliconmotion"; + break; + case 0x1039: driverList[0] = "sis"; break; + case 0x126f: driverList[0] = "siliconmotion"; break; case 0x121a: if (dev->device_id < 0x0003) - return "voodoo"; + driverList[0] = "voodoo"; else - return "tdfx"; - case 0x3d3d: return "glint"; - case 0x1023: return "trident"; - case 0x100c: return "tseng"; - case 0x1106: return "openchrome"; - case 0x15ad: return "vmware"; + driverList[0] = "tdfx"; + break; + case 0x3d3d: driverList[0] = "glint"; break; + case 0x1023: driverList[0] = "trident"; break; + case 0x100c: driverList[0] = "tseng"; break; + case 0x1106: driverList[0] = "openchrome"; break; + case 0x15ad: driverList[0] = "vmware"; break; default: break; } - return NULL; + for (i = 0; (i < returnListMax) && (driverList[i] != NULL); i++) { + returnList[i] = xnfstrdup(driverList[i]); + } + return i; /* Number of entries added */ } Bool xf86AutoConfig(void) { - const char **p; + char *deviceList[20]; + char **p; + const char **cp; char buf[1024]; - const char *driver = NULL; ConfigStatus ret; - driver = chooseVideoDriver(); - - if (driver) { - snprintf(buf, sizeof(buf), BUILTIN_DEVICE_SECTION_PRE, - driver, 0, driver); - AppendToConfig(buf); - ErrorF("New driver is \"%s\"\n", driver); - buf[0] = '\t'; - AppendToConfig(BUILTIN_DEVICE_SECTION_POST); - snprintf(buf, sizeof(buf), BUILTIN_SCREEN_SECTION, - driver, 0, driver, 0); - AppendToConfig(buf); - } + listPossibleVideoDrivers(deviceList, 20); for (p = deviceList; *p; p++) { snprintf(buf, sizeof(buf), BUILTIN_DEVICE_SECTION, *p, 0, *p); @@ -225,23 +231,23 @@ xf86AutoConfig(void) } AppendToConfig(BUILTIN_LAYOUT_SECTION_PRE); - if (driver) { - snprintf(buf, sizeof(buf), BUILTIN_LAYOUT_SCREEN_LINE, driver, 0); - AppendToConfig(buf); - } for (p = deviceList; *p; p++) { snprintf(buf, sizeof(buf), BUILTIN_LAYOUT_SCREEN_LINE, *p, 0); AppendToConfig(buf); } AppendToConfig(BUILTIN_LAYOUT_SECTION_POST); + for (p = deviceList; *p; p++) { + xfree(*p); + } + xf86MsgVerb(X_DEFAULT, 0, "Using default built-in configuration (%d lines)\n", builtinLines); xf86MsgVerb(X_DEFAULT, 3, "--- Start of built-in configuration ---\n"); - for (p = builtinConfig; *p; p++) - xf86ErrorFVerb(3, "\t%s", *p); + for (cp = builtinConfig; *cp; cp++) + xf86ErrorFVerb(3, "\t%s", *cp); xf86MsgVerb(X_DEFAULT, 3, "--- End of built-in configuration ---\n"); xf86setBuiltinConfig(builtinConfig); @@ -416,17 +422,51 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip } #endif /* __linux__ */ -char* -chooseVideoDriver(void) +static void +listPossibleVideoDrivers(char *matches[], int nmatches) { struct pci_device * info = NULL; struct pci_device_iterator *iter; - char *chosen_driver = NULL; int i; - char *matches[20]; /* If we have more than 20 drivers we're in trouble */ - for (i=0 ; i<20 ; i++) + for (i = 0 ; i < nmatches ; i++) { matches[i] = NULL; + } + i = 0; + +#ifdef sun + /* Check for driver type based on /dev/fb type and if valid, use + it instead of PCI bus probe results */ + if (xf86Info.consoleFd >= 0) { + struct vis_identifier visid; + const char *cp; + + if (ioctl(xf86Info.consoleFd, VIS_GETIDENTIFIER, &visid) >= 0) { + xf86Msg(X_PROBED, "console driver: %s\n", visid.name); + + /* Special case from before the general case was set */ + if (strcmp(visid.name, "NVDAnvda") == 0) { + matches[i++] = xnfstrdup("nvidia"); + } + + /* General case - split into vendor name (initial all-caps + prefix) & driver name (rest of the string). */ + if (strcmp(visid.name, "SUNWtext") != 0) { + for (cp = visid.name; (*cp != '\0') && isupper(*cp); cp++) { + /* find end of all uppercase vendor section */ + } + if ((cp != visid.name) && (*cp != '\0')) { + char *driverName = xnfstrdup(cp); + char *vendorName = xnfstrdup(visid.name); + vendorName[cp - visid.name] = '\0'; + + matches[i++] = vendorName; + matches[i++] = driverName; + } + } + } + } +#endif /* Find the primary device, and get some information about it. */ iter = pci_slot_match_iterator_create(NULL); @@ -447,31 +487,52 @@ chooseVideoDriver(void) } #endif /* __linux__ */ - /* TODO Handle multiple drivers claiming to support the same PCI ID */ - if (matches[0]) { - chosen_driver = matches[0]; - } else { - if (info != NULL) - chosen_driver = videoPtrToDriverName(info); - if (chosen_driver == NULL) { -#if defined __i386__ || defined __amd64__ || defined __hurd__ - chosen_driver = "vesa"; -#elif defined __sparc__ - chosen_driver = "sunffb"; -#else - chosen_driver = "fbdev"; -#endif - } + for (i = 0; (i < nmatches) && (matches[i]); i++) { + /* find end of matches list */ } - xf86Msg(X_DEFAULT, "Matched %s for the autoconfigured driver\n", chosen_driver); + if ((info != NULL) && (i < nmatches)) { + i += videoPtrToDriverList(info, &(matches[i]), nmatches - i); + } - i = 0; - while (matches[i]) { + /* Fallback to platform default hardware */ + if (i < (nmatches - 1)) { +#if defined(__i386__) || defined(__amd64__) || defined(__hurd__) + matches[i++] = xnfstrdup("vesa"); +#elif defined(__sparc__) && !defined(sun) + matches[i++] = xnfstrdup("sunffb"); +#endif + } + + /* Fallback to platform default frame buffer driver */ + if (i < (nmatches - 1)) { +#if !defined(__linux__) && defined(__sparc__) + matches[i++] = xnfstrdup("wsfb"); +#else + matches[i++] = xnfstrdup("fbdev"); +#endif + } +} + +char* +chooseVideoDriver(void) +{ + char *chosen_driver = NULL; + int i; + char *matches[20]; /* If we have more than 20 drivers we're in trouble */ + + listPossibleVideoDrivers(matches, 20); + + /* TODO Handle multiple drivers claiming to support the same PCI ID */ + chosen_driver = matches[0]; + + xf86Msg(X_DEFAULT, "Matched %s for the autoconfigured driver\n", + chosen_driver); + + for (i = 0; matches[i] ; i++) { if (matches[i] != chosen_driver) { xfree(matches[i]); } - i++; } return chosen_driver;