| From foo@baz Thu Feb 1 14:00:34 CET 2018 |
| From: "Christian König" <christian.koenig@amd.com> |
| Date: Fri, 24 Nov 2017 11:39:30 +0100 |
| Subject: drm/amdgpu: don't try to move pinned BOs |
| |
| From: "Christian König" <christian.koenig@amd.com> |
| |
| |
| [ Upstream commit 6edc6910ba4cd6eab309263539c8f09b8ad772bf ] |
| |
| Never try to move pinned BOs during CS. |
| |
| Signed-off-by: Christian König <christian.koenig@amd.com> |
| Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> |
| Signed-off-by: Alex Deucher <alexander.deucher@amd.com> |
| Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| --- |
| drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++++ |
| 1 file changed, 4 insertions(+) |
| |
| --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c |
| +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c |
| @@ -416,6 +416,10 @@ static bool amdgpu_cs_try_evict(struct a |
| if (candidate == lobj) |
| break; |
| |
| + /* We can't move pinned BOs here */ |
| + if (bo->pin_count) |
| + continue; |
| + |
| other = amdgpu_mem_type_to_domain(bo->tbo.mem.mem_type); |
| |
| /* Check if this BO is in one of the domains we need space for */ |