Skip to content

Commit fea456d

Browse files
committed
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 <airlied@redhat.com> Reviewed-by: Christian König <christian.koenig@amd.com> Cc: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20201019222257.1684769-2-airlied@gmail.com
1 parent 7e13256 commit fea456d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/ttm/ttm_bo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ bool ttm_bo_eviction_valuable(struct ttm_buffer_object *bo,
647647
/* Don't evict this BO if it's outside of the
648648
* requested placement range
649649
*/
650-
if (place->fpfn >= (bo->mem.start + bo->mem.size) ||
650+
if (place->fpfn >= (bo->mem.start + bo->mem.num_pages) ||
651651
(place->lpfn && place->lpfn <= bo->mem.start))
652652
return false;
653653

0 commit comments

Comments
 (0)