OSDN Git Service

drm/ttm: use pin_count more extensively
authorChristian König <christian.koenig@amd.com>
Fri, 27 Nov 2020 11:51:33 +0000 (12:51 +0100)
committerChristian König <christian.koenig@amd.com>
Tue, 15 Dec 2020 16:01:55 +0000 (17:01 +0100)
Check the pin_count instead of the lru list is empty here.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Link: https://patchwork.freedesktop.org/patch/404617/
drivers/gpu/drm/ttm/ttm_bo.c

index 2196e3d..c702ec5 100644 (file)
@@ -938,9 +938,8 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo,
        }
 
 error:
-       if (bo->mem.mem_type == TTM_PL_SYSTEM && !list_empty(&bo->lru)) {
+       if (bo->mem.mem_type == TTM_PL_SYSTEM && !bo->pin_count)
                ttm_bo_move_to_lru_tail_unlocked(bo);
-       }
 
        return ret;
 }