drm/ttm: move the LRU into resource handling v4
authorChristian König <christian.koenig@amd.com>
Fri, 16 Jul 2021 12:00:10 +0000 (14:00 +0200)
committerChristian König <christian.koenig@amd.com>
Mon, 28 Mar 2022 18:05:32 +0000 (20:05 +0200)
commit6a9b028994025f5033f10d1da30b29dfdc713384
tree0578ac3eeb37b1c3b89ff8306298f13831429582
parente795df5bbcf27abd6250a0fb9fa8ad7a9748959f
drm/ttm: move the LRU into resource handling v4

This way we finally fix the problem that new resource are
not immediately evict-able after allocation.

That has caused numerous problems including OOM on GDS handling
and not being able to use TTM as general resource manager.

v2: stop assuming in ttm_resource_fini that res->bo is still valid.
v3: cleanup kerneldoc, add more lockdep annotation
v4: consistently use res->num_pages

Signed-off-by: Christian König <christian.koenig@amd.com>
Tested-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20220321132601.2161-1-christian.koenig@amd.com
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
drivers/gpu/drm/i915/gem/i915_gem_ttm.c
drivers/gpu/drm/ttm/ttm_bo.c
drivers/gpu/drm/ttm/ttm_bo_util.c
drivers/gpu/drm/ttm/ttm_device.c
drivers/gpu/drm/ttm/ttm_resource.c
include/drm/ttm/ttm_bo_api.h
include/drm/ttm/ttm_bo_driver.h
include/drm/ttm/ttm_resource.h