summaryrefslogtreecommitdiff
path: root/include/drm/ttm
diff options
context:
space:
mode:
authorMaxime Ripard <maxime@cerno.tech>2021-04-26 15:03:09 +0300
committerMaxime Ripard <maxime@cerno.tech>2021-04-26 15:03:09 +0300
commit355b60296143a090039211c5f0e1463f84aab65a (patch)
treeb74d4ef2aea66252ea9cf77c847de6c6e72a02b7 /include/drm/ttm
parent91185d55b32e7e377f15fb46a62b216f8d3038d4 (diff)
parenta1a1ca70deb3ec600eeabb21de7f3f48aaae5695 (diff)
downloadlinux-355b60296143a090039211c5f0e1463f84aab65a.tar.xz
Merge drm/drm-next into drm-misc-next
Christian needs some patches from drm/next Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Diffstat (limited to 'include/drm/ttm')
-rw-r--r--include/drm/ttm/ttm_bo_api.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index 0d727a091e23..639521880c29 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -586,9 +586,11 @@ static inline void ttm_bo_pin(struct ttm_buffer_object *bo)
static inline void ttm_bo_unpin(struct ttm_buffer_object *bo)
{
dma_resv_assert_held(bo->base.resv);
- WARN_ON_ONCE(!bo->pin_count);
WARN_ON_ONCE(!kref_read(&bo->kref));
- --bo->pin_count;
+ if (bo->pin_count)
+ --bo->pin_count;
+ else
+ WARN_ON_ONCE(true);
}
int ttm_mem_evict_first(struct ttm_device *bdev,