diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2016-12-12 05:53:11 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-01-27 11:13:18 -0500 |
commit | 3e19e69ab01f53d68fc85e2fedcdd93c74994415 (patch) | |
tree | f53fa4b3d8a8908979f0fff3b646d62e92418d39 /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |
parent | d1144b84fc15755afcfefe5ced1748acf6c5a7c2 (diff) |
drm/amd/amdgpu: add check that shadow page tables are GPU-accessible
Skip amdgpu_gem_va_update_vm otherwise. Also clean up the check for the
non-shadow page tables using the new helper function.
This fixes a crash with the stack trace:
amdgpu_gem_va_update_vm
-> amdgpu_vm_update_page_directory
-> amdgpu_ttm_bind
-> amdgpu_gtt_mgr_alloc
v2: actually check bo->shadow instead of just checking bo twice
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index 4e1eb05689ec..9bd1b4eae32e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |||
@@ -471,12 +471,15 @@ out: | |||
471 | 471 | ||
472 | static int amdgpu_gem_va_check(void *param, struct amdgpu_bo *bo) | 472 | static int amdgpu_gem_va_check(void *param, struct amdgpu_bo *bo) |
473 | { | 473 | { |
474 | unsigned domain = amdgpu_mem_type_to_domain(bo->tbo.mem.mem_type); | ||
475 | |||
476 | /* if anything is swapped out don't swap it in here, | 474 | /* if anything is swapped out don't swap it in here, |
477 | just abort and wait for the next CS */ | 475 | just abort and wait for the next CS */ |
476 | if (!amdgpu_bo_gpu_accessible(bo)) | ||
477 | return -ERESTARTSYS; | ||
478 | |||
479 | if (bo->shadow && !amdgpu_bo_gpu_accessible(bo->shadow)) | ||
480 | return -ERESTARTSYS; | ||
478 | 481 | ||
479 | return domain == AMDGPU_GEM_DOMAIN_CPU ? -ERESTARTSYS : 0; | 482 | return 0; |
480 | } | 483 | } |
481 | 484 | ||
482 | /** | 485 | /** |