mirror of
https://github.com/torvalds/linux.git
synced 2026-05-04 06:22:40 -04:00
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:
committed by
Alex Deucher
parent
3c0eea6c35
commit
56467ebfb2
@@ -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(¤t->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;
|
||||
|
||||
Reference in New Issue
Block a user