Skip to content

Commit

Permalink
drm/radeon/prime: reserve/unreserve around pin
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
  • Loading branch information
airlied committed Jun 16, 2012
1 parent 0ec0612 commit 489797d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/gpu/drm/radeon/radeon_prime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 489797d

Please sign in to comment.