Commit 04eb2206 authored by Christian König's avatar Christian König

drm/radeon: move radeon_ib_ring_tests out of chipset code

Making it easier to control when it is executed.
Signed-off-by: default avatarChristian König <deathsimple@vodafone.de>
Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c6105f24
......@@ -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");
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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");
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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");
......
......@@ -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");
......
......@@ -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;
}
......
......@@ -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");
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment