drm/ttm: never consider pinned BOs for eviction&swap
authorjsg <jsg@openbsd.org>
Fri, 4 Aug 2023 08:58:34 +0000 (08:58 +0000)
committerjsg <jsg@openbsd.org>
Fri, 4 Aug 2023 08:58:34 +0000 (08:58 +0000)
From Christian Koenig
17e188e0feb008bab5f4b083083dff7cdc633ca1 in linux-6.1.y/6.1.43
a2848d08742c8e8494675892c02c0d22acbe3cf8 in mainline linux

sys/dev/pci/drm/ttm/ttm_bo.c

index 48476da..7959f64 100644 (file)
@@ -550,6 +550,12 @@ static bool ttm_bo_evict_swapout_allowable(struct ttm_buffer_object *bo,
 {
        bool ret = false;
 
+       if (bo->pin_count) {
+               *locked = false;
+               *busy = false;
+               return false;
+       }
+
        if (bo->base.resv == ctx->resv) {
                dma_resv_assert_held(bo->base.resv);
                if (ctx->allow_res_evict)