aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/rv770.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2009-09-18 01:19:37 -0400
committerDave Airlie <airlied@redhat.com>2009-09-18 02:17:42 -0400
commitfc30b8efbe1b271eb64e0d4f6cb2a91bb57ee5f3 (patch)
tree87e0fb824b19667c2570bc99bc9ca918f4a25f6e /drivers/gpu/drm/radeon/rv770.c
parentbc1a631e5104317cc8b4ef7d14adc597f2844003 (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/rv770.c')
-rw-r--r--drivers/gpu/drm/radeon/rv770.c38
1 files changed, 36 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index 47427623a84c..a6399662a843 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -851,7 +851,7 @@ int rv770_gpu_reset(struct radeon_device *rdev)
851 return 0; 851 return 0;
852} 852}
853 853
854int rv770_resume(struct radeon_device *rdev) 854static int rv770_startup(struct radeon_device *rdev)
855{ 855{
856 int r; 856 int r;
857 857
@@ -875,6 +875,40 @@ int rv770_resume(struct radeon_device *rdev)
875 return 0; 875 return 0;
876} 876}
877 877
878int rv770_resume(struct radeon_device *rdev)
879{
880 int r;
881
882 if (radeon_gpu_reset(rdev)) {
883 /* FIXME: what do we want to do here ? */
884 }
885 /* post card */
886 if (rdev->is_atom_bios) {
887 atom_asic_init(rdev->mode_info.atom_context);
888 } else {
889 radeon_combios_asic_init(rdev->ddev);
890 }
891 /* Initialize clocks */
892 r = radeon_clocks_init(rdev);
893 if (r) {
894 return r;
895 }
896
897 r = rv770_startup(rdev);
898 if (r) {
899 DRM_ERROR("r600 startup failed on resume\n");
900 return r;
901 }
902
903 r = radeon_ib_test(rdev);
904 if (r) {
905 DRM_ERROR("radeon: failled testing IB (%d).\n", r);
906 return r;
907 }
908 return r;
909
910}
911
878int rv770_suspend(struct radeon_device *rdev) 912int rv770_suspend(struct radeon_device *rdev)
879{ 913{
880 /* FIXME: we should wait for ring to be empty */ 914 /* FIXME: we should wait for ring to be empty */
@@ -959,7 +993,7 @@ int rv770_init(struct radeon_device *rdev)
959 return r; 993 return r;
960 994
961 rdev->accel_working = true; 995 rdev->accel_working = true;
962 r = rv770_resume(rdev); 996 r = rv770_startup(rdev);
963 if (r) { 997 if (r) {
964 if (rdev->flags & RADEON_IS_AGP) { 998 if (rdev->flags & RADEON_IS_AGP) {
965 /* Retry with disabling AGP */ 999 /* Retry with disabling AGP */