diff options
author | Maarten Lankhorst <maarten.lankhorst@canonical.com> | 2012-10-12 10:58:36 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-11-06 19:44:38 -0500 |
commit | a9dbfff1cbe5972ae0ef07b51530a70240ec9f2c (patch) | |
tree | 641bf7ee8df65357cce60a12a9cebba797f3ba8d /include/drm | |
parent | c4a56750ecbf2421ebd39f0fec562e1869a38d53 (diff) |
drm/ttm: add ttm_bo_is_reserved
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/ttm/ttm_bo_api.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index e8028ade567f..36e8408e00fa 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h | |||
@@ -736,4 +736,18 @@ extern ssize_t ttm_bo_io(struct ttm_bo_device *bdev, struct file *filp, | |||
736 | 736 | ||
737 | extern void ttm_bo_swapout_all(struct ttm_bo_device *bdev); | 737 | extern void ttm_bo_swapout_all(struct ttm_bo_device *bdev); |
738 | 738 | ||
739 | /** | ||
740 | * ttm_bo_is_reserved - return an indication if a ttm buffer object is reserved | ||
741 | * | ||
742 | * @bo: The buffer object to check. | ||
743 | * | ||
744 | * This function returns an indication if a bo is reserved or not, and should | ||
745 | * only be used to print an error when it is not from incorrect api usage, since | ||
746 | * there's no guarantee that it is the caller that is holding the reservation. | ||
747 | */ | ||
748 | static inline bool ttm_bo_is_reserved(struct ttm_buffer_object *bo) | ||
749 | { | ||
750 | return atomic_read(&bo->reserved); | ||
751 | } | ||
752 | |||
739 | #endif | 753 | #endif |