drm/radeon: remove ip_pool start/suspend
authorChristian König <deathsimple@vodafone.de>
Thu, 5 Jul 2012 09:55:34 +0000 (11:55 +0200)
committerChristian König <deathsimple@vodafone.de>
Tue, 17 Jul 2012 08:32:41 +0000 (10:32 +0200)
The IB pool is in gart memory, so it is completely
superfluous to unpin / repin it on suspend / resume.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
16 files changed:
drivers/gpu/drm/radeon/evergreen.c
drivers/gpu/drm/radeon/ni.c
drivers/gpu/drm/radeon/r100.c
drivers/gpu/drm/radeon/r300.c
drivers/gpu/drm/radeon/r420.c
drivers/gpu/drm/radeon/r520.c
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_asic.h
drivers/gpu/drm/radeon/radeon_ring.c
drivers/gpu/drm/radeon/rs400.c
drivers/gpu/drm/radeon/rs600.c
drivers/gpu/drm/radeon/rs690.c
drivers/gpu/drm/radeon/rv515.c
drivers/gpu/drm/radeon/rv770.c
drivers/gpu/drm/radeon/si.c

index eb9a71a..64e06e6 100644 (file)
@@ -3087,9 +3087,11 @@ static int evergreen_startup(struct radeon_device *rdev)
        if (r)
                return r;
 
-       r = radeon_ib_pool_start(rdev);
-       if (r)
+       r = radeon_ib_pool_init(rdev);
+       if (r) {
+               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
                return r;
+       }
 
        r = radeon_ib_ring_tests(rdev);
        if (r)
@@ -3137,7 +3139,6 @@ int evergreen_suspend(struct radeon_device *rdev)
        struct radeon_ring *ring = &rdev->ring[RADEON_RING_TYPE_GFX_INDEX];
 
        r600_audio_fini(rdev);
-       radeon_ib_pool_suspend(rdev);
        r600_blit_suspend(rdev);
        r700_cp_stop(rdev);
        ring->ready = false;
@@ -3224,20 +3225,14 @@ int evergreen_init(struct radeon_device *rdev)
        if (r)
                return r;
 
-       r = radeon_ib_pool_init(rdev);
        rdev->accel_working = true;
-       if (r) {
-               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
-               rdev->accel_working = false;
-       }
-
        r = evergreen_startup(rdev);
        if (r) {
                dev_err(rdev->dev, "disabling GPU acceleration\n");
                r700_cp_fini(rdev);
                r600_irq_fini(rdev);
                radeon_wb_fini(rdev);
-               r100_ib_fini(rdev);
+               radeon_ib_pool_fini(rdev);
                radeon_irq_kms_fini(rdev);
                evergreen_pcie_gart_fini(rdev);
                rdev->accel_working = false;
@@ -3264,7 +3259,7 @@ void evergreen_fini(struct radeon_device *rdev)
        r700_cp_fini(rdev);
        r600_irq_fini(rdev);
        radeon_wb_fini(rdev);
-       r100_ib_fini(rdev);
+       radeon_ib_pool_fini(rdev);
        radeon_irq_kms_fini(rdev);
        evergreen_pcie_gart_fini(rdev);
        r600_vram_scratch_fini(rdev);
index 8b1df33..fe55310 100644 (file)
@@ -1270,9 +1270,11 @@ static int cayman_startup(struct radeon_device *rdev)
        if (r)
                return r;
 
-       r = radeon_ib_pool_start(rdev);
-       if (r)
+       r = radeon_ib_pool_init(rdev);
+       if (r) {
+               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
                return r;
+       }
 
        r = radeon_ib_ring_tests(rdev);
        if (r)
@@ -1313,7 +1315,6 @@ int cayman_resume(struct radeon_device *rdev)
 int cayman_suspend(struct radeon_device *rdev)
 {
        r600_audio_fini(rdev);
-       radeon_ib_pool_suspend(rdev);
        radeon_vm_manager_suspend(rdev);
        r600_blit_suspend(rdev);
        cayman_cp_enable(rdev, false);
@@ -1391,12 +1392,7 @@ int cayman_init(struct radeon_device *rdev)
        if (r)
                return r;
 
-       r = radeon_ib_pool_init(rdev);
        rdev->accel_working = true;
-       if (r) {
-               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
-               rdev->accel_working = false;
-       }
        r = radeon_vm_manager_init(rdev);
        if (r) {
                dev_err(rdev->dev, "vm manager initialization failed (%d).\n", r);
@@ -1410,7 +1406,7 @@ int cayman_init(struct radeon_device *rdev)
                if (rdev->flags & RADEON_IS_IGP)
                        si_rlc_fini(rdev);
                radeon_wb_fini(rdev);
-               r100_ib_fini(rdev);
+               radeon_ib_pool_fini(rdev);
                radeon_vm_manager_fini(rdev);
                radeon_irq_kms_fini(rdev);
                cayman_pcie_gart_fini(rdev);
@@ -1441,7 +1437,7 @@ void cayman_fini(struct radeon_device *rdev)
                si_rlc_fini(rdev);
        radeon_wb_fini(rdev);
        radeon_vm_manager_fini(rdev);
-       r100_ib_fini(rdev);
+       radeon_ib_pool_fini(rdev);
        radeon_irq_kms_fini(rdev);
        cayman_pcie_gart_fini(rdev);
        r600_vram_scratch_fini(rdev);
index d06c8dd..9524bd4 100644 (file)
@@ -3722,12 +3722,6 @@ int r100_ib_test(struct radeon_device *rdev, struct radeon_ring *ring)
        return r;
 }
 
-void r100_ib_fini(struct radeon_device *rdev)
-{
-       radeon_ib_pool_suspend(rdev);
-       radeon_ib_pool_fini(rdev);
-}
-
 void r100_mc_stop(struct radeon_device *rdev, struct r100_mc_save *save)
 {
        /* Shutdown CP we shouldn't need to do that but better be safe than
@@ -3887,9 +3881,11 @@ static int r100_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_pool_start(rdev);
-       if (r)
+       r = radeon_ib_pool_init(rdev);
+       if (r) {
+               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
                return r;
+       }
 
        r = radeon_ib_ring_tests(rdev);
        if (r)
@@ -3930,7 +3926,6 @@ int r100_resume(struct radeon_device *rdev)
 
 int r100_suspend(struct radeon_device *rdev)
 {
-       radeon_ib_pool_suspend(rdev);
        r100_cp_disable(rdev);
        radeon_wb_disable(rdev);
        r100_irq_disable(rdev);
@@ -3943,7 +3938,7 @@ void r100_fini(struct radeon_device *rdev)
 {
        r100_cp_fini(rdev);
        radeon_wb_fini(rdev);
-       r100_ib_fini(rdev);
+       radeon_ib_pool_fini(rdev);
        radeon_gem_fini(rdev);
        if (rdev->flags & RADEON_IS_PCI)
                r100_pci_gart_fini(rdev);
@@ -4050,20 +4045,14 @@ int r100_init(struct radeon_device *rdev)
        }
        r100_set_safe_registers(rdev);
 
-       r = radeon_ib_pool_init(rdev);
        rdev->accel_working = true;
-       if (r) {
-               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
-               rdev->accel_working = false;
-       }
-
        r = r100_startup(rdev);
        if (r) {
                /* Somethings want wront with the accel init stop accel */
                dev_err(rdev->dev, "Disabling GPU acceleration\n");
                r100_cp_fini(rdev);
                radeon_wb_fini(rdev);
-               r100_ib_fini(rdev);
+               radeon_ib_pool_fini(rdev);
                radeon_irq_kms_fini(rdev);
                if (rdev->flags & RADEON_IS_PCI)
                        r100_pci_gart_fini(rdev);
index 97722a3..b396e34 100644 (file)
@@ -1391,9 +1391,11 @@ static int r300_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_pool_start(rdev);
-       if (r)
+       r = radeon_ib_pool_init(rdev);
+       if (r) {
+               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
                return r;
+       }
 
        r = radeon_ib_ring_tests(rdev);
        if (r)
@@ -1436,7 +1438,6 @@ int r300_resume(struct radeon_device *rdev)
 
 int r300_suspend(struct radeon_device *rdev)
 {
-       radeon_ib_pool_suspend(rdev);
        r100_cp_disable(rdev);
        radeon_wb_disable(rdev);
        r100_irq_disable(rdev);
@@ -1451,7 +1452,7 @@ void r300_fini(struct radeon_device *rdev)
 {
        r100_cp_fini(rdev);
        radeon_wb_fini(rdev);
-       r100_ib_fini(rdev);
+       radeon_ib_pool_fini(rdev);
        radeon_gem_fini(rdev);
        if (rdev->flags & RADEON_IS_PCIE)
                rv370_pcie_gart_fini(rdev);
@@ -1538,20 +1539,14 @@ int r300_init(struct radeon_device *rdev)
        }
        r300_set_reg_safe(rdev);
 
-       r = radeon_ib_pool_init(rdev);
        rdev->accel_working = true;
-       if (r) {
-               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
-               rdev->accel_working = false;
-       }
-
        r = r300_startup(rdev);
        if (r) {
                /* Somethings want wront with the accel init stop accel */
                dev_err(rdev->dev, "Disabling GPU acceleration\n");
                r100_cp_fini(rdev);
                radeon_wb_fini(rdev);
-               r100_ib_fini(rdev);
+               radeon_ib_pool_fini(rdev);
                radeon_irq_kms_fini(rdev);
                if (rdev->flags & RADEON_IS_PCIE)
                        rv370_pcie_gart_fini(rdev);
index 99137be..0062938 100644 (file)
@@ -275,9 +275,11 @@ static int r420_startup(struct radeon_device *rdev)
        }
        r420_cp_errata_init(rdev);
 
-       r = radeon_ib_pool_start(rdev);
-       if (r)
+       r = radeon_ib_pool_init(rdev);
+       if (r) {
+               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
                return r;
+       }
 
        r = radeon_ib_ring_tests(rdev);
        if (r)
@@ -324,7 +326,6 @@ int r420_resume(struct radeon_device *rdev)
 
 int r420_suspend(struct radeon_device *rdev)
 {
-       radeon_ib_pool_suspend(rdev);
        r420_cp_errata_fini(rdev);
        r100_cp_disable(rdev);
        radeon_wb_disable(rdev);
@@ -340,7 +341,7 @@ void r420_fini(struct radeon_device *rdev)
 {
        r100_cp_fini(rdev);
        radeon_wb_fini(rdev);
-       r100_ib_fini(rdev);
+       radeon_ib_pool_fini(rdev);
        radeon_gem_fini(rdev);
        if (rdev->flags & RADEON_IS_PCIE)
                rv370_pcie_gart_fini(rdev);
@@ -438,20 +439,14 @@ int r420_init(struct radeon_device *rdev)
        }
        r420_set_reg_safe(rdev);
 
-       r = radeon_ib_pool_init(rdev);
        rdev->accel_working = true;
-       if (r) {
-               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
-               rdev->accel_working = false;
-       }
-
        r = r420_startup(rdev);
        if (r) {
                /* Somethings want wront with the accel init stop accel */
                dev_err(rdev->dev, "Disabling GPU acceleration\n");
                r100_cp_fini(rdev);
                radeon_wb_fini(rdev);
-               r100_ib_fini(rdev);
+               radeon_ib_pool_fini(rdev);
                radeon_irq_kms_fini(rdev);
                if (rdev->flags & RADEON_IS_PCIE)
                        rv370_pcie_gart_fini(rdev);
index b5cf837..6df3e51 100644 (file)
@@ -203,9 +203,11 @@ static int r520_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_pool_start(rdev);
-       if (r)
+       r = radeon_ib_pool_init(rdev);
+       if (r) {
+               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
                return r;
+       }
 
        r = radeon_ib_ring_tests(rdev);
        if (r)
@@ -311,20 +313,14 @@ int r520_init(struct radeon_device *rdev)
                return r;
        rv515_set_safe_registers(rdev);
 
-       r = radeon_ib_pool_init(rdev);
        rdev->accel_working = true;
-       if (r) {
-               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
-               rdev->accel_working = false;
-       }
-
        r = r520_startup(rdev);
        if (r) {
                /* Somethings want wront with the accel init stop accel */
                dev_err(rdev->dev, "Disabling GPU acceleration\n");
                r100_cp_fini(rdev);
                radeon_wb_fini(rdev);
-               r100_ib_fini(rdev);
+               radeon_ib_pool_fini(rdev);
                radeon_irq_kms_fini(rdev);
                rv370_pcie_gart_fini(rdev);
                radeon_agp_fini(rdev);
index de4de2d..9750f53 100644 (file)
@@ -2403,9 +2403,11 @@ int r600_startup(struct radeon_device *rdev)
        if (r)
                return r;
 
-       r = radeon_ib_pool_start(rdev);
-       if (r)
+       r = radeon_ib_pool_init(rdev);
+       if (r) {
+               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
                return r;
+       }
 
        r = radeon_ib_ring_tests(rdev);
        if (r)
@@ -2459,7 +2461,6 @@ int r600_resume(struct radeon_device *rdev)
 int r600_suspend(struct radeon_device *rdev)
 {
        r600_audio_fini(rdev);
-       radeon_ib_pool_suspend(rdev);
        r600_blit_suspend(rdev);
        r600_cp_stop(rdev);
        rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ready = false;
@@ -2542,20 +2543,14 @@ int r600_init(struct radeon_device *rdev)
        if (r)
                return r;
 
-       r = radeon_ib_pool_init(rdev);
        rdev->accel_working = true;
-       if (r) {
-               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
-               rdev->accel_working = false;
-       }
-
        r = r600_startup(rdev);
        if (r) {
                dev_err(rdev->dev, "disabling GPU acceleration\n");
                r600_cp_fini(rdev);
                r600_irq_fini(rdev);
                radeon_wb_fini(rdev);
-               r100_ib_fini(rdev);
+               radeon_ib_pool_fini(rdev);
                radeon_irq_kms_fini(rdev);
                r600_pcie_gart_fini(rdev);
                rdev->accel_working = false;
@@ -2571,7 +2566,7 @@ void r600_fini(struct radeon_device *rdev)
        r600_cp_fini(rdev);
        r600_irq_fini(rdev);
        radeon_wb_fini(rdev);
-       r100_ib_fini(rdev);
+       radeon_ib_pool_fini(rdev);
        radeon_irq_kms_fini(rdev);
        r600_pcie_gart_fini(rdev);
        r600_vram_scratch_fini(rdev);
index 4487873..7df76b9 100644 (file)
@@ -755,8 +755,6 @@ void radeon_ib_free(struct radeon_device *rdev, struct radeon_ib *ib);
 int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib);
 int radeon_ib_pool_init(struct radeon_device *rdev);
 void radeon_ib_pool_fini(struct radeon_device *rdev);
-int radeon_ib_pool_start(struct radeon_device *rdev);
-int radeon_ib_pool_suspend(struct radeon_device *rdev);
 int radeon_ib_ring_tests(struct radeon_device *rdev);
 /* Ring access between begin & end cannot sleep */
 int radeon_ring_index(struct radeon_device *rdev, struct radeon_ring *cp);
index 94c427a..f4af243 100644 (file)
@@ -103,7 +103,6 @@ int r100_pci_gart_enable(struct radeon_device *rdev);
 void r100_pci_gart_disable(struct radeon_device *rdev);
 int r100_debugfs_mc_info_init(struct radeon_device *rdev);
 int r100_gui_wait_for_idle(struct radeon_device *rdev);
-void r100_ib_fini(struct radeon_device *rdev);
 int r100_ib_test(struct radeon_device *rdev, struct radeon_ring *ring);
 void r100_irq_disable(struct radeon_device *rdev);
 void r100_mc_stop(struct radeon_device *rdev, struct r100_mc_save *save);
index 674aaba..0873834 100644 (file)
@@ -129,6 +129,12 @@ int radeon_ib_pool_init(struct radeon_device *rdev)
        if (r) {
                return r;
        }
+
+       r = radeon_sa_bo_manager_start(rdev, &rdev->ring_tmp_bo);
+       if (r) {
+               return r;
+       }
+
        rdev->ib_pool_ready = true;
        if (radeon_debugfs_sa_init(rdev)) {
                dev_err(rdev->dev, "failed to register debugfs file for SA\n");
@@ -139,21 +145,12 @@ int radeon_ib_pool_init(struct radeon_device *rdev)
 void radeon_ib_pool_fini(struct radeon_device *rdev)
 {
        if (rdev->ib_pool_ready) {
+               radeon_sa_bo_manager_suspend(rdev, &rdev->ring_tmp_bo);
                radeon_sa_bo_manager_fini(rdev, &rdev->ring_tmp_bo);
                rdev->ib_pool_ready = false;
        }
 }
 
-int radeon_ib_pool_start(struct radeon_device *rdev)
-{
-       return radeon_sa_bo_manager_start(rdev, &rdev->ring_tmp_bo);
-}
-
-int radeon_ib_pool_suspend(struct radeon_device *rdev)
-{
-       return radeon_sa_bo_manager_suspend(rdev, &rdev->ring_tmp_bo);
-}
-
 int radeon_ib_ring_tests(struct radeon_device *rdev)
 {
        unsigned i;
index a464eb5..aa26076 100644 (file)
@@ -426,9 +426,11 @@ static int rs400_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_pool_start(rdev);
-       if (r)
+       r = radeon_ib_pool_init(rdev);
+       if (r) {
+               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
                return r;
+       }
 
        r = radeon_ib_ring_tests(rdev);
        if (r)
@@ -470,7 +472,6 @@ int rs400_resume(struct radeon_device *rdev)
 
 int rs400_suspend(struct radeon_device *rdev)
 {
-       radeon_ib_pool_suspend(rdev);
        r100_cp_disable(rdev);
        radeon_wb_disable(rdev);
        r100_irq_disable(rdev);
@@ -482,7 +483,7 @@ void rs400_fini(struct radeon_device *rdev)
 {
        r100_cp_fini(rdev);
        radeon_wb_fini(rdev);
-       r100_ib_fini(rdev);
+       radeon_ib_pool_fini(rdev);
        radeon_gem_fini(rdev);
        rs400_gart_fini(rdev);
        radeon_irq_kms_fini(rdev);
@@ -550,20 +551,14 @@ int rs400_init(struct radeon_device *rdev)
                return r;
        r300_set_reg_safe(rdev);
 
-       r = radeon_ib_pool_init(rdev);
        rdev->accel_working = true;
-       if (r) {
-               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
-               rdev->accel_working = false;
-       }
-
        r = rs400_startup(rdev);
        if (r) {
                /* Somethings want wront with the accel init stop accel */
                dev_err(rdev->dev, "Disabling GPU acceleration\n");
                r100_cp_fini(rdev);
                radeon_wb_fini(rdev);
-               r100_ib_fini(rdev);
+               radeon_ib_pool_fini(rdev);
                rs400_gart_fini(rdev);
                radeon_irq_kms_fini(rdev);
                rdev->accel_working = false;
index e11bc46..6dad4e6 100644 (file)
@@ -907,9 +907,11 @@ static int rs600_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_pool_start(rdev);
-       if (r)
+       r = radeon_ib_pool_init(rdev);
+       if (r) {
+               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
                return r;
+       }
 
        r = radeon_ib_ring_tests(rdev);
        if (r)
@@ -955,7 +957,6 @@ int rs600_resume(struct radeon_device *rdev)
 
 int rs600_suspend(struct radeon_device *rdev)
 {
-       radeon_ib_pool_suspend(rdev);
        r600_audio_fini(rdev);
        r100_cp_disable(rdev);
        radeon_wb_disable(rdev);
@@ -969,7 +970,7 @@ void rs600_fini(struct radeon_device *rdev)
        r600_audio_fini(rdev);
        r100_cp_fini(rdev);
        radeon_wb_fini(rdev);
-       r100_ib_fini(rdev);
+       radeon_ib_pool_fini(rdev);
        radeon_gem_fini(rdev);
        rs600_gart_fini(rdev);
        radeon_irq_kms_fini(rdev);
@@ -1037,20 +1038,14 @@ int rs600_init(struct radeon_device *rdev)
                return r;
        rs600_set_safe_registers(rdev);
 
-       r = radeon_ib_pool_init(rdev);
        rdev->accel_working = true;
-       if (r) {
-               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
-               rdev->accel_working = false;
-       }
-
        r = rs600_startup(rdev);
        if (r) {
                /* Somethings want wront with the accel init stop accel */
                dev_err(rdev->dev, "Disabling GPU acceleration\n");
                r100_cp_fini(rdev);
                radeon_wb_fini(rdev);
-               r100_ib_fini(rdev);
+               radeon_ib_pool_fini(rdev);
                rs600_gart_fini(rdev);
                radeon_irq_kms_fini(rdev);
                rdev->accel_working = false;
index 159b6a4..0c026b0 100644 (file)
@@ -637,9 +637,11 @@ static int rs690_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_pool_start(rdev);
-       if (r)
+       r = radeon_ib_pool_init(rdev);
+       if (r) {
+               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
                return r;
+       }
 
        r = radeon_ib_ring_tests(rdev);
        if (r)
@@ -685,7 +687,6 @@ int rs690_resume(struct radeon_device *rdev)
 
 int rs690_suspend(struct radeon_device *rdev)
 {
-       radeon_ib_pool_suspend(rdev);
        r600_audio_fini(rdev);
        r100_cp_disable(rdev);
        radeon_wb_disable(rdev);
@@ -699,7 +700,7 @@ void rs690_fini(struct radeon_device *rdev)
        r600_audio_fini(rdev);
        r100_cp_fini(rdev);
        radeon_wb_fini(rdev);
-       r100_ib_fini(rdev);
+       radeon_ib_pool_fini(rdev);
        radeon_gem_fini(rdev);
        rs400_gart_fini(rdev);
        radeon_irq_kms_fini(rdev);
@@ -768,20 +769,14 @@ int rs690_init(struct radeon_device *rdev)
                return r;
        rs600_set_safe_registers(rdev);
 
-       r = radeon_ib_pool_init(rdev);
        rdev->accel_working = true;
-       if (r) {
-               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
-               rdev->accel_working = false;
-       }
-
        r = rs690_startup(rdev);
        if (r) {
                /* Somethings want wront with the accel init stop accel */
                dev_err(rdev->dev, "Disabling GPU acceleration\n");
                r100_cp_fini(rdev);
                radeon_wb_fini(rdev);
-               r100_ib_fini(rdev);
+               radeon_ib_pool_fini(rdev);
                rs400_gart_fini(rdev);
                radeon_irq_kms_fini(rdev);
                rdev->accel_working = false;
index 7f08ced..01e9155 100644 (file)
@@ -408,9 +408,11 @@ static int rv515_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_pool_start(rdev);
-       if (r)
+       r = radeon_ib_pool_init(rdev);
+       if (r) {
+               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
                return r;
+       }
 
        r = radeon_ib_ring_tests(rdev);
        if (r)
@@ -469,7 +471,7 @@ void rv515_fini(struct radeon_device *rdev)
 {
        r100_cp_fini(rdev);
        radeon_wb_fini(rdev);
-       r100_ib_fini(rdev);
+       radeon_ib_pool_fini(rdev);
        radeon_gem_fini(rdev);
        rv370_pcie_gart_fini(rdev);
        radeon_agp_fini(rdev);
@@ -543,20 +545,14 @@ int rv515_init(struct radeon_device *rdev)
                return r;
        rv515_set_safe_registers(rdev);
 
-       r = radeon_ib_pool_init(rdev);
        rdev->accel_working = true;
-       if (r) {
-               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
-               rdev->accel_working = false;
-       }
-
        r = rv515_startup(rdev);
        if (r) {
                /* Somethings want wront with the accel init stop accel */
                dev_err(rdev->dev, "Disabling GPU acceleration\n");
                r100_cp_fini(rdev);
                radeon_wb_fini(rdev);
-               r100_ib_fini(rdev);
+               radeon_ib_pool_fini(rdev);
                radeon_irq_kms_fini(rdev);
                rv370_pcie_gart_fini(rdev);
                radeon_agp_fini(rdev);
index 7e230f6..cc0ffb9 100644 (file)
@@ -951,9 +951,11 @@ static int rv770_startup(struct radeon_device *rdev)
        if (r)
                return r;
 
-       r = radeon_ib_pool_start(rdev);
-       if (r)
+       r = radeon_ib_pool_init(rdev);
+       if (r) {
+               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
                return r;
+       }
 
        r = radeon_ib_ring_tests(rdev);
        if (r)
@@ -994,7 +996,6 @@ int rv770_resume(struct radeon_device *rdev)
 int rv770_suspend(struct radeon_device *rdev)
 {
        r600_audio_fini(rdev);
-       radeon_ib_pool_suspend(rdev);
        r600_blit_suspend(rdev);
        r700_cp_stop(rdev);
        rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ready = false;
@@ -1075,20 +1076,14 @@ int rv770_init(struct radeon_device *rdev)
        if (r)
                return r;
 
-       r = radeon_ib_pool_init(rdev);
        rdev->accel_working = true;
-       if (r) {
-               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
-               rdev->accel_working = false;
-       }
-
        r = rv770_startup(rdev);
        if (r) {
                dev_err(rdev->dev, "disabling GPU acceleration\n");
                r700_cp_fini(rdev);
                r600_irq_fini(rdev);
                radeon_wb_fini(rdev);
-               r100_ib_fini(rdev);
+               radeon_ib_pool_fini(rdev);
                radeon_irq_kms_fini(rdev);
                rv770_pcie_gart_fini(rdev);
                rdev->accel_working = false;
@@ -1103,7 +1098,7 @@ void rv770_fini(struct radeon_device *rdev)
        r700_cp_fini(rdev);
        r600_irq_fini(rdev);
        radeon_wb_fini(rdev);
-       r100_ib_fini(rdev);
+       radeon_ib_pool_fini(rdev);
        radeon_irq_kms_fini(rdev);
        rv770_pcie_gart_fini(rdev);
        r600_vram_scratch_fini(rdev);
index 78c790f..40405d3 100644 (file)
@@ -3750,9 +3750,11 @@ static int si_startup(struct radeon_device *rdev)
        if (r)
                return r;
 
-       r = radeon_ib_pool_start(rdev);
-       if (r)
+       r = radeon_ib_pool_init(rdev);
+       if (r) {
+               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
                return r;
+       }
 
        r = radeon_ib_test(rdev, RADEON_RING_TYPE_GFX_INDEX, &rdev->ring[RADEON_RING_TYPE_GFX_INDEX]);
        if (r) {
@@ -3807,7 +3809,6 @@ int si_resume(struct radeon_device *rdev)
 
 int si_suspend(struct radeon_device *rdev)
 {
-       radeon_ib_pool_suspend(rdev);
        radeon_vm_manager_suspend(rdev);
 #if 0
        r600_blit_suspend(rdev);
@@ -3900,12 +3901,7 @@ int si_init(struct radeon_device *rdev)
        if (r)
                return r;
 
-       r = radeon_ib_pool_init(rdev);
        rdev->accel_working = true;
-       if (r) {
-               dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
-               rdev->accel_working = false;
-       }
        r = radeon_vm_manager_init(rdev);
        if (r) {
                dev_err(rdev->dev, "vm manager initialization failed (%d).\n", r);
@@ -3918,7 +3914,7 @@ int si_init(struct radeon_device *rdev)
                si_irq_fini(rdev);
                si_rlc_fini(rdev);
                radeon_wb_fini(rdev);
-               r100_ib_fini(rdev);
+               radeon_ib_pool_fini(rdev);
                radeon_vm_manager_fini(rdev);
                radeon_irq_kms_fini(rdev);
                si_pcie_gart_fini(rdev);
@@ -3947,7 +3943,7 @@ void si_fini(struct radeon_device *rdev)
        si_rlc_fini(rdev);
        radeon_wb_fini(rdev);
        radeon_vm_manager_fini(rdev);
-       r100_ib_fini(rdev);
+       radeon_ib_pool_fini(rdev);
        radeon_irq_kms_fini(rdev);
        si_pcie_gart_fini(rdev);
        r600_vram_scratch_fini(rdev);