From 645453ce11f819c4e9dd9be95ce9d621dc7d466b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michel=20D=C3=A4nzer?= Date: Wed, 26 Jul 2006 18:14:20 +0200 Subject: [PATCH] Bug #7629: Fix for CHIP_IS_AGP getting 'restored' with non-AGP cards Commit 2a47f6bfecea5dabcbf79d5e1aaf271f50070b89 caused the CHIP_IS_AGP flag to get 'restored' with PCI(e) cards. I can't think of a way to fix this without introducing a (otherwise redundant) CHIP_IS_PCI flag. --- shared-core/radeon_cp.c | 8 +++++--- shared-core/radeon_drv.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/shared-core/radeon_cp.c b/shared-core/radeon_cp.c index 299ec6a..12ba7ba 100644 --- a/shared-core/radeon_cp.c +++ b/shared-core/radeon_cp.c @@ -1351,7 +1351,8 @@ static int radeon_do_init_cp(drm_device_t * dev, drm_radeon_init_t * init) DRM_DEBUG("Forcing AGP card to PCI mode\n"); dev_priv->flags &= ~CHIP_IS_AGP; } - else if (!(dev_priv->flags & CHIP_IS_AGP)) + else if (!(dev_priv->flags & (CHIP_IS_AGP | CHIP_IS_PCI | CHIP_IS_PCIE)) + && !init->is_pci) { DRM_DEBUG("Restoring AGP flag\n"); dev_priv->flags |= CHIP_IS_AGP; @@ -2215,9 +2216,10 @@ int radeon_driver_load(struct drm_device *dev, unsigned long flags) if (drm_device_is_agp(dev)) dev_priv->flags |= CHIP_IS_AGP; - - if (drm_device_is_pcie(dev)) + else if (drm_device_is_pcie(dev)) dev_priv->flags |= CHIP_IS_PCIE; + else + dev_priv->flags |= CHIP_IS_PCI; DRM_DEBUG("%s card detected\n", ((dev_priv->flags & CHIP_IS_AGP) ? "AGP" : (((dev_priv->flags & CHIP_IS_PCIE) ? "PCIE" : "PCI")))); diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h index 63b5ace..ff75480 100644 --- a/shared-core/radeon_drv.h +++ b/shared-core/radeon_drv.h @@ -143,6 +143,7 @@ enum radeon_chip_flags { CHIP_HAS_HIERZ = 0x00100000UL, CHIP_IS_PCIE = 0x00200000UL, CHIP_NEW_MEMMAP = 0x00400000UL, + CHIP_IS_PCI = 0x00800000UL, }; #define GET_RING_HEAD(dev_priv) (dev_priv->writeback_works ? \ -- 2.7.4