summaryrefslogtreecommitdiff
path: root/include/drm/ttm
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2021-04-13 23:06:34 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2021-04-13 23:15:09 +0200
commit213cc929cbfd7962164420b300f9a6c60aaff189 (patch)
tree163d5e50169ce0399add99cba49a760214de05db /include/drm/ttm
parentcd951b3971cdc1f8c76b075f2c97ff357bf141e2 (diff)
parentd434405aaab7d0ebc516b68a8fc4100922d7f5ef (diff)
Merge drm/drm-fixes into drm-next
msm-next pull request has a baseline with stuff from -fixes, roll forward first. Some simple conflicts in amdgpu, ttm and one in i915 where git gets confused and tries to add the same function twice. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
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 3587f660e8f4..2155e2e38aec 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -603,9 +603,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,