Lines Matching refs:id_mgr

203 	struct amdgpu_vmid_mgr *id_mgr = &adev->vm_manager.id_mgr[vmhub];  in amdgpu_vmid_grab_idle()  local
211 fences = kmalloc_array(sizeof(void *), id_mgr->num_ids, GFP_KERNEL); in amdgpu_vmid_grab_idle()
217 list_for_each_entry((*idle), &id_mgr->ids_lru, list) { in amdgpu_vmid_grab_idle()
225 if (&(*idle)->list == &id_mgr->ids_lru) { in amdgpu_vmid_grab_idle()
339 struct amdgpu_vmid_mgr *id_mgr = &adev->vm_manager.id_mgr[vmhub]; in amdgpu_vmid_grab_used() local
347 list_for_each_entry_reverse((*id), &id_mgr->ids_lru, list) { in amdgpu_vmid_grab_used()
412 struct amdgpu_vmid_mgr *id_mgr = &adev->vm_manager.id_mgr[vmhub]; in amdgpu_vmid_grab() local
417 mutex_lock(&id_mgr->lock); in amdgpu_vmid_grab()
448 list_move_tail(&id->list, &id_mgr->ids_lru); in amdgpu_vmid_grab()
458 job->vmid = id - id_mgr->ids; in amdgpu_vmid_grab()
463 mutex_unlock(&id_mgr->lock); in amdgpu_vmid_grab()
471 struct amdgpu_vmid_mgr *id_mgr; in amdgpu_vmid_alloc_reserved() local
475 id_mgr = &adev->vm_manager.id_mgr[vmhub]; in amdgpu_vmid_alloc_reserved()
476 mutex_lock(&id_mgr->lock); in amdgpu_vmid_alloc_reserved()
479 if (atomic_inc_return(&id_mgr->reserved_vmid_num) > in amdgpu_vmid_alloc_reserved()
482 atomic_dec(&id_mgr->reserved_vmid_num); in amdgpu_vmid_alloc_reserved()
487 idle = list_first_entry(&id_mgr->ids_lru, struct amdgpu_vmid, list); in amdgpu_vmid_alloc_reserved()
490 mutex_unlock(&id_mgr->lock); in amdgpu_vmid_alloc_reserved()
494 mutex_unlock(&id_mgr->lock); in amdgpu_vmid_alloc_reserved()
502 struct amdgpu_vmid_mgr *id_mgr = &adev->vm_manager.id_mgr[vmhub]; in amdgpu_vmid_free_reserved() local
504 mutex_lock(&id_mgr->lock); in amdgpu_vmid_free_reserved()
507 &id_mgr->ids_lru); in amdgpu_vmid_free_reserved()
509 atomic_dec(&id_mgr->reserved_vmid_num); in amdgpu_vmid_free_reserved()
511 mutex_unlock(&id_mgr->lock); in amdgpu_vmid_free_reserved()
525 struct amdgpu_vmid_mgr *id_mgr = &adev->vm_manager.id_mgr[vmhub]; in amdgpu_vmid_reset() local
526 struct amdgpu_vmid *id = &id_mgr->ids[vmid]; in amdgpu_vmid_reset()
528 mutex_lock(&id_mgr->lock); in amdgpu_vmid_reset()
536 mutex_unlock(&id_mgr->lock); in amdgpu_vmid_reset()
551 struct amdgpu_vmid_mgr *id_mgr = in amdgpu_vmid_reset_all() local
552 &adev->vm_manager.id_mgr[i]; in amdgpu_vmid_reset_all()
554 for (j = 1; j < id_mgr->num_ids; ++j) in amdgpu_vmid_reset_all()
571 struct amdgpu_vmid_mgr *id_mgr = in amdgpu_vmid_mgr_init() local
572 &adev->vm_manager.id_mgr[i]; in amdgpu_vmid_mgr_init()
574 mutex_init(&id_mgr->lock); in amdgpu_vmid_mgr_init()
575 INIT_LIST_HEAD(&id_mgr->ids_lru); in amdgpu_vmid_mgr_init()
576 atomic_set(&id_mgr->reserved_vmid_num, 0); in amdgpu_vmid_mgr_init()
579 for (j = 1; j < id_mgr->num_ids; ++j) { in amdgpu_vmid_mgr_init()
581 amdgpu_sync_create(&id_mgr->ids[j].active); in amdgpu_vmid_mgr_init()
582 list_add_tail(&id_mgr->ids[j].list, &id_mgr->ids_lru); in amdgpu_vmid_mgr_init()
599 struct amdgpu_vmid_mgr *id_mgr = in amdgpu_vmid_mgr_fini() local
600 &adev->vm_manager.id_mgr[i]; in amdgpu_vmid_mgr_fini()
602 mutex_destroy(&id_mgr->lock); in amdgpu_vmid_mgr_fini()
604 struct amdgpu_vmid *id = &id_mgr->ids[j]; in amdgpu_vmid_mgr_fini()