From: jsg Date: Fri, 4 Aug 2023 08:58:34 +0000 (+0000) Subject: drm/ttm: never consider pinned BOs for eviction&swap X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=26c6fd031ef957c41aa72906b692f5cd114999d2;p=openbsd drm/ttm: never consider pinned BOs for eviction&swap From Christian Koenig 17e188e0feb008bab5f4b083083dff7cdc633ca1 in linux-6.1.y/6.1.43 a2848d08742c8e8494675892c02c0d22acbe3cf8 in mainline linux --- diff --git a/sys/dev/pci/drm/ttm/ttm_bo.c b/sys/dev/pci/drm/ttm/ttm_bo.c index 48476da8e07..7959f645a75 100644 --- a/sys/dev/pci/drm/ttm/ttm_bo.c +++ b/sys/dev/pci/drm/ttm/ttm_bo.c @@ -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)