void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm);
struct amdgpu_bo_list_entry *amdgpu_vm_get_bos(struct amdgpu_device *adev,
struct amdgpu_vm *vm,
- struct list_head *head);
+ struct list_head *validated,
+ struct list_head *duplicates);
int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
struct amdgpu_sync *sync);
void amdgpu_vm_flush(struct amdgpu_ring *ring,
amdgpu_cs_buckets_get_list(&buckets, &p->validated);
}
+ INIT_LIST_HEAD(&duplicates);
p->vm_bos = amdgpu_vm_get_bos(p->adev, &fpriv->vm,
- &p->validated);
+ &p->validated, &duplicates);
if (need_mmap_lock)
down_read(¤t->mm->mmap_sem);
- INIT_LIST_HEAD(&duplicates);
r = ttm_eu_reserve_buffers(&p->ticket, &p->validated, true, &duplicates);
if (unlikely(r != 0))
goto error_reserve;
tv.shared = true;
list_add(&tv.head, &list);
- vm_bos = amdgpu_vm_get_bos(adev, bo_va->vm, &list);
+ vm_bos = amdgpu_vm_get_bos(adev, bo_va->vm, &list, &duplicates);
if (!vm_bos)
return;
* amdgpu_vm_get_bos - add the vm BOs to a validation list
*
* @vm: vm providing the BOs
- * @head: head of validation list
+ * @validated: head of validation list
+ * @duplicates: head of duplicates list
*
* Add the page directory to the list of BOs to
* validate for command submission (cayman+).
*/
struct amdgpu_bo_list_entry *amdgpu_vm_get_bos(struct amdgpu_device *adev,
- struct amdgpu_vm *vm,
- struct list_head *head)
+ struct amdgpu_vm *vm,
+ struct list_head *validated,
+ struct list_head *duplicates)
{
struct amdgpu_bo_list_entry *list;
unsigned i, idx;
list[0].priority = 0;
list[0].tv.bo = &vm->page_directory->tbo;
list[0].tv.shared = true;
- list_add(&list[0].tv.head, head);
+ list_add(&list[0].tv.head, validated);
for (i = 0, idx = 1; i <= vm->max_pde_used; i++) {
if (!vm->page_tables[i].bo)
list[idx].priority = 0;
list[idx].tv.bo = &list[idx].robj->tbo;
list[idx].tv.shared = true;
- list_add(&list[idx++].tv.head, head);
+ list_add(&list[idx++].tv.head, duplicates);
}
return list;