drm/radeon/kms: move around new init path code to avoid posting at init

We really don't want to post the card at init, it takes a relatively
long time and isn't required, so split the resume path into
a startup path called by both init/resume and separate resume
entry point to do posting.

Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Dave Airlie
2009-09-18 15:19:37 +10:00
committed by Dave Airlie
parent bc1a631e51
commit fc30b8efbe
3 changed files with 101 additions and 27 deletions

View File

@@ -851,7 +851,7 @@ int rv770_gpu_reset(struct radeon_device *rdev)
return 0;
}
int rv770_resume(struct radeon_device *rdev)
static int rv770_startup(struct radeon_device *rdev)
{
int r;
@@ -875,6 +875,40 @@ int rv770_resume(struct radeon_device *rdev)
return 0;
}
int rv770_resume(struct radeon_device *rdev)
{
int r;
if (radeon_gpu_reset(rdev)) {
/* FIXME: what do we want to do here ? */
}
/* post card */
if (rdev->is_atom_bios) {
atom_asic_init(rdev->mode_info.atom_context);
} else {
radeon_combios_asic_init(rdev->ddev);
}
/* Initialize clocks */
r = radeon_clocks_init(rdev);
if (r) {
return r;
}
r = rv770_startup(rdev);
if (r) {
DRM_ERROR("r600 startup failed on resume\n");
return r;
}
r = radeon_ib_test(rdev);
if (r) {
DRM_ERROR("radeon: failled testing IB (%d).\n", r);
return r;
}
return r;
}
int rv770_suspend(struct radeon_device *rdev)
{
/* FIXME: we should wait for ring to be empty */
@@ -959,7 +993,7 @@ int rv770_init(struct radeon_device *rdev)
return r;
rdev->accel_working = true;
r = rv770_resume(rdev);
r = rv770_startup(rdev);
if (r) {
if (rdev->flags & RADEON_IS_AGP) {
/* Retry with disabling AGP */