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/r600_blit_kms.c | |
parent | 6398d42454ce1671b3422c34fd0f600c9c76c8b1 (diff) | |
download | lwn-30d2d9a54d48e4fefede0389ded1b6fc2d44a522.tar.gz lwn-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/r600_blit_kms.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r600_blit_kms.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/drm/radeon/r600_blit_kms.c b/drivers/gpu/drm/radeon/r600_blit_kms.c index 8787ea89dc6e..2bedce477a97 100644 --- a/drivers/gpu/drm/radeon/r600_blit_kms.c +++ b/drivers/gpu/drm/radeon/r600_blit_kms.c @@ -512,14 +512,16 @@ void r600_blit_fini(struct radeon_device *rdev) { int r; + if (rdev->r600_blit.shader_obj == NULL) + return; + /* If we can't reserve the bo, unref should be enough to destroy + * it when it becomes idle. + */ r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false); - if (unlikely(r != 0)) { - dev_err(rdev->dev, "(%d) can't finish r600 blit\n", r); - goto out_unref; + if (!r) { + radeon_bo_unpin(rdev->r600_blit.shader_obj); + radeon_bo_unreserve(rdev->r600_blit.shader_obj); } - radeon_bo_unpin(rdev->r600_blit.shader_obj); - radeon_bo_unreserve(rdev->r600_blit.shader_obj); -out_unref: radeon_bo_unref(&rdev->r600_blit.shader_obj); } |