diff options
author | Christian König <christian.koenig@amd.com> | 2015-12-11 09:16:32 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-12-18 17:29:45 -0500 |
commit | 56467ebfb254836dc30eb45d4ac8a46a400bfad6 (patch) | |
tree | 19629224afdc3328ede08e60ea46f0666c2d5ffe /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |
parent | 3c0eea6c35d932c4d25070868067dc9cd9ceab91 (diff) |
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>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 9591c13781bd..3fb21ecd29e0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |||
@@ -387,8 +387,7 @@ static int amdgpu_cs_parser_relocs(struct amdgpu_cs_parser *p) | |||
387 | } | 387 | } |
388 | 388 | ||
389 | INIT_LIST_HEAD(&duplicates); | 389 | INIT_LIST_HEAD(&duplicates); |
390 | p->vm_bos = amdgpu_vm_get_bos(p->adev, &fpriv->vm, | 390 | amdgpu_vm_get_pd_bo(&fpriv->vm, &p->validated, &p->vm_pd); |
391 | &p->validated, &duplicates); | ||
392 | 391 | ||
393 | if (need_mmap_lock) | 392 | if (need_mmap_lock) |
394 | down_read(¤t->mm->mmap_sem); | 393 | down_read(¤t->mm->mmap_sem); |
@@ -397,6 +396,12 @@ static int amdgpu_cs_parser_relocs(struct amdgpu_cs_parser *p) | |||
397 | if (unlikely(r != 0)) | 396 | if (unlikely(r != 0)) |
398 | goto error_reserve; | 397 | goto error_reserve; |
399 | 398 | ||
399 | p->vm_bos = amdgpu_vm_get_pt_bos(&fpriv->vm, &duplicates); | ||
400 | if (!p->vm_bos) { | ||
401 | r = -ENOMEM; | ||
402 | goto error_validate; | ||
403 | } | ||
404 | |||
400 | r = amdgpu_cs_list_validate(p->adev, &fpriv->vm, &p->validated); | 405 | r = amdgpu_cs_list_validate(p->adev, &fpriv->vm, &p->validated); |
401 | if (r) | 406 | if (r) |
402 | goto error_validate; | 407 | goto error_validate; |