Commit 78d0e182 authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: fix amdgpu_bo_pin_restricted VRAM placing v2

We could pin BOs into invisible VRAM otherwise.

v2: make logic more readable as suggested by Michel

Cc: stable@vger.kernel.org
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com> (v1)
Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
parent 4b5ece24
...@@ -399,7 +399,8 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain, ...@@ -399,7 +399,8 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
} }
if (fpfn > bo->placements[i].fpfn) if (fpfn > bo->placements[i].fpfn)
bo->placements[i].fpfn = fpfn; bo->placements[i].fpfn = fpfn;
if (lpfn && lpfn < bo->placements[i].lpfn) if (!bo->placements[i].lpfn ||
(lpfn && lpfn < bo->placements[i].lpfn))
bo->placements[i].lpfn = lpfn; bo->placements[i].lpfn = lpfn;
bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT; bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
} }
......
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