Merge tag 'drm-misc-fixes-2021-11-11' of git://anongit.freedesktop.org/drm/drm-misc...
[linux-2.6-microblaze.git] / drivers / gpu / drm / ttm / ttm_bo.c
index 3934ee2..739f11c 100644 (file)
@@ -619,7 +619,8 @@ static bool ttm_bo_evict_swapout_allowable(struct ttm_buffer_object *bo,
                        *busy = !ret;
        }
 
-       if (ret && place && !bo->bdev->funcs->eviction_valuable(bo, place)) {
+       if (ret && place && (bo->resource->mem_type != place->mem_type ||
+               !bo->bdev->funcs->eviction_valuable(bo, place))) {
                ret = false;
                if (*locked) {
                        dma_resv_unlock(bo->base.resv);