Lines Matching full:job
34 struct amdgpu_job *job = to_amdgpu_job(s_job); in amdgpu_job_timedout() local
41 amdgpu_ring_soft_recovery(ring, job->vmid, s_job->s_fence->parent)) { in amdgpu_job_timedout()
47 amdgpu_vm_get_task_info(ring->adev, job->pasid, &ti); in amdgpu_job_timedout()
49 job->base.sched->name, atomic_read(&ring->fence_drv.last_seq), in amdgpu_job_timedout()
55 amdgpu_device_gpu_recover(ring->adev, job); in amdgpu_job_timedout()
64 struct amdgpu_job **job, struct amdgpu_vm *vm) in amdgpu_job_alloc() argument
73 *job = kzalloc(size, GFP_KERNEL); in amdgpu_job_alloc()
74 if (!*job) in amdgpu_job_alloc()
81 (*job)->base.sched = &adev->rings[0]->sched; in amdgpu_job_alloc()
82 (*job)->vm = vm; in amdgpu_job_alloc()
83 (*job)->ibs = (void *)&(*job)[1]; in amdgpu_job_alloc()
84 (*job)->num_ibs = num_ibs; in amdgpu_job_alloc()
86 amdgpu_sync_create(&(*job)->sync); in amdgpu_job_alloc()
87 amdgpu_sync_create(&(*job)->sched_sync); in amdgpu_job_alloc()
88 (*job)->vram_lost_counter = atomic_read(&adev->vram_lost_counter); in amdgpu_job_alloc()
89 (*job)->vm_pd_addr = AMDGPU_BO_INVALID_OFFSET; in amdgpu_job_alloc()
96 struct amdgpu_job **job) in amdgpu_job_alloc_with_ib() argument
100 r = amdgpu_job_alloc(adev, 1, job, NULL); in amdgpu_job_alloc_with_ib()
104 r = amdgpu_ib_get(adev, NULL, size, pool_type, &(*job)->ibs[0]); in amdgpu_job_alloc_with_ib()
106 kfree(*job); in amdgpu_job_alloc_with_ib()
111 void amdgpu_job_free_resources(struct amdgpu_job *job) in amdgpu_job_free_resources() argument
113 struct amdgpu_ring *ring = to_amdgpu_ring(job->base.sched); in amdgpu_job_free_resources()
118 f = job->base.s_fence ? &job->base.s_fence->finished : job->fence; in amdgpu_job_free_resources()
120 for (i = 0; i < job->num_ibs; ++i) in amdgpu_job_free_resources()
121 amdgpu_ib_free(ring->adev, &job->ibs[i], f); in amdgpu_job_free_resources()
126 struct amdgpu_job *job = to_amdgpu_job(s_job); in amdgpu_job_free_cb() local
130 dma_fence_put(job->fence); in amdgpu_job_free_cb()
131 amdgpu_sync_free(&job->sync); in amdgpu_job_free_cb()
132 amdgpu_sync_free(&job->sched_sync); in amdgpu_job_free_cb()
133 kfree(job); in amdgpu_job_free_cb()
136 void amdgpu_job_free(struct amdgpu_job *job) in amdgpu_job_free() argument
138 amdgpu_job_free_resources(job); in amdgpu_job_free()
140 dma_fence_put(job->fence); in amdgpu_job_free()
141 amdgpu_sync_free(&job->sync); in amdgpu_job_free()
142 amdgpu_sync_free(&job->sched_sync); in amdgpu_job_free()
143 kfree(job); in amdgpu_job_free()
146 int amdgpu_job_submit(struct amdgpu_job *job, struct drm_sched_entity *entity, in amdgpu_job_submit() argument
154 r = drm_sched_job_init(&job->base, entity, owner); in amdgpu_job_submit()
158 *f = dma_fence_get(&job->base.s_fence->finished); in amdgpu_job_submit()
159 amdgpu_job_free_resources(job); in amdgpu_job_submit()
160 drm_sched_entity_push_job(&job->base, entity); in amdgpu_job_submit()
165 int amdgpu_job_submit_direct(struct amdgpu_job *job, struct amdgpu_ring *ring, in amdgpu_job_submit_direct() argument
170 job->base.sched = &ring->sched; in amdgpu_job_submit_direct()
171 r = amdgpu_ib_schedule(ring, job->num_ibs, job->ibs, NULL, fence); in amdgpu_job_submit_direct()
172 job->fence = dma_fence_get(*fence); in amdgpu_job_submit_direct()
176 amdgpu_job_free(job); in amdgpu_job_submit_direct()
184 struct amdgpu_job *job = to_amdgpu_job(sched_job); in amdgpu_job_dependency() local
185 struct amdgpu_vm *vm = job->vm; in amdgpu_job_dependency()
189 fence = amdgpu_sync_get_fence(&job->sync); in amdgpu_job_dependency()
191 r = amdgpu_sync_fence(&job->sched_sync, fence); in amdgpu_job_dependency()
196 while (fence == NULL && vm && !job->vmid) { in amdgpu_job_dependency()
197 r = amdgpu_vmid_grab(vm, ring, &job->sync, in amdgpu_job_dependency()
198 &job->base.s_fence->finished, in amdgpu_job_dependency()
199 job); in amdgpu_job_dependency()
203 fence = amdgpu_sync_get_fence(&job->sync); in amdgpu_job_dependency()
213 struct amdgpu_job *job; in amdgpu_job_run() local
216 job = to_amdgpu_job(sched_job); in amdgpu_job_run()
217 finished = &job->base.s_fence->finished; in amdgpu_job_run()
219 BUG_ON(amdgpu_sync_peek_fence(&job->sync, NULL)); in amdgpu_job_run()
221 trace_amdgpu_sched_run_job(job); in amdgpu_job_run()
223 if (job->vram_lost_counter != atomic_read(&ring->adev->vram_lost_counter)) in amdgpu_job_run()
229 r = amdgpu_ib_schedule(ring, job->num_ibs, job->ibs, job, in amdgpu_job_run()
235 dma_fence_put(job->fence); in amdgpu_job_run()
236 job->fence = dma_fence_get(fence); in amdgpu_job_run()
238 amdgpu_job_free_resources(job); in amdgpu_job_run()