/* * Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * 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 Marc Aurele La France not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. Marc Aurele La France makes no representations * about the suitability of this software for any purpose. It is provided * "as-is" without express or implied warranty. * * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO * EVENT SHALL MARC AURELE LA FRANCE 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. */ /*************************************************************************/ /* * Author: Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * This is the ATI driver for XFree86. * * John Donne once said "No man is an island", and I am most certainly not an * exception. Contributions, intentional or not, to this and previous versions * of this driver by the following are hereby acknowledged: * * Thomas Roell, Per Lindqvist, Doug Evans, Rik Faith, Arthur Tateishi, * Alain Hebert, Ton van Rosmalen, David Chambers, William Shubert, * ATI Technologies Incorporated, Robert Wolff, David Dawes, Mark Weaver, * Hans Nasten, Kevin Martin, Frederic Rienthaler, Marc Bolduc, Reuben Sumner, * Benjamin T. Yang, James Fast Kane, Randall Hopper, W. Marcus Miller, * Henrik Harmsen, Christian Lupien, Precision Insight Incorporated, * Mark Vojkovich, Huw D M Davies, Andrew C Aitchison, Ani Joshi, * Kostas Gewrgiou, Jakub Jelinek, David S. Miller, A E Lawrence, * Linus Torvalds, William Blew, Ignacio Garcia Etxebarria, Patrick Chase, * Vladimir Dergachev, Egbert Eich, Mike A. Harris * * ... and, many, many others from around the world. * * In addition, this work would not have been possible without the active * support, both moral and otherwise, of the staff and management of Computing * and Network Services at the University of Alberta, in Edmonton, Alberta, * Canada. * * The driver is intended to support all ATI adapters since their VGA Wonder * V3, including OEM counterparts. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "atipcirename.h" #include "ati.h" #include "atichip.h" #include "ativersion.h" #include "atimach64probe.h" #include "radeon_probe.h" #include "radeon_version.h" #include "r128_probe.h" #include "r128_version.h" /* * ATIIdentify -- * * Print the driver's list of chipset names. */ static void ATIIdentify ( int flags ) { xf86Msg(X_INFO, "%s: %s\n", ATI_NAME, "ATI driver (version " ATI_VERSION_NAME ") for chipset: mach64"); R128Identify(flags); RADEONIdentify(flags); } /* * ATIProbe -- * * This function is called once, at the start of the first server generation to * do a minimal probe for supported hardware. */ static Bool ATIProbe ( DriverPtr pDriver, int flags ) { pciVideoPtr pVideo, *xf86PciVideoInfo = xf86GetPciVideoInfo(); Bool ProbeSuccess = FALSE; Bool DoMach64 = FALSE; Bool DoRage128 = FALSE, DoRadeon = FALSE; int i; ATIChipType Chip; if (!(flags & PROBE_DETECT)) { if (xf86MatchDevice(ATI_NAME, NULL) > 0) DoMach64 = TRUE; if (xf86MatchDevice(R128_NAME, NULL) > 0) DoRage128 = TRUE; if (xf86MatchDevice(RADEON_NAME, NULL) > 0) DoRadeon = TRUE; } if (xf86PciVideoInfo) { for (i = 0; (pVideo = xf86PciVideoInfo[i++]); ) { if ((PCI_DEV_VENDOR_ID(pVideo) != PCI_VENDOR_ATI) || (PCI_DEV_DEVICE_ID(pVideo) == PCI_CHIP_MACH32)) continue; /* Check for Rage128's, Radeon's and later adapters */ Chip = ATIChipID(PCI_DEV_DEVICE_ID(pVideo), PCI_DEV_REVISION(pVideo)); if (Chip > ATI_CHIP_Mach64) { if (Chip <= ATI_CHIP_Rage128) DoRage128 = TRUE; else if (Chip <= ATI_CHIP_Radeon) DoRadeon = TRUE; continue; } DoMach64 = TRUE; } } /* Call Mach64 driver probe */ if (DoMach64 && Mach64Probe(pDriver, flags)) ProbeSuccess = TRUE; /* Call Rage 128 driver probe */ if (DoRage128 && R128Probe(pDriver, flags)) ProbeSuccess = TRUE; /* Call Radeon driver probe */ if (DoRadeon && RADEONProbe(pDriver, flags)) ProbeSuccess = TRUE; return ProbeSuccess; } /* * ATIAvailableOptions -- * * Return recognised options that are intended for public consumption. */ const OptionInfoRec * ATIAvailableOptions ( int ChipId, int BusId ) { const OptionInfoRec *pOptions; if ((pOptions = R128AvailableOptions(ChipId, BusId))) return pOptions; if ((pOptions = RADEONAvailableOptions(ChipId, BusId))) return pOptions; return Mach64AvailableOptions(ChipId, BusId); } /* The root of all evil... */ _X_EXPORT DriverRec ATI = { ATI_VERSION_CURRENT, "ati", ATIIdentify, ATIProbe, ATIAvailableOptions, NULL, 0 };