drm/radeon/kms: R3XX/R4XX AGP asic use PCI GART not PCIE GART
authorJerome Glisse <jglisse@redhat.com>
Thu, 10 Sep 2009 11:47:09 +0000 (13:47 +0200)
committerDave Airlie <airlied@redhat.com>
Fri, 11 Sep 2009 01:41:34 +0000 (11:41 +1000)
R3XX/R4XX AGP asic use the old PCI GART block, not the new PCIE GART.
Make sure we pick the right GART when disabling AGP.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/r300.c
drivers/gpu/drm/radeon/r420.c
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_device.c

index a5f82f7beed60e04eafc26c99c72c5e18ff3cdc3..9c17b786982a1c07e1776345bc4aea1849a9b948 100644 (file)
@@ -181,6 +181,12 @@ int r300_gart_enable(struct radeon_device *rdev)
                rdev->asic->gart_set_page = &rv370_pcie_gart_set_page;
                return rv370_pcie_gart_enable(rdev);
        }
+       if (rdev->flags & RADEON_IS_PCI) {
+               rdev->asic->gart_disable = &r100_pci_gart_disable;
+               rdev->asic->gart_tlb_flush = &r100_pci_gart_tlb_flush;
+               rdev->asic->gart_set_page = &r100_pci_gart_set_page;
+               return r100_pci_gart_enable(rdev);
+       }
        return r100_pci_gart_enable(rdev);
 }
 
index 96303f064db7c7691cc22e01c0fddacb1773f00c..551d6996d3f2c20a40afb642f2aae16c0ec8751a 100644 (file)
@@ -101,8 +101,13 @@ int r420_mc_init(struct radeon_device *rdev)
 
 void r420_mc_fini(struct radeon_device *rdev)
 {
-       rv370_pcie_gart_disable(rdev);
-       radeon_gart_table_vram_free(rdev);
+       if (rdev->flags & RADEON_IS_PCIE) {
+               rv370_pcie_gart_disable(rdev);
+               radeon_gart_table_vram_free(rdev);
+       } else {
+               r100_pci_gart_disable(rdev);
+               radeon_gart_table_ram_free(rdev);
+       }
        radeon_gart_fini(rdev);
 }
 
index fa84c77577ab91bd0bae00e12d16e6520182a35c..d6ff4e012063cb61c7f0d747bc6cfa8899a089b9 100644 (file)
@@ -935,6 +935,10 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v)
 
 /* r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 */
 void r100_cp_disable(struct radeon_device *rdev);
+void r100_pci_gart_tlb_flush(struct radeon_device *rdev);
+int r100_pci_gart_enable(struct radeon_device *rdev);
+void r100_pci_gart_disable(struct radeon_device *rdev);
+int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
 
 /* r420,r423,rv410 */
 u32 r420_mc_rreg(struct radeon_device *rdev, u32 reg);
index 05e1af0156c88e3a49b880ea2d7bd2104bd6ab58..bf6939497e15bcc5ed42328b5f9e97b9f5a3f959 100644 (file)
@@ -503,7 +503,7 @@ int radeon_device_init(struct radeon_device *rdev,
 
        if (radeon_agpmode == -1) {
                rdev->flags &= ~RADEON_IS_AGP;
-               if (rdev->family > CHIP_RV515 ||
+               if (rdev->family >= CHIP_RV515 ||
                    rdev->family == CHIP_RV380 ||
                    rdev->family == CHIP_RV410 ||
                    rdev->family == CHIP_R423) {