summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChunming Zhou <David1.Zhou@amd.com>2015-12-07 15:02:52 +0800
committerAlex Deucher <alexander.deucher@amd.com>2015-12-09 00:18:33 -0500
commite410b5cbabe70b1f1da08146481f6bd7e904643c (patch)
tree0184b2e5e16d37abd59407e1012e67fb49d46cf2
parentdf4d4aa96d1db1657e14b848a341fc614c8d61eb (diff)
downloadlinux-e410b5cbabe70b1f1da08146481f6bd7e904643c.tar.bz2
drm/amdgpu: fix the lost duplicates checking
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Cc: stable@vger.kernel.org
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index f6ea4b43a60c..9c253c535d26 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -477,6 +477,14 @@ static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev,
if (domain == AMDGPU_GEM_DOMAIN_CPU)
goto error_unreserve;
}
+ list_for_each_entry(entry, &duplicates, head) {
+ domain = amdgpu_mem_type_to_domain(entry->bo->mem.mem_type);
+ /* if anything is swapped out don't swap it in here,
+ just abort and wait for the next CS */
+ if (domain == AMDGPU_GEM_DOMAIN_CPU)
+ goto error_unreserve;
+ }
+
r = amdgpu_vm_update_page_directory(adev, bo_va->vm);
if (r)
goto error_unreserve;