mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 09:31:14 +00:00
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>
This commit is contained in:
parent
d1144b84fc
commit
3e19e69ab0
1 changed files with 6 additions and 3 deletions
|
@ -471,12 +471,15 @@ out:
|
||||||
|
|
||||||
static int amdgpu_gem_va_check(void *param, struct amdgpu_bo *bo)
|
static int amdgpu_gem_va_check(void *param, struct amdgpu_bo *bo)
|
||||||
{
|
{
|
||||||
unsigned domain = amdgpu_mem_type_to_domain(bo->tbo.mem.mem_type);
|
|
||||||
|
|
||||||
/* if anything is swapped out don't swap it in here,
|
/* if anything is swapped out don't swap it in here,
|
||||||
just abort and wait for the next CS */
|
just abort and wait for the next CS */
|
||||||
|
if (!amdgpu_bo_gpu_accessible(bo))
|
||||||
|
return -ERESTARTSYS;
|
||||||
|
|
||||||
return domain == AMDGPU_GEM_DOMAIN_CPU ? -ERESTARTSYS : 0;
|
if (bo->shadow && !amdgpu_bo_gpu_accessible(bo->shadow))
|
||||||
|
return -ERESTARTSYS;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue