drm/ttm: get rid of ttm_bo_is_reserved usage
authorFrançois Tigeot <ftigeot@wolfpond.org>
Tue, 12 Mar 2019 18:10:26 +0000 (19:10 +0100)
committerFrançois Tigeot <ftigeot@wolfpond.org>
Tue, 12 Mar 2019 18:10:43 +0000 (19:10 +0100)
sys/dev/drm/ttm/ttm_bo.c

index 8c2d058..aa06702 100644 (file)
@@ -166,7 +166,7 @@ void ttm_bo_add_to_lru(struct ttm_buffer_object *bo)
        struct ttm_bo_device *bdev = bo->bdev;
        struct ttm_mem_type_manager *man;
 
-       BUG_ON(!ttm_bo_is_reserved(bo));
+       lockdep_assert_held(&bo->resv->lock.base);
 
        if (!(bo->mem.placement & TTM_PL_FLAG_NO_EVICT)) {
 
@@ -710,7 +710,7 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo, bool interruptible,
                goto out;
        }
 
-       BUG_ON(!ttm_bo_is_reserved(bo));
+       lockdep_assert_held(&bo->resv->lock.base);
 
        evict_mem = bo->mem;
        evict_mem.mm_node = NULL;
@@ -994,7 +994,7 @@ static int ttm_bo_move_buffer(struct ttm_buffer_object *bo,
        struct ttm_mem_reg mem;
        struct ttm_bo_device *bdev = bo->bdev;
 
-       BUG_ON(!ttm_bo_is_reserved(bo));
+       lockdep_assert_held(&bo->resv->lock.base);
 
        /*
         * FIXME: It's possible to pipeline buffer moves.
@@ -1069,7 +1069,7 @@ int ttm_bo_validate(struct ttm_buffer_object *bo,
        int ret;
        uint32_t new_flags;
 
-       BUG_ON(!ttm_bo_is_reserved(bo));
+       lockdep_assert_held(&bo->resv->lock.base);
        /*
         * Check whether we need to move buffer.
         */