diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/rv770.c')
-rw-r--r-- | drivers/gpu/drm/radeon/rv770.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index a96be8b3a530..dd4f02096a80 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
@@ -92,7 +92,7 @@ int rv770_pcie_gart_enable(struct radeon_device *rdev) | |||
92 | void rv770_pcie_gart_disable(struct radeon_device *rdev) | 92 | void rv770_pcie_gart_disable(struct radeon_device *rdev) |
93 | { | 93 | { |
94 | u32 tmp; | 94 | u32 tmp; |
95 | int i; | 95 | int i, r; |
96 | 96 | ||
97 | /* Disable all tables */ | 97 | /* Disable all tables */ |
98 | for (i = 0; i < 7; i++) | 98 | for (i = 0; i < 7; i++) |
@@ -113,8 +113,12 @@ void rv770_pcie_gart_disable(struct radeon_device *rdev) | |||
113 | WREG32(MC_VM_MB_L1_TLB2_CNTL, tmp); | 113 | WREG32(MC_VM_MB_L1_TLB2_CNTL, tmp); |
114 | WREG32(MC_VM_MB_L1_TLB3_CNTL, tmp); | 114 | WREG32(MC_VM_MB_L1_TLB3_CNTL, tmp); |
115 | if (rdev->gart.table.vram.robj) { | 115 | if (rdev->gart.table.vram.robj) { |
116 | radeon_object_kunmap(rdev->gart.table.vram.robj); | 116 | r = radeon_bo_reserve(rdev->gart.table.vram.robj, false); |
117 | radeon_object_unpin(rdev->gart.table.vram.robj); | 117 | if (likely(r == 0)) { |
118 | radeon_bo_kunmap(rdev->gart.table.vram.robj); | ||
119 | radeon_bo_unpin(rdev->gart.table.vram.robj); | ||
120 | radeon_bo_unreserve(rdev->gart.table.vram.robj); | ||
121 | } | ||
118 | } | 122 | } |
119 | } | 123 | } |
120 | 124 | ||
@@ -880,8 +884,12 @@ static int rv770_startup(struct radeon_device *rdev) | |||
880 | } | 884 | } |
881 | rv770_gpu_init(rdev); | 885 | rv770_gpu_init(rdev); |
882 | 886 | ||
883 | r = radeon_object_pin(rdev->r600_blit.shader_obj, RADEON_GEM_DOMAIN_VRAM, | 887 | r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false); |
884 | &rdev->r600_blit.shader_gpu_addr); | 888 | if (unlikely(r != 0)) |
889 | return r; | ||
890 | r = radeon_bo_pin(rdev->r600_blit.shader_obj, RADEON_GEM_DOMAIN_VRAM, | ||
891 | &rdev->r600_blit.shader_gpu_addr); | ||
892 | radeon_bo_unreserve(rdev->r600_blit.shader_obj); | ||
885 | if (r) { | 893 | if (r) { |
886 | DRM_ERROR("failed to pin blit object %d\n", r); | 894 | DRM_ERROR("failed to pin blit object %d\n", r); |
887 | return r; | 895 | return r; |
@@ -943,13 +951,19 @@ int rv770_resume(struct radeon_device *rdev) | |||
943 | 951 | ||
944 | int rv770_suspend(struct radeon_device *rdev) | 952 | int rv770_suspend(struct radeon_device *rdev) |
945 | { | 953 | { |
954 | int r; | ||
955 | |||
946 | /* FIXME: we should wait for ring to be empty */ | 956 | /* FIXME: we should wait for ring to be empty */ |
947 | r700_cp_stop(rdev); | 957 | r700_cp_stop(rdev); |
948 | rdev->cp.ready = false; | 958 | rdev->cp.ready = false; |
949 | r600_wb_disable(rdev); | 959 | r600_wb_disable(rdev); |
950 | rv770_pcie_gart_disable(rdev); | 960 | rv770_pcie_gart_disable(rdev); |
951 | /* unpin shaders bo */ | 961 | /* unpin shaders bo */ |
952 | radeon_object_unpin(rdev->r600_blit.shader_obj); | 962 | r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false); |
963 | if (likely(r == 0)) { | ||
964 | radeon_bo_unpin(rdev->r600_blit.shader_obj); | ||
965 | radeon_bo_unreserve(rdev->r600_blit.shader_obj); | ||
966 | } | ||
953 | return 0; | 967 | return 0; |
954 | } | 968 | } |
955 | 969 | ||
@@ -1011,7 +1025,7 @@ int rv770_init(struct radeon_device *rdev) | |||
1011 | if (r) | 1025 | if (r) |
1012 | return r; | 1026 | return r; |
1013 | /* Memory manager */ | 1027 | /* Memory manager */ |
1014 | r = radeon_object_init(rdev); | 1028 | r = radeon_bo_init(rdev); |
1015 | if (r) | 1029 | if (r) |
1016 | return r; | 1030 | return r; |
1017 | 1031 | ||
@@ -1082,7 +1096,7 @@ void rv770_fini(struct radeon_device *rdev) | |||
1082 | radeon_clocks_fini(rdev); | 1096 | radeon_clocks_fini(rdev); |
1083 | if (rdev->flags & RADEON_IS_AGP) | 1097 | if (rdev->flags & RADEON_IS_AGP) |
1084 | radeon_agp_fini(rdev); | 1098 | radeon_agp_fini(rdev); |
1085 | radeon_object_fini(rdev); | 1099 | radeon_bo_fini(rdev); |
1086 | radeon_atombios_fini(rdev); | 1100 | radeon_atombios_fini(rdev); |
1087 | kfree(rdev->bios); | 1101 | kfree(rdev->bios); |
1088 | rdev->bios = NULL; | 1102 | rdev->bios = NULL; |