drm/amdgpu: split VM PD and PT handling during CS

This way we avoid the extra allocation for the page directory entry.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
This commit is contained in:
Christian König
2015-12-11 15:16:32 +01:00
committed by Alex Deucher
parent 3c0eea6c35
commit 56467ebfb2
4 changed files with 51 additions and 29 deletions

View File

@@ -387,8 +387,7 @@ static int amdgpu_cs_parser_relocs(struct amdgpu_cs_parser *p)
}
INIT_LIST_HEAD(&duplicates);
p->vm_bos = amdgpu_vm_get_bos(p->adev, &fpriv->vm,
&p->validated, &duplicates);
amdgpu_vm_get_pd_bo(&fpriv->vm, &p->validated, &p->vm_pd);
if (need_mmap_lock)
down_read(&current->mm->mmap_sem);
@@ -397,6 +396,12 @@ static int amdgpu_cs_parser_relocs(struct amdgpu_cs_parser *p)
if (unlikely(r != 0))
goto error_reserve;
p->vm_bos = amdgpu_vm_get_pt_bos(&fpriv->vm, &duplicates);
if (!p->vm_bos) {
r = -ENOMEM;
goto error_validate;
}
r = amdgpu_cs_list_validate(p->adev, &fpriv->vm, &p->validated);
if (r)
goto error_validate;