mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 21:33:00 +00:00
drm/radeon: inline reservations
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
06597ce8b4
commit
c43f9b1699
@ -619,26 +619,3 @@ int radeon_bo_wait(struct radeon_bo *bo, u32 *mem_type, bool no_wait)
|
||||
ttm_bo_unreserve(&bo->tbo);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* radeon_bo_reserve - reserve bo
|
||||
* @bo: bo structure
|
||||
* @no_intr: don't return -ERESTARTSYS on pending signal
|
||||
*
|
||||
* Returns:
|
||||
* -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by
|
||||
* a signal. Release all buffer reservations and return to user-space.
|
||||
*/
|
||||
int radeon_bo_reserve(struct radeon_bo *bo, bool no_intr)
|
||||
{
|
||||
int r;
|
||||
|
||||
r = ttm_bo_reserve(&bo->tbo, !no_intr, false, false, 0);
|
||||
if (unlikely(r != 0)) {
|
||||
if (r != -ERESTARTSYS)
|
||||
dev_err(bo->rdev->dev, "%p reserve failed\n", bo);
|
||||
return r;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -52,7 +52,27 @@ static inline unsigned radeon_mem_type_to_domain(u32 mem_type)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int radeon_bo_reserve(struct radeon_bo *bo, bool no_intr);
|
||||
/**
|
||||
* radeon_bo_reserve - reserve bo
|
||||
* @bo: bo structure
|
||||
* @no_intr: don't return -ERESTARTSYS on pending signal
|
||||
*
|
||||
* Returns:
|
||||
* -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by
|
||||
* a signal. Release all buffer reservations and return to user-space.
|
||||
*/
|
||||
static inline int radeon_bo_reserve(struct radeon_bo *bo, bool no_intr)
|
||||
{
|
||||
int r;
|
||||
|
||||
r = ttm_bo_reserve(&bo->tbo, !no_intr, false, false, 0);
|
||||
if (unlikely(r != 0)) {
|
||||
if (r != -ERESTARTSYS)
|
||||
dev_err(bo->rdev->dev, "%p reserve failed\n", bo);
|
||||
return r;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void radeon_bo_unreserve(struct radeon_bo *bo)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user