Skip to content

Commit

Permalink
drm/radeon: move radeon_ib_ring_tests out of chipset code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christian König committed Jul 17, 2012
1 parent c6105f2 commit 04eb220
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 69 deletions.
4 changes: 0 additions & 4 deletions drivers/gpu/drm/radeon/evergreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/radeon/ni.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/radeon/r100.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/radeon/r300.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/radeon/r420.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/radeon/r520.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/radeon/r600.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
15 changes: 15 additions & 0 deletions drivers/gpu/drm/radeon/radeon_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/radeon/rs400.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/radeon/rs600.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/radeon/rs690.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/radeon/rv515.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/radeon/rv770.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
21 changes: 0 additions & 21 deletions drivers/gpu/drm/radeon/si.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 04eb220

Please sign in to comment.