Re: [PATCH 1/5] drm/ttm: fix eviction valuable range check.

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

 



Am 20.10.20 um 00:22 schrieb Dave Airlie:
From: Dave Airlie <airlied@xxxxxxxxxx>

This was adding size to start, but pfn and start are in pages,
so it should be using num_pages.

Not sure this fixes anything in the real world, just noticed it
during refactoring.

Oh, yes it most likely does!

Signed-off-by: Dave Airlie <airlied@xxxxxxxxxx>

Reviewed-by: Christian König <christian.koenig@xxxxxxx>

CC stable?

---
  drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index cbc74a320db2..3101650c01b4 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -620,7 +620,7 @@ bool ttm_bo_eviction_valuable(struct ttm_buffer_object *bo,
  	/* Don't evict this BO if it's outside of the
  	 * requested placement range
  	 */
-	if (place->fpfn >= (bo->mem.start + bo->mem.size) ||
+	if (place->fpfn >= (bo->mem.start + bo->mem.num_pages) ||
  	    (place->lpfn && place->lpfn <= bo->mem.start))
  		return false;

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[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