aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/r600.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/r600.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/r600.c')
-rw-r--r--drivers/gpu/drm/radeon/r600.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 9757962146fb..3e02dd403d77 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -1961,11 +1961,13 @@ int r600_suspend(struct radeon_device *rdev)
1961 r600_wb_disable(rdev); 1961 r600_wb_disable(rdev);
1962 r600_pcie_gart_disable(rdev); 1962 r600_pcie_gart_disable(rdev);
1963 /* unpin shaders bo */ 1963 /* unpin shaders bo */
1964 r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false); 1964 if (rdev->r600_blit.shader_obj) {
1965 if (unlikely(r != 0)) 1965 r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false);
1966 return r; 1966 if (!r) {
1967 radeon_bo_unpin(rdev->r600_blit.shader_obj); 1967 radeon_bo_unpin(rdev->r600_blit.shader_obj);
1968 radeon_bo_unreserve(rdev->r600_blit.shader_obj); 1968 radeon_bo_unreserve(rdev->r600_blit.shader_obj);
1969 }
1970 }
1969 return 0; 1971 return 0;
1970} 1972}
1971 1973