aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/rv770.c
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2010-01-13 04:29:27 -0500
committerDave Airlie <airlied@redhat.com>2010-01-13 20:53:36 -0500
commit30d2d9a54d48e4fefede0389ded1b6fc2d44a522 (patch)
treef3cc8c5bd05bf6ae4605522f7f57d967fd25f30f /drivers/gpu/drm/radeon/rv770.c
parent6398d42454ce1671b3422c34fd0f600c9c76c8b1 (diff)
drm/radeon/kms: Fix r600 blit cleanup path
r600 blit cleanup path need to check if a bo was allocated before trying to free or unpin it. This patch add this check and avoid oops when the initialization on r6xx or r7xx hw fails. Signed-off-by: Jerome Glisse <jglisse@redhat.com> 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.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index 16f7317fa1af..7f17ddf1f45f 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -975,10 +975,12 @@ int rv770_suspend(struct radeon_device *rdev)
975 r600_wb_disable(rdev); 975 r600_wb_disable(rdev);
976 rv770_pcie_gart_disable(rdev); 976 rv770_pcie_gart_disable(rdev);
977 /* unpin shaders bo */ 977 /* unpin shaders bo */
978 r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false); 978 if (rdev->r600_blit.shader_obj) {
979 if (likely(r == 0)) { 979 r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false);
980 radeon_bo_unpin(rdev->r600_blit.shader_obj); 980 if (likely(r == 0)) {
981 radeon_bo_unreserve(rdev->r600_blit.shader_obj); 981 radeon_bo_unpin(rdev->r600_blit.shader_obj);
982 radeon_bo_unreserve(rdev->r600_blit.shader_obj);
983 }
982 } 984 }
983 return 0; 985 return 0;
984} 986}