]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
drm/radeon/kms: Make sure we release AGP device if we acquired it
authorJerome Glisse <jglisse@redhat.com>
Thu, 7 Jan 2010 15:08:32 +0000 (16:08 +0100)
committerDave Airlie <airlied@redhat.com>
Fri, 8 Jan 2010 03:10:13 +0000 (13:10 +1000)
In some case we weren't releasing the AGP device at module unloading.
This leaded to unfunctional AGP at next module load. This patch make
sure we release the AGP bus if we acquire it.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/r100.c
drivers/gpu/drm/radeon/r300.c
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/radeon_agp.c
drivers/gpu/drm/radeon/rv770.c

index 1a056b774eecb3d3af5525899198c313cd3adb78..d2b789e67c39cea23eb3324698da058bf98d23b1 100644 (file)
@@ -3369,6 +3369,7 @@ void r100_fini(struct radeon_device *rdev)
        radeon_gem_fini(rdev);
        if (rdev->flags & RADEON_IS_PCI)
                r100_pci_gart_fini(rdev);
+       radeon_agp_fini(rdev);
        radeon_irq_kms_fini(rdev);
        radeon_fence_driver_fini(rdev);
        radeon_bo_fini(rdev);
index b8623b734a27e6489419883eb92924f434432bca..0051d11b907c162e011e8ed7795507f4ca0e610f 100644 (file)
@@ -1336,6 +1336,7 @@ void r300_fini(struct radeon_device *rdev)
                rv370_pcie_gart_fini(rdev);
        if (rdev->flags & RADEON_IS_PCI)
                r100_pci_gart_fini(rdev);
+       radeon_agp_fini(rdev);
        radeon_irq_kms_fini(rdev);
        radeon_fence_driver_fini(rdev);
        radeon_bo_fini(rdev);
index e2f43c184aa9def8fdce58235b685e8150bed9c0..0c065f425c845e16d76d033d41673050b75c5504 100644 (file)
@@ -2090,8 +2090,7 @@ void r600_fini(struct radeon_device *rdev)
        radeon_gem_fini(rdev);
        radeon_fence_driver_fini(rdev);
        radeon_clocks_fini(rdev);
-       if (rdev->flags & RADEON_IS_AGP)
-               radeon_agp_fini(rdev);
+       radeon_agp_fini(rdev);
        radeon_bo_fini(rdev);
        radeon_atombios_fini(rdev);
        kfree(rdev->bios);
index 54bf49a6d676b6a53c1e301ec5db855d2cf7f4fb..220f454ea9fae8b11a04aa813da2f960ef47b352 100644 (file)
@@ -252,10 +252,8 @@ void radeon_agp_resume(struct radeon_device *rdev)
 void radeon_agp_fini(struct radeon_device *rdev)
 {
 #if __OS_HAS_AGP
-       if (rdev->flags & RADEON_IS_AGP) {
-               if (rdev->ddev->agp && rdev->ddev->agp->acquired) {
-                       drm_agp_release(rdev->ddev);
-               }
+       if (rdev->ddev->agp && rdev->ddev->agp->acquired) {
+               drm_agp_release(rdev->ddev);
        }
 #endif
 }
index f58dc671080232e1fb7dc7224e1c62ca29d5e072..16f7317fa1af8877a2309f826cf8659b00a88393 100644 (file)
@@ -1096,8 +1096,7 @@ void rv770_fini(struct radeon_device *rdev)
        radeon_gem_fini(rdev);
        radeon_fence_driver_fini(rdev);
        radeon_clocks_fini(rdev);
-       if (rdev->flags & RADEON_IS_AGP)
-               radeon_agp_fini(rdev);
+       radeon_agp_fini(rdev);
        radeon_bo_fini(rdev);
        radeon_atombios_fini(rdev);
        kfree(rdev->bios);