agp_via.c (131433) | agp_via.c (133406) |
---|---|
1/*- 2 * Copyright (c) 2000 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2000 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/dev/agp/agp_via.c 131433 2004-07-02 03:39:33Z jhb $"); | 28__FBSDID("$FreeBSD: head/sys/dev/agp/agp_via.c 133406 2004-08-09 21:01:49Z anholt $"); |
29 30#include "opt_bus.h" 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/malloc.h> 35#include <sys/kernel.h> 36#include <sys/module.h> --- 80 unchanged lines hidden (view full) --- 117} 118 119static int 120agp_via_attach(device_t dev) 121{ 122 struct agp_via_softc *sc = device_get_softc(dev); 123 struct agp_gatt *gatt; 124 int error; | 29 30#include "opt_bus.h" 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/malloc.h> 35#include <sys/kernel.h> 36#include <sys/module.h> --- 80 unchanged lines hidden (view full) --- 117} 118 119static int 120agp_via_attach(device_t dev) 121{ 122 struct agp_via_softc *sc = device_get_softc(dev); 123 struct agp_gatt *gatt; 124 int error; |
125 u_int32_t agpsel; |
|
125 126 switch (pci_get_devid(dev)) { 127 case 0x31881106: 128 case 0x31891106: | 126 127 switch (pci_get_devid(dev)) { 128 case 0x31881106: 129 case 0x31891106: |
129 sc->regs = via_v3_regs; | 130 /* The newer VIA chipsets will select the AGP version based on 131 * what AGP versions the card supports. We still have to 132 * program it using the v2 registers if it has chosen to use 133 * compatibility mode. 134 */ 135 agpsel = pci_read_config(dev, AGP_VIA_AGPSEL, 1); 136 if ((agpsel & (1 << 1)) == 0) 137 sc->regs = via_v3_regs; 138 else 139 sc->regs = via_v2_regs; |
130 break; 131 default: 132 sc->regs = via_v2_regs; 133 break; 134 } 135 136 error = agp_generic_attach(dev); 137 if (error) --- 155 unchanged lines hidden --- | 140 break; 141 default: 142 sc->regs = via_v2_regs; 143 break; 144 } 145 146 error = agp_generic_attach(dev); 147 if (error) --- 155 unchanged lines hidden --- |