diff options
author | Maarten Lankhorst <m.b.lankhorst@gmail.com> | 2013-06-27 15:48:23 +0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-06-28 06:04:07 +0400 |
commit | c43f9b16991950c00621641ef2c5cd4a3af2a052 (patch) | |
tree | 6b68a479dc8567904a7061beacf80dbe1febc430 /drivers/gpu/drm/radeon/radeon_object.h | |
parent | 06597ce8b4d300f82dae785f0c89a6eab785fd06 (diff) | |
download | linux-c43f9b16991950c00621641ef2c5cd4a3af2a052.tar.xz |
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>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_object.h')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_object.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_object.h b/drivers/gpu/drm/radeon/radeon_object.h index 3e62a3a0fe54..456ad6bc92af 100644 --- a/drivers/gpu/drm/radeon/radeon_object.h +++ b/drivers/gpu/drm/radeon/radeon_object.h @@ -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) { |