aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2016-01-19 11:48:14 +0000
committerAlex Deucher <[email protected]>2016-01-22 15:47:48 +0000
commit78d0e182b6c1f5336f6e8cbb197f403276dabc7f (patch)
tree2b875c6bdd68c46ac9f2f97eba2e48975d57d04b /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
parentdrm/amd/amdgpu: Improve amdgpu_dpm* macros to avoid unexpected result (v2) (diff)
downloadkernel-78d0e182b6c1f5336f6e8cbb197f403276dabc7f.tar.gz
kernel-78d0e182b6c1f5336f6e8cbb197f403276dabc7f.zip
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: [email protected] Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> (v1) Reviewed-by: Rex Zhu <[email protected]> (v1) Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_object.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index c3ce103b6a33..a2a16acee34d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -399,7 +399,8 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
}
if (fpfn > bo->placements[i].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].flags |= TTM_PL_FLAG_NO_EVICT;
}