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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Am 31.05.21 um 10:22 schrieb Lang Yu:
If a BO's backing store is temporary GTT memory, we should
move it in BO validation.

Signed-off-by: Lang Yu <Lang.Yu@xxxxxxx>
---
  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;

Oh, good idea. But please move the check outside of the loop since mem never changes here we can return false right away.

Thanks,
Christian.

*new_flags = heap->flags;
  		if ((mem->mem_type == heap->mem_type) &&




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux