drm/amdgpu: fix the lost duplicates checking
authorChunming Zhou <[email protected]>
Mon, 7 Dec 2015 07:02:52 +0000 (15:02 +0800)
committerAlex Deucher <[email protected]>
Wed, 9 Dec 2015 05:18:33 +0000 (00:18 -0500)
Signed-off-by: Chunming Zhou <[email protected]>
Reviewed-by: Christian König <[email protected]>
Reviewed-by: Jammy Zhou <[email protected]>
Cc: [email protected]
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c

index f6ea4b43a60c59b144bc5ff9916d96af38a59b24..9c253c535d26053ae80244a68617675c9b19fc3c 100644 (file)
@@ -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;