Commit 44292a0f authored by Christian König's avatar Christian König

drm/ttm: warn stricter about freeing pinned BOs

So far we only warned when the BOs where pinned and not idle.

Also warn if we see a pinned BO in general.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Acked-by: default avatarLeo Liu <leo.liu@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210415084730.2057-3-christian.koenig@amd.com
parent e2ac8531
...@@ -401,6 +401,8 @@ static void ttm_bo_release(struct kref *kref) ...@@ -401,6 +401,8 @@ static void ttm_bo_release(struct kref *kref)
struct ttm_device *bdev = bo->bdev; struct ttm_device *bdev = bo->bdev;
int ret; int ret;
WARN_ON_ONCE(bo->pin_count);
if (!bo->deleted) { if (!bo->deleted) {
ret = ttm_bo_individualize_resv(bo); ret = ttm_bo_individualize_resv(bo);
if (ret) { if (ret) {
...@@ -434,7 +436,7 @@ static void ttm_bo_release(struct kref *kref) ...@@ -434,7 +436,7 @@ static void ttm_bo_release(struct kref *kref)
* FIXME: QXL is triggering this. Can be removed when the * FIXME: QXL is triggering this. Can be removed when the
* driver is fixed. * driver is fixed.
*/ */
if (WARN_ON_ONCE(bo->pin_count)) { if (bo->pin_count) {
bo->pin_count = 0; bo->pin_count = 0;
ttm_bo_move_to_lru_tail(bo, &bo->mem, NULL); ttm_bo_move_to_lru_tail(bo, &bo->mem, NULL);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment