diff options
author | Jeff Hartmann <jhartmann@valinux.com> | 2001-08-08 16:10:47 +0000 |
---|---|---|
committer | Jeff Hartmann <jhartmann@valinux.com> | 2001-08-08 16:10:47 +0000 |
commit | b6923b39539c34c2a589197def5eee72a9d719bf (patch) | |
tree | 8fc63d04fe2344377ef4123acbe38ff1fa3f3493 /linux-core/drm_drv.c | |
parent | 938a637d1fc33bc8ef14210d655c27d646ddc2d2 (diff) |
Update to the code I sent Linus and Alan this morning. Added some missing
agp chipsets to drm_agpsupport.h, redid the card detection common code
to use a structure (avoids endian porting issues), changed the tdfx
driver to use the kernel pci id '#defines'
Diffstat (limited to 'linux-core/drm_drv.c')
-rw-r--r-- | linux-core/drm_drv.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index a28b0b5b..e1aff06d 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -506,8 +506,9 @@ static int drm_count_cards(void) { int num = 0; #if defined(DRIVER_CARD_LIST) - u_int *l; - u_int device, vendor; + int i; + drm_pci_list_t *l; + u16 device, vendor; struct pci_dev *pdev = NULL; #endif @@ -516,14 +517,12 @@ static int drm_count_cards(void) #if defined(DRIVER_COUNT_CARDS) num = DRIVER_COUNT_CARDS(); #elif defined(DRIVER_CARD_LIST) - for (l = DRIVER_CARD_LIST; *l; l++) { + for (i = 0, l = DRIVER_CARD_LIST; l[i].vendor != 0; i++) { pdev = NULL; - device = *l & 0xFFFF; - if (device == 0xFFFF) - device = PCI_ANY_ID; - vendor = (*l >> 16) & 0xFFFF; - if (vendor == 0xFFFF) - vendor = PCI_ANY_ID; + vendor = l[i].vendor; + device = l[i].device; + if(device == 0xffff) device = PCI_ANY_ID; + if(vendor == 0xffff) vendor = PCI_ANY_ID; while ((pdev = pci_find_device(vendor, device, pdev))) { num++; } @@ -648,7 +647,7 @@ static void __exit drm_cleanup( void ) #endif #if __REALLY_HAVE_AGP && __REALLY_HAVE_MTRR - if ( dev->agp && dev->agp->agp_mtrr ) { + if ( dev->agp && dev->agp->agp_mtrr >= 0) { int retval; retval = mtrr_del( dev->agp->agp_mtrr, dev->agp->agp_info.aper_base, |