diff options
author | Jerome Glisse <jglisse@redhat.com> | 2010-01-13 10:29:27 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-01-14 11:53:36 +1000 |
commit | 30d2d9a54d48e4fefede0389ded1b6fc2d44a522 (patch) | |
tree | f3cc8c5bd05bf6ae4605522f7f57d967fd25f30f /drivers/gpu/drm/radeon/rv770.c | |
parent | 6398d42454ce1671b3422c34fd0f600c9c76c8b1 (diff) | |
download | blackbird-op-linux-30d2d9a54d48e4fefede0389ded1b6fc2d44a522.tar.gz blackbird-op-linux-30d2d9a54d48e4fefede0389ded1b6fc2d44a522.zip |
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.c | 10 |
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) r600_wb_disable(rdev); rv770_pcie_gart_disable(rdev); /* unpin shaders bo */ - r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false); - if (likely(r == 0)) { - radeon_bo_unpin(rdev->r600_blit.shader_obj); - radeon_bo_unreserve(rdev->r600_blit.shader_obj); + if (rdev->r600_blit.shader_obj) { + r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false); + if (likely(r == 0)) { + radeon_bo_unpin(rdev->r600_blit.shader_obj); + radeon_bo_unreserve(rdev->r600_blit.shader_obj); + } } return 0; } |