diff options
author | Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com> | 2022-08-20 00:33:04 -0700 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2022-08-22 15:36:29 +0200 |
commit | 6d3c900c12d72667341bcff338c252e22728b942 (patch) | |
tree | c47e044a7bd24a12069e0abcf0cd7f384daad901 /drivers/gpu/drm/ttm/ttm_resource.c | |
parent | 73b984d8722e3ee077a8591b27d8c4d1a2d72020 (diff) |
drm/ttm: Switch to using the new res callback
Apply new intersect and compatible callback instead
of having a generic placement range verfications.
v2: Added a separate callback for compatiblilty
checks (Christian)
v3: Cleanups and removal of workarounds
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220820073304.178444-6-Arunpravin.PaneerSelvam@amd.com
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_resource.c')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_resource.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_resource.c b/drivers/gpu/drm/ttm/ttm_resource.c index 0d1f862a582b..a729c32a1e48 100644 --- a/drivers/gpu/drm/ttm/ttm_resource.c +++ b/drivers/gpu/drm/ttm/ttm_resource.c @@ -276,17 +276,9 @@ bool ttm_resource_intersects(struct ttm_device *bdev, if (!res) return false; - if (!place) - return true; - man = ttm_manager_type(bdev, res->mem_type); - if (!man->func->intersects) { - if (place->fpfn >= (res->start + res->num_pages) || - (place->lpfn && place->lpfn <= res->start)) - return false; - + if (!place || !man->func->intersects) return true; - } return man->func->intersects(man, res, place, size); } @@ -314,13 +306,8 @@ bool ttm_resource_compatible(struct ttm_device *bdev, return false; man = ttm_manager_type(bdev, res->mem_type); - if (!man->func->compatible) { - if (res->start < place->fpfn || - (place->lpfn && (res->start + res->num_pages) > place->lpfn)) - return false; - + if (!man->func->compatible) return true; - } return man->func->compatible(man, res, place, size); } |