[PATCH 2/3] drm/ttm: check with temporary GTT memory in BO validation

Lang Yu Lang.Yu at amd.com
Mon May 31 08:22:40 UTC 2021


If a BO's backing store is temporary GTT memory, we should
move it in BO validation.

Signed-off-by: Lang Yu <Lang.Yu at amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index c32a37d0a460..80c8cb2c3f31 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -944,6 +944,8 @@ static bool ttm_bo_places_compat(const struct ttm_place *places,
 		if ((mem->start < heap->fpfn ||
 		     (heap->lpfn != 0 && (mem->start + mem->num_pages) > heap->lpfn)))
 			continue;
+		if (mem->placement & TTM_PL_FLAG_TEMPORARY)
+			continue;
 
 		*new_flags = heap->flags;
 		if ((mem->mem_type == heap->mem_type) &&
-- 
2.25.1



More information about the dri-devel mailing list