Merge tag 'drm-misc-next-2020-10-27' of git://anongit.freedesktop.org/drm/drm-misc...
[platform/kernel/linux-starfive.git] / drivers / gpu / drm / ttm / ttm_bo.c
index 40c72a0..f51b5e2 100644 (file)
@@ -612,7 +612,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;