Lines Matching full:job
112 * panfrost_lookup_bos() - Sets up job->bo[] with the GEM objects
113 * referenced by the job.
117 * @job: job being set up
119 * Resolve handles from userspace to BOs and attach them to job.
128 struct panfrost_job *job) in panfrost_lookup_bos() argument
135 job->bo_count = args->bo_handle_count; in panfrost_lookup_bos()
137 if (!job->bo_count) in panfrost_lookup_bos()
140 job->implicit_fences = kvmalloc_array(job->bo_count, in panfrost_lookup_bos()
143 if (!job->implicit_fences) in panfrost_lookup_bos()
148 job->bo_count, &job->bos); in panfrost_lookup_bos()
152 job->mappings = kvmalloc_array(job->bo_count, in panfrost_lookup_bos()
155 if (!job->mappings) in panfrost_lookup_bos()
158 for (i = 0; i < job->bo_count; i++) { in panfrost_lookup_bos()
161 bo = to_panfrost_bo(job->bos[i]); in panfrost_lookup_bos()
169 job->mappings[i] = mapping; in panfrost_lookup_bos()
176 * panfrost_copy_in_sync() - Sets up job->in_fences[] with the sync objects
177 * referenced by the job.
181 * @job: job being set up
183 * Resolve syncobjs from userspace to fences and attach them to job.
192 struct panfrost_job *job) in panfrost_copy_in_sync() argument
198 job->in_fence_count = args->in_sync_count; in panfrost_copy_in_sync()
200 if (!job->in_fence_count) in panfrost_copy_in_sync()
203 job->in_fences = kvmalloc_array(job->in_fence_count, in panfrost_copy_in_sync()
206 if (!job->in_fences) { in panfrost_copy_in_sync()
207 DRM_DEBUG("Failed to allocate job in fences\n"); in panfrost_copy_in_sync()
211 handles = kvmalloc_array(job->in_fence_count, sizeof(u32), GFP_KERNEL); in panfrost_copy_in_sync()
220 job->in_fence_count * sizeof(u32))) { in panfrost_copy_in_sync()
226 for (i = 0; i < job->in_fence_count; i++) { in panfrost_copy_in_sync()
228 &job->in_fences[i]); in panfrost_copy_in_sync()
244 struct panfrost_job *job; in panfrost_ioctl_submit() local
259 job = kzalloc(sizeof(*job), GFP_KERNEL); in panfrost_ioctl_submit()
260 if (!job) { in panfrost_ioctl_submit()
265 kref_init(&job->refcount); in panfrost_ioctl_submit()
267 job->pfdev = pfdev; in panfrost_ioctl_submit()
268 job->jc = args->jc; in panfrost_ioctl_submit()
269 job->requirements = args->requirements; in panfrost_ioctl_submit()
270 job->flush_id = panfrost_gpu_get_latest_flush_id(pfdev); in panfrost_ioctl_submit()
271 job->file_priv = file->driver_priv; in panfrost_ioctl_submit()
273 ret = panfrost_copy_in_sync(dev, file, args, job); in panfrost_ioctl_submit()
277 ret = panfrost_lookup_bos(dev, file, args, job); in panfrost_ioctl_submit()
281 ret = panfrost_job_push(job); in panfrost_ioctl_submit()
285 /* Update the return sync object for the job */ in panfrost_ioctl_submit()
287 drm_syncobj_replace_fence(sync_out, job->render_done_fence); in panfrost_ioctl_submit()
290 panfrost_job_put(job); in panfrost_ioctl_submit()