drm/radeon/kms: Fix R600/RV770 disable acceleration path
authorJerome Glisse <jglisse@redhat.com>
Thu, 1 Oct 2009 16:02:14 +0000 (18:02 +0200)
committerDave Airlie <airlied@redhat.com>
Thu, 1 Oct 2009 23:34:09 +0000 (09:34 +1000)
When acceleration doesn't work we should free associated memory
and stop GPU block responsible for hardware acceleration so we
don't waste resource or let think one component of the driver that
a GPU feature is working/running while it doesn't actualy work.

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

index cf4be70c5041c180e7d6b03d38015a02647e07d2..e74e7a748b31fd9b7939cb0d14b2695abe623e9c 100644 (file)
@@ -1605,6 +1605,11 @@ int r600_init(struct radeon_device *rdev)
                        rdev->flags &= ~RADEON_IS_AGP;
                        return r600_init(rdev);
                }
+               r600_suspend(rdev);
+               r600_wb_fini(rdev);
+               radeon_ib_pool_fini(rdev);
+               radeon_ring_fini(rdev);
+               r600_pcie_gart_fini(rdev);
                rdev->accel_working = false;
        }
        if (rdev->accel_working) {
index a06e7497d49ea82e57ee514c7408b7f647a3e444..a04e6ee459473ca3e5f974e0a114137d6bcf5bd0 100644 (file)
@@ -968,6 +968,11 @@ int rv770_init(struct radeon_device *rdev)
                        rdev->flags &= ~RADEON_IS_AGP;
                        return rv770_init(rdev);
                }
+               rv770_suspend(rdev);
+               r600_wb_fini(rdev);
+               radeon_ib_pool_fini(rdev);
+               radeon_ring_fini(rdev);
+               rv770_pcie_gart_fini(rdev);
                rdev->accel_working = false;
        }
        if (rdev->accel_working) {