diff options
author | Christian König <deathsimple@vodafone.de> | 2012-07-07 06:47:58 -0400 |
---|---|---|
committer | Christian König <deathsimple@vodafone.de> | 2012-07-17 04:33:01 -0400 |
commit | 04eb2206d8022dc4a1eadb5e9cc5122c84959881 (patch) | |
tree | 9ff53292fea4cd2161d1ebde8407b71dd2720285 /drivers/gpu | |
parent | c6105f249a637e1bb2b04b1cad7feaf507d06e8c (diff) |
drm/radeon: move radeon_ib_ring_tests out of chipset code
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/ni.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r100.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r300.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r420.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r520.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_device.c | 15 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/rs400.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/rs600.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/rs690.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/rv515.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/rv770.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/si.c | 21 |
14 files changed, 15 insertions, 69 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 82f7aea14a6e..f39b900d46f9 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -3093,10 +3093,6 @@ static int evergreen_startup(struct radeon_device *rdev) | |||
3093 | return r; | 3093 | return r; |
3094 | } | 3094 | } |
3095 | 3095 | ||
3096 | r = radeon_ib_ring_tests(rdev); | ||
3097 | if (r) | ||
3098 | return r; | ||
3099 | |||
3100 | r = r600_audio_init(rdev); | 3096 | r = r600_audio_init(rdev); |
3101 | if (r) { | 3097 | if (r) { |
3102 | DRM_ERROR("radeon: audio init failed\n"); | 3098 | DRM_ERROR("radeon: audio init failed\n"); |
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c index ec5307c582f4..f2afefb44b7c 100644 --- a/drivers/gpu/drm/radeon/ni.c +++ b/drivers/gpu/drm/radeon/ni.c | |||
@@ -1276,10 +1276,6 @@ static int cayman_startup(struct radeon_device *rdev) | |||
1276 | return r; | 1276 | return r; |
1277 | } | 1277 | } |
1278 | 1278 | ||
1279 | r = radeon_ib_ring_tests(rdev); | ||
1280 | if (r) | ||
1281 | return r; | ||
1282 | |||
1283 | r = radeon_vm_manager_init(rdev); | 1279 | r = radeon_vm_manager_init(rdev); |
1284 | if (r) { | 1280 | if (r) { |
1285 | dev_err(rdev->dev, "vm manager initialization failed (%d).\n", r); | 1281 | dev_err(rdev->dev, "vm manager initialization failed (%d).\n", r); |
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 9524bd4aca75..e0f5ae895f07 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
@@ -3887,10 +3887,6 @@ static int r100_startup(struct radeon_device *rdev) | |||
3887 | return r; | 3887 | return r; |
3888 | } | 3888 | } |
3889 | 3889 | ||
3890 | r = radeon_ib_ring_tests(rdev); | ||
3891 | if (r) | ||
3892 | return r; | ||
3893 | |||
3894 | return 0; | 3890 | return 0; |
3895 | } | 3891 | } |
3896 | 3892 | ||
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index b396e341a7b8..646a1927dda7 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c | |||
@@ -1397,10 +1397,6 @@ static int r300_startup(struct radeon_device *rdev) | |||
1397 | return r; | 1397 | return r; |
1398 | } | 1398 | } |
1399 | 1399 | ||
1400 | r = radeon_ib_ring_tests(rdev); | ||
1401 | if (r) | ||
1402 | return r; | ||
1403 | |||
1404 | return 0; | 1400 | return 0; |
1405 | } | 1401 | } |
1406 | 1402 | ||
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c index 0062938a589c..f2f5bf6d339f 100644 --- a/drivers/gpu/drm/radeon/r420.c +++ b/drivers/gpu/drm/radeon/r420.c | |||
@@ -281,10 +281,6 @@ static int r420_startup(struct radeon_device *rdev) | |||
281 | return r; | 281 | return r; |
282 | } | 282 | } |
283 | 283 | ||
284 | r = radeon_ib_ring_tests(rdev); | ||
285 | if (r) | ||
286 | return r; | ||
287 | |||
288 | return 0; | 284 | return 0; |
289 | } | 285 | } |
290 | 286 | ||
diff --git a/drivers/gpu/drm/radeon/r520.c b/drivers/gpu/drm/radeon/r520.c index 6df3e51acb9f..079d3c52c08a 100644 --- a/drivers/gpu/drm/radeon/r520.c +++ b/drivers/gpu/drm/radeon/r520.c | |||
@@ -209,10 +209,6 @@ static int r520_startup(struct radeon_device *rdev) | |||
209 | return r; | 209 | return r; |
210 | } | 210 | } |
211 | 211 | ||
212 | r = radeon_ib_ring_tests(rdev); | ||
213 | if (r) | ||
214 | return r; | ||
215 | |||
216 | return 0; | 212 | return 0; |
217 | } | 213 | } |
218 | 214 | ||
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index af2f74a27081..c808fa976d2d 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -2395,10 +2395,6 @@ int r600_startup(struct radeon_device *rdev) | |||
2395 | return r; | 2395 | return r; |
2396 | } | 2396 | } |
2397 | 2397 | ||
2398 | r = radeon_ib_ring_tests(rdev); | ||
2399 | if (r) | ||
2400 | return r; | ||
2401 | |||
2402 | r = r600_audio_init(rdev); | 2398 | r = r600_audio_init(rdev); |
2403 | if (r) { | 2399 | if (r) { |
2404 | DRM_ERROR("radeon: audio init failed\n"); | 2400 | DRM_ERROR("radeon: audio init failed\n"); |
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 254fdb4f73c9..bbd09718e956 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c | |||
@@ -822,6 +822,10 @@ int radeon_device_init(struct radeon_device *rdev, | |||
822 | if (r) | 822 | if (r) |
823 | return r; | 823 | return r; |
824 | 824 | ||
825 | r = radeon_ib_ring_tests(rdev); | ||
826 | if (r) | ||
827 | DRM_ERROR("ib ring test failed (%d).\n", r); | ||
828 | |||
825 | if (rdev->flags & RADEON_IS_AGP && !rdev->accel_working) { | 829 | if (rdev->flags & RADEON_IS_AGP && !rdev->accel_working) { |
826 | /* Acceleration not working on AGP card try again | 830 | /* Acceleration not working on AGP card try again |
827 | * with fallback to PCI or PCIE GART | 831 | * with fallback to PCI or PCIE GART |
@@ -946,6 +950,7 @@ int radeon_resume_kms(struct drm_device *dev) | |||
946 | { | 950 | { |
947 | struct drm_connector *connector; | 951 | struct drm_connector *connector; |
948 | struct radeon_device *rdev = dev->dev_private; | 952 | struct radeon_device *rdev = dev->dev_private; |
953 | int r; | ||
949 | 954 | ||
950 | if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) | 955 | if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) |
951 | return 0; | 956 | return 0; |
@@ -960,6 +965,11 @@ int radeon_resume_kms(struct drm_device *dev) | |||
960 | /* resume AGP if in use */ | 965 | /* resume AGP if in use */ |
961 | radeon_agp_resume(rdev); | 966 | radeon_agp_resume(rdev); |
962 | radeon_resume(rdev); | 967 | radeon_resume(rdev); |
968 | |||
969 | r = radeon_ib_ring_tests(rdev); | ||
970 | if (r) | ||
971 | DRM_ERROR("ib ring test failed (%d).\n", r); | ||
972 | |||
963 | radeon_pm_resume(rdev); | 973 | radeon_pm_resume(rdev); |
964 | radeon_restore_bios_scratch_regs(rdev); | 974 | radeon_restore_bios_scratch_regs(rdev); |
965 | 975 | ||
@@ -999,6 +1009,11 @@ int radeon_gpu_reset(struct radeon_device *rdev) | |||
999 | if (!r) { | 1009 | if (!r) { |
1000 | dev_info(rdev->dev, "GPU reset succeed\n"); | 1010 | dev_info(rdev->dev, "GPU reset succeed\n"); |
1001 | radeon_resume(rdev); | 1011 | radeon_resume(rdev); |
1012 | |||
1013 | r = radeon_ib_ring_tests(rdev); | ||
1014 | if (r) | ||
1015 | DRM_ERROR("ib ring test failed (%d).\n", r); | ||
1016 | |||
1002 | radeon_restore_bios_scratch_regs(rdev); | 1017 | radeon_restore_bios_scratch_regs(rdev); |
1003 | drm_helper_resume_force_mode(rdev->ddev); | 1018 | drm_helper_resume_force_mode(rdev->ddev); |
1004 | ttm_bo_unlock_delayed_workqueue(&rdev->mman.bdev, resched); | 1019 | ttm_bo_unlock_delayed_workqueue(&rdev->mman.bdev, resched); |
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c index aa26076ff468..2752f7f78237 100644 --- a/drivers/gpu/drm/radeon/rs400.c +++ b/drivers/gpu/drm/radeon/rs400.c | |||
@@ -432,10 +432,6 @@ static int rs400_startup(struct radeon_device *rdev) | |||
432 | return r; | 432 | return r; |
433 | } | 433 | } |
434 | 434 | ||
435 | r = radeon_ib_ring_tests(rdev); | ||
436 | if (r) | ||
437 | return r; | ||
438 | |||
439 | return 0; | 435 | return 0; |
440 | } | 436 | } |
441 | 437 | ||
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c index 6dad4e617727..5301b3df8466 100644 --- a/drivers/gpu/drm/radeon/rs600.c +++ b/drivers/gpu/drm/radeon/rs600.c | |||
@@ -913,10 +913,6 @@ static int rs600_startup(struct radeon_device *rdev) | |||
913 | return r; | 913 | return r; |
914 | } | 914 | } |
915 | 915 | ||
916 | r = radeon_ib_ring_tests(rdev); | ||
917 | if (r) | ||
918 | return r; | ||
919 | |||
920 | r = r600_audio_init(rdev); | 916 | r = r600_audio_init(rdev); |
921 | if (r) { | 917 | if (r) { |
922 | dev_err(rdev->dev, "failed initializing audio\n"); | 918 | dev_err(rdev->dev, "failed initializing audio\n"); |
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c index 0c026b0210d4..3b663fcfe061 100644 --- a/drivers/gpu/drm/radeon/rs690.c +++ b/drivers/gpu/drm/radeon/rs690.c | |||
@@ -643,10 +643,6 @@ static int rs690_startup(struct radeon_device *rdev) | |||
643 | return r; | 643 | return r; |
644 | } | 644 | } |
645 | 645 | ||
646 | r = radeon_ib_ring_tests(rdev); | ||
647 | if (r) | ||
648 | return r; | ||
649 | |||
650 | r = r600_audio_init(rdev); | 646 | r = r600_audio_init(rdev); |
651 | if (r) { | 647 | if (r) { |
652 | dev_err(rdev->dev, "failed initializing audio\n"); | 648 | dev_err(rdev->dev, "failed initializing audio\n"); |
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c index 01e9155541ea..a12fbcc8ccb6 100644 --- a/drivers/gpu/drm/radeon/rv515.c +++ b/drivers/gpu/drm/radeon/rv515.c | |||
@@ -414,10 +414,6 @@ static int rv515_startup(struct radeon_device *rdev) | |||
414 | return r; | 414 | return r; |
415 | } | 415 | } |
416 | 416 | ||
417 | r = radeon_ib_ring_tests(rdev); | ||
418 | if (r) | ||
419 | return r; | ||
420 | |||
421 | return 0; | 417 | return 0; |
422 | } | 418 | } |
423 | 419 | ||
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index 2004f0d94f24..b4b1256fb15b 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
@@ -957,10 +957,6 @@ static int rv770_startup(struct radeon_device *rdev) | |||
957 | return r; | 957 | return r; |
958 | } | 958 | } |
959 | 959 | ||
960 | r = radeon_ib_ring_tests(rdev); | ||
961 | if (r) | ||
962 | return r; | ||
963 | |||
964 | r = r600_audio_init(rdev); | 960 | r = r600_audio_init(rdev); |
965 | if (r) { | 961 | if (r) { |
966 | DRM_ERROR("radeon: audio init failed\n"); | 962 | DRM_ERROR("radeon: audio init failed\n"); |
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index 2b691abef4f7..f61b550f9efd 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c | |||
@@ -3756,27 +3756,6 @@ static int si_startup(struct radeon_device *rdev) | |||
3756 | return r; | 3756 | return r; |
3757 | } | 3757 | } |
3758 | 3758 | ||
3759 | r = radeon_ib_test(rdev, RADEON_RING_TYPE_GFX_INDEX, &rdev->ring[RADEON_RING_TYPE_GFX_INDEX]); | ||
3760 | if (r) { | ||
3761 | DRM_ERROR("radeon: failed testing IB (%d) on CP ring 0\n", r); | ||
3762 | rdev->accel_working = false; | ||
3763 | return r; | ||
3764 | } | ||
3765 | |||
3766 | r = radeon_ib_test(rdev, CAYMAN_RING_TYPE_CP1_INDEX, &rdev->ring[CAYMAN_RING_TYPE_CP1_INDEX]); | ||
3767 | if (r) { | ||
3768 | DRM_ERROR("radeon: failed testing IB (%d) on CP ring 1\n", r); | ||
3769 | rdev->accel_working = false; | ||
3770 | return r; | ||
3771 | } | ||
3772 | |||
3773 | r = radeon_ib_test(rdev, CAYMAN_RING_TYPE_CP2_INDEX, &rdev->ring[CAYMAN_RING_TYPE_CP2_INDEX]); | ||
3774 | if (r) { | ||
3775 | DRM_ERROR("radeon: failed testing IB (%d) on CP ring 2\n", r); | ||
3776 | rdev->accel_working = false; | ||
3777 | return r; | ||
3778 | } | ||
3779 | |||
3780 | r = radeon_vm_manager_init(rdev); | 3759 | r = radeon_vm_manager_init(rdev); |
3781 | if (r) { | 3760 | if (r) { |
3782 | dev_err(rdev->dev, "vm manager initialization failed (%d).\n", r); | 3761 | dev_err(rdev->dev, "vm manager initialization failed (%d).\n", r); |