]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/ttm: fix pipelined gutting for evictions v2
authorChristian König <christian.koenig@amd.com>
Thu, 23 Jul 2020 08:58:12 +0000 (10:58 +0200)
committerChristian König <christian.koenig@amd.com>
Tue, 28 Jul 2020 11:54:15 +0000 (13:54 +0200)
We can't pipeline that during eviction because the memory needs
to be available immediately.

v2: fix how we cleanup the BOs resources

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Tested-by: Alex Sierra <alex.sierra@amd.com>
Link: https://patchwork.freedesktop.org/patch/379039/
drivers/gpu/drm/ttm/ttm_bo.c

index 0768a054a91666c66e8d7bc624cc7d03b286660e..469aa93ea3175a3c4c39badad482a54000227838 100644 (file)
@@ -652,8 +652,12 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo,
        placement.num_busy_placement = 0;
        bdev->driver->evict_flags(bo, &placement);
 
-       if (!placement.num_placement && !placement.num_busy_placement)
-               return ttm_bo_pipeline_gutting(bo);
+       if (!placement.num_placement && !placement.num_busy_placement) {
+               ttm_bo_wait(bo, false, false);
+
+               ttm_bo_cleanup_memtype_use(bo);
+               return 0;
+       }
 
        evict_mem = bo->mem;
        evict_mem.mm_node = NULL;