drm/ttm: add a weak BO reference to the resource v3
authorChristian König <christian.koenig@amd.com>
Thu, 15 Jul 2021 12:17:19 +0000 (14:17 +0200)
committerChristian König <christian.koenig@amd.com>
Wed, 26 Jan 2022 14:30:19 +0000 (15:30 +0100)
commitfda8d552c9c7783d4b29aeb6350d7404b31cdbff
tree5522b74728e5ef71e87ba35c6c4de3e0008b8e33
parent3f268ef06f8cf3c481dbd5843d564f5170c6df54
drm/ttm: add a weak BO reference to the resource v3

Keep track for which BO a resource was allocated.
This is necessary to move the LRU handling into the resources.

A bit problematic is i915 since it tries to use the resource
interface without a BO which is illegal from the conceptional
point of view.

v2: Document that this is a weak reference and add a workaround for i915
v3: further document that this is protected by ttm_device::lru_lock and
    clarify the i915 workaround

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220124122514.1832-4-christian.koenig@amd.com
drivers/gpu/drm/ttm/ttm_bo_util.c
drivers/gpu/drm/ttm/ttm_resource.c
include/drm/ttm/ttm_resource.h