Lines Matching refs:job
112 static int panfrost_job_get_slot(struct panfrost_job *job)
118 if (job->requirements & PANFROST_JD_REQ_FS)
123 if (job->requirements & PANFROST_JD_REQ_ONLY_COMPUTE) {
124 if ((job->requirements & PANFROST_JD_REQ_CORE_GRP_MASK) &&
125 (job->pfdev->features.nr_core_groups == 2))
127 if (panfrost_has_hw_issue(job->pfdev, HW_ISSUE_8987))
151 static void panfrost_job_hw_submit(struct panfrost_job *job, int js)
153 struct panfrost_device *pfdev = job->pfdev;
155 u64 jc_head = job->jc;
168 cfg = panfrost_mmu_as_get(pfdev, job->file_priv->mmu);
173 panfrost_job_write_affinity(pfdev, job->requirements, js);
190 job_write(pfdev, JS_FLUSH_ID_NEXT(js), job->flush_id);
194 job, js, jc_head);
219 int panfrost_job_push(struct panfrost_job *job)
221 struct panfrost_device *pfdev = job->pfdev;
222 int slot = panfrost_job_get_slot(job);
223 struct drm_sched_entity *entity = &job->file_priv->sched_entity[slot];
229 ret = drm_gem_lock_reservations(job->bos, job->bo_count,
236 ret = drm_sched_job_init(&job->base, entity, NULL);
242 job->render_done_fence = dma_fence_get(&job->base.s_fence->finished);
244 kref_get(&job->refcount); /* put by scheduler job completion */
246 panfrost_acquire_object_fences(job->bos, job->bo_count,
247 job->implicit_fences);
249 drm_sched_entity_push_job(&job->base, entity);
253 panfrost_attach_object_fences(job->bos, job->bo_count,
254 job->render_done_fence);
257 drm_gem_unlock_reservations(job->bos, job->bo_count, &acquire_ctx);
264 struct panfrost_job *job = container_of(ref, struct panfrost_job,
268 if (job->in_fences) {
269 for (i = 0; i < job->in_fence_count; i++)
270 dma_fence_put(job->in_fences[i]);
271 kvfree(job->in_fences);
273 if (job->implicit_fences) {
274 for (i = 0; i < job->bo_count; i++)
275 dma_fence_put(job->implicit_fences[i]);
276 kvfree(job->implicit_fences);
278 dma_fence_put(job->done_fence);
279 dma_fence_put(job->render_done_fence);
281 if (job->mappings) {
282 for (i = 0; i < job->bo_count; i++) {
283 if (!job->mappings[i])
286 atomic_dec(&job->mappings[i]->obj->gpu_usecount);
287 panfrost_gem_mapping_put(job->mappings[i]);
289 kvfree(job->mappings);
292 if (job->bos) {
293 for (i = 0; i < job->bo_count; i++)
294 drm_gem_object_put(job->bos[i]);
296 kvfree(job->bos);
299 kfree(job);
302 void panfrost_job_put(struct panfrost_job *job)
304 kref_put(&job->refcount, panfrost_job_cleanup);
309 struct panfrost_job *job = to_panfrost_job(sched_job);
313 panfrost_job_put(job);
319 struct panfrost_job *job = to_panfrost_job(sched_job);
324 for (i = 0; i < job->in_fence_count; i++) {
325 if (job->in_fences[i]) {
326 fence = job->in_fences[i];
327 job->in_fences[i] = NULL;
333 for (i = 0; i < job->bo_count; i++) {
334 if (job->implicit_fences[i]) {
335 fence = job->implicit_fences[i];
336 job->implicit_fences[i] = NULL;
346 struct panfrost_job *job = to_panfrost_job(sched_job);
347 struct panfrost_device *pfdev = job->pfdev;
348 int slot = panfrost_job_get_slot(job);
351 if (unlikely(job->base.s_fence->finished.error))
354 pfdev->jobs[slot] = job;
360 if (job->done_fence)
361 dma_fence_put(job->done_fence);
362 job->done_fence = dma_fence_get(fence);
364 panfrost_job_hw_submit(job, slot);
437 struct panfrost_job *job = to_panfrost_job(sched_job);
438 struct panfrost_device *pfdev = job->pfdev;
439 int js = panfrost_job_get_slot(job);
445 if (dma_fence_is_signaled(job->done_fence))
519 struct panfrost_job *job;
522 job = pfdev->jobs[j];
523 /* Only NULL if job timeout occurred */
524 if (job) {
527 panfrost_mmu_as_put(pfdev, job->file_priv->mmu);
530 dma_fence_signal_locked(job->done_fence);
556 * handler is in flight, it might have removed the bad job
557 * from the list, and we'll lose this job if the reset handler
566 * the job without making sure the timeout handler is not
608 irq = platform_get_irq_byname(to_platform_device(pfdev->dev), "job");
613 IRQF_SHARED, KBUILD_MODNAME "-job", pfdev);
615 dev_err(pfdev->dev, "failed to request job irq");