diff options
author | Dave Airlie <airlied@linux.ie> | 2009-09-18 01:19:37 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-09-18 02:17:42 -0400 |
commit | fc30b8efbe1b271eb64e0d4f6cb2a91bb57ee5f3 (patch) | |
tree | 87e0fb824b19667c2570bc99bc9ca918f4a25f6e /drivers/gpu/drm/radeon/r600.c | |
parent | bc1a631e5104317cc8b4ef7d14adc597f2844003 (diff) |
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>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 9844783cd8d7..5f42fad19190 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -1466,7 +1466,7 @@ bool r600_card_posted(struct radeon_device *rdev) | |||
1466 | return false; | 1466 | return false; |
1467 | } | 1467 | } |
1468 | 1468 | ||
1469 | int r600_resume(struct radeon_device *rdev) | 1469 | int r600_startup(struct radeon_device *rdev) |
1470 | { | 1470 | { |
1471 | int r; | 1471 | int r; |
1472 | 1472 | ||
@@ -1499,6 +1499,40 @@ int r600_resume(struct radeon_device *rdev) | |||
1499 | return 0; | 1499 | return 0; |
1500 | } | 1500 | } |
1501 | 1501 | ||
1502 | int r600_resume(struct radeon_device *rdev) | ||
1503 | { | ||
1504 | int r; | ||
1505 | |||
1506 | if (radeon_gpu_reset(rdev)) { | ||
1507 | /* FIXME: what do we want to do here ? */ | ||
1508 | } | ||
1509 | /* post card */ | ||
1510 | if (rdev->is_atom_bios) { | ||
1511 | atom_asic_init(rdev->mode_info.atom_context); | ||
1512 | } else { | ||
1513 | radeon_combios_asic_init(rdev->ddev); | ||
1514 | } | ||
1515 | /* Initialize clocks */ | ||
1516 | r = radeon_clocks_init(rdev); | ||
1517 | if (r) { | ||
1518 | return r; | ||
1519 | } | ||
1520 | |||
1521 | r = r600_startup(rdev); | ||
1522 | if (r) { | ||
1523 | DRM_ERROR("r600 startup failed on resume\n"); | ||
1524 | return r; | ||
1525 | } | ||
1526 | |||
1527 | r = radeon_ib_test(rdev); | ||
1528 | if (r) { | ||
1529 | DRM_ERROR("radeon: failled testing IB (%d).\n", r); | ||
1530 | return r; | ||
1531 | } | ||
1532 | return r; | ||
1533 | } | ||
1534 | |||
1535 | |||
1502 | int r600_suspend(struct radeon_device *rdev) | 1536 | int r600_suspend(struct radeon_device *rdev) |
1503 | { | 1537 | { |
1504 | /* FIXME: we should wait for ring to be empty */ | 1538 | /* FIXME: we should wait for ring to be empty */ |
@@ -1596,7 +1630,7 @@ int r600_init(struct radeon_device *rdev) | |||
1596 | return r; | 1630 | return r; |
1597 | } | 1631 | } |
1598 | 1632 | ||
1599 | r = r600_resume(rdev); | 1633 | r = r600_startup(rdev); |
1600 | if (r) { | 1634 | if (r) { |
1601 | if (rdev->flags & RADEON_IS_AGP) { | 1635 | if (rdev->flags & RADEON_IS_AGP) { |
1602 | /* Retry with disabling AGP */ | 1636 | /* Retry with disabling AGP */ |