aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2020-10-20 08:22:53 +1000
committerDave Airlie <[email protected]>2020-10-21 06:59:07 +1000
commitfea456d82c19d201c21313864105876deabe148b (patch)
tree7aea000632ab166216dc28cf224330b556e0b973
parent7e13256dfe22b0d2e49cbfdb75bdc57e059d6c50 (diff)
drm/ttm: fix eviction valuable range check.
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. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Christian König <[email protected]> Cc: [email protected] Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 70b3bee27850..eb4b7df02ca0 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -647,7 +647,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;