diff options
author | Dave Airlie <airlied@redhat.com> | 2012-06-12 16:10:39 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-06-16 11:14:05 +0100 |
commit | 489797d510dfbce15120492d7ef6f956928b99f2 (patch) | |
tree | 23311f729e80b41a0e5352f39254ddeb628b68f4 /drivers/gpu/drm/radeon/radeon_prime.c | |
parent | 0ec0612a80f957000999c3f7b31a84e3558c719d (diff) | |
download | blackbird-op-linux-489797d510dfbce15120492d7ef6f956928b99f2.tar.gz blackbird-op-linux-489797d510dfbce15120492d7ef6f956928b99f2.zip |
drm/radeon/prime: reserve/unreserve around pin
I finally got to test this code a bit more and hit the ttm
no reserved assert, so add the reservations around the pinning.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_prime.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_prime.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_prime.c b/drivers/gpu/drm/radeon/radeon_prime.c index 8ddab4c76710..6bef46ace831 100644 --- a/drivers/gpu/drm/radeon/radeon_prime.c +++ b/drivers/gpu/drm/radeon/radeon_prime.c @@ -169,11 +169,17 @@ struct dma_buf *radeon_gem_prime_export(struct drm_device *dev, struct radeon_bo *bo = gem_to_radeon_bo(obj); int ret = 0; + ret = radeon_bo_reserve(bo, false); + if (unlikely(ret != 0)) + return ERR_PTR(ret); + /* pin buffer into GTT */ ret = radeon_bo_pin(bo, RADEON_GEM_DOMAIN_GTT, NULL); - if (ret) + if (ret) { + radeon_bo_unreserve(bo); return ERR_PTR(ret); - + } + radeon_bo_unreserve(bo); return dma_buf_export(bo, &radeon_dmabuf_ops, obj->size, flags); } |