drm/radeon: move radeon_ib_ring_tests out of chipset code
authorChristian König <deathsimple@vodafone.de>
Sat, 7 Jul 2012 10:47:58 +0000 (12:47 +0200)
committerChristian König <deathsimple@vodafone.de>
Tue, 17 Jul 2012 08:33:01 +0000 (10:33 +0200)
Making it easier to control when it is executed.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
14 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_device.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 82f7aea14a6eca3f52f85b81e8c9334a20e5e1f5..f39b900d46f913e7cda5883398c2db187f0d8833 100644 (file)
@@ -3093,10 +3093,6 @@ static int evergreen_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_ring_tests(rdev);
-       if (r)
-               return r;
-
        r = r600_audio_init(rdev);
        if (r) {
                DRM_ERROR("radeon: audio init failed\n");
index ec5307c582f4f46ad510e660837e917f6c9dca3e..f2afefb44b7cd86581438a8ce786e7a2197bb2c5 100644 (file)
@@ -1276,10 +1276,6 @@ static int cayman_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_ring_tests(rdev);
-       if (r)
-               return r;
-
        r = radeon_vm_manager_init(rdev);
        if (r) {
                dev_err(rdev->dev, "vm manager initialization failed (%d).\n", r);
index 9524bd4aca755789ab01bb65079023dbb35fcb85..e0f5ae895f0743142ae8cf47294fa0b30df8b027 100644 (file)
@@ -3887,10 +3887,6 @@ static int r100_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_ring_tests(rdev);
-       if (r)
-               return r;
-
        return 0;
 }
 
index b396e341a7b82d9722f93d4e5cf9c8c999669086..646a1927dda7dc50ccb6e117b6a7a1a823522d45 100644 (file)
@@ -1397,10 +1397,6 @@ static int r300_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_ring_tests(rdev);
-       if (r)
-               return r;
-
        return 0;
 }
 
index 0062938a589cfe7537b01470ca3814ee328a290b..f2f5bf6d339fc729bbfffab2c4dd3118f6742fb2 100644 (file)
@@ -281,10 +281,6 @@ static int r420_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_ring_tests(rdev);
-       if (r)
-               return r;
-
        return 0;
 }
 
index 6df3e51acb9fff71098242bdbd5bfbd888d3f7b6..079d3c52c08a586222d1144abcbf5d1bdc14660e 100644 (file)
@@ -209,10 +209,6 @@ static int r520_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_ring_tests(rdev);
-       if (r)
-               return r;
-
        return 0;
 }
 
index af2f74a27081fc58fa3177f2f295a48d795c7b12..c808fa976d2d9972f647a7164e53867e5ae92fe4 100644 (file)
@@ -2395,10 +2395,6 @@ int r600_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_ring_tests(rdev);
-       if (r)
-               return r;
-
        r = r600_audio_init(rdev);
        if (r) {
                DRM_ERROR("radeon: audio init failed\n");
index 254fdb4f73c96a2b233a3b4c2a55837314f83bfb..bbd09718e9568e6df253807e2e343e7039b7d588 100644 (file)
@@ -822,6 +822,10 @@ int radeon_device_init(struct radeon_device *rdev,
        if (r)
                return r;
 
+       r = radeon_ib_ring_tests(rdev);
+       if (r)
+               DRM_ERROR("ib ring test failed (%d).\n", r);
+
        if (rdev->flags & RADEON_IS_AGP && !rdev->accel_working) {
                /* Acceleration not working on AGP card try again
                 * with fallback to PCI or PCIE GART
@@ -946,6 +950,7 @@ int radeon_resume_kms(struct drm_device *dev)
 {
        struct drm_connector *connector;
        struct radeon_device *rdev = dev->dev_private;
+       int r;
 
        if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
                return 0;
@@ -960,6 +965,11 @@ int radeon_resume_kms(struct drm_device *dev)
        /* resume AGP if in use */
        radeon_agp_resume(rdev);
        radeon_resume(rdev);
+
+       r = radeon_ib_ring_tests(rdev);
+       if (r)
+               DRM_ERROR("ib ring test failed (%d).\n", r);
+
        radeon_pm_resume(rdev);
        radeon_restore_bios_scratch_regs(rdev);
 
@@ -999,6 +1009,11 @@ int radeon_gpu_reset(struct radeon_device *rdev)
        if (!r) {
                dev_info(rdev->dev, "GPU reset succeed\n");
                radeon_resume(rdev);
+
+               r = radeon_ib_ring_tests(rdev);
+               if (r)
+                       DRM_ERROR("ib ring test failed (%d).\n", r);
+
                radeon_restore_bios_scratch_regs(rdev);
                drm_helper_resume_force_mode(rdev->ddev);
                ttm_bo_unlock_delayed_workqueue(&rdev->mman.bdev, resched);
index aa26076ff468f395ca1ad47d4765425d68c9b15b..2752f7f7823779facdf687e774badd0b72bb44da 100644 (file)
@@ -432,10 +432,6 @@ static int rs400_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_ring_tests(rdev);
-       if (r)
-               return r;
-
        return 0;
 }
 
index 6dad4e6177274ab2196e731e9131f62f658b10e2..5301b3df8466124460b9fd8e596fde1065feaa30 100644 (file)
@@ -913,10 +913,6 @@ static int rs600_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_ring_tests(rdev);
-       if (r)
-               return r;
-
        r = r600_audio_init(rdev);
        if (r) {
                dev_err(rdev->dev, "failed initializing audio\n");
index 0c026b0210d4346b8f54d8c8416db7b0b4ca5a51..3b663fcfe061a33459f82df8d6cb62f075bc7b37 100644 (file)
@@ -643,10 +643,6 @@ static int rs690_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_ring_tests(rdev);
-       if (r)
-               return r;
-
        r = r600_audio_init(rdev);
        if (r) {
                dev_err(rdev->dev, "failed initializing audio\n");
index 01e9155541eac8611e2e5b610910584fa5f18047..a12fbcc8ccb6834a9fba7b0d5cb08418538b52e9 100644 (file)
@@ -414,10 +414,6 @@ static int rv515_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_ring_tests(rdev);
-       if (r)
-               return r;
-
        return 0;
 }
 
index 2004f0d94f247b69d846232a94ed8299e494ad4b..b4b1256fb15b44f8b10e1f040a67eed7f1910c43 100644 (file)
@@ -957,10 +957,6 @@ static int rv770_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_ring_tests(rdev);
-       if (r)
-               return r;
-
        r = r600_audio_init(rdev);
        if (r) {
                DRM_ERROR("radeon: audio init failed\n");
index 2b691abef4f7d79302e527a9e37bf21142e87475..f61b550f9efdd52676f4083ec81ce91553d7b7f3 100644 (file)
@@ -3756,27 +3756,6 @@ static int si_startup(struct radeon_device *rdev)
                return r;
        }
 
-       r = radeon_ib_test(rdev, RADEON_RING_TYPE_GFX_INDEX, &rdev->ring[RADEON_RING_TYPE_GFX_INDEX]);
-       if (r) {
-               DRM_ERROR("radeon: failed testing IB (%d) on CP ring 0\n", r);
-               rdev->accel_working = false;
-               return r;
-       }
-
-       r = radeon_ib_test(rdev, CAYMAN_RING_TYPE_CP1_INDEX, &rdev->ring[CAYMAN_RING_TYPE_CP1_INDEX]);
-       if (r) {
-               DRM_ERROR("radeon: failed testing IB (%d) on CP ring 1\n", r);
-               rdev->accel_working = false;
-               return r;
-       }
-
-       r = radeon_ib_test(rdev, CAYMAN_RING_TYPE_CP2_INDEX, &rdev->ring[CAYMAN_RING_TYPE_CP2_INDEX]);
-       if (r) {
-               DRM_ERROR("radeon: failed testing IB (%d) on CP ring 2\n", r);
-               rdev->accel_working = false;
-               return r;
-       }
-
        r = radeon_vm_manager_init(rdev);
        if (r) {
                dev_err(rdev->dev, "vm manager initialization failed (%d).\n", r);