Commit fea456d8 authored by Dave Airlie's avatar Dave Airlie

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: default avatarDave Airlie <airlied@redhat.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Cc: stable@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20201019222257.1684769-2-airlied@gmail.com
parent 7e13256d
...@@ -647,7 +647,7 @@ bool ttm_bo_eviction_valuable(struct ttm_buffer_object *bo, ...@@ -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 /* Don't evict this BO if it's outside of the
* requested placement range * 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)) (place->lpfn && place->lpfn <= bo->mem.start))
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment