Lines Matching refs:job

50 static void submit_wait(struct host1x_job *job, u32 id, u32 threshold,  in submit_wait()  argument
53 struct host1x_cdma *cdma = &job->channel->cdma; in submit_wait()
63 if (job->memory_context) in submit_wait()
64 stream_id = job->memory_context->stream_id; in submit_wait()
66 stream_id = job->engine_fallback_streamid; in submit_wait()
79 host1x_cdma_push_wide(&job->channel->cdma, in submit_wait()
80 host1x_opcode_setclass(job->class, 0, 0), in submit_wait()
82 host1x_opcode_setstreamid(job->engine_streamid_offset / 4), in submit_wait()
113 static void submit_gathers(struct host1x_job *job, u32 job_syncpt_base) in submit_gathers() argument
115 struct host1x_cdma *cdma = &job->channel->cdma; in submit_gathers()
117 struct device *dev = job->channel->dev; in submit_gathers()
122 for (i = 0; i < job->num_cmds; i++) { in submit_gathers()
123 struct host1x_job_cmd *cmd = &job->cmds[i]; in submit_gathers()
131 submit_wait(job, cmd->wait.id, threshold, cmd->wait.next_class); in submit_gathers()
163 static inline void synchronize_syncpt_base(struct host1x_job *job) in synchronize_syncpt_base() argument
165 struct host1x_syncpt *sp = job->syncpt; in synchronize_syncpt_base()
172 host1x_cdma_push(&job->channel->cdma, in synchronize_syncpt_base()
212 static void channel_program_cdma(struct host1x_job *job) in channel_program_cdma() argument
214 struct host1x_cdma *cdma = &job->channel->cdma; in channel_program_cdma()
215 struct host1x_syncpt *sp = job->syncpt; in channel_program_cdma()
222 host1x_opcode_acquire_mlock(job->class), in channel_program_cdma()
223 host1x_opcode_setclass(job->class, 0, 0), in channel_program_cdma()
225 host1x_opcode_setstreamid(job->engine_streamid_offset / 4)); in channel_program_cdma()
229 host1x_cdma_push(&job->channel->cdma, in channel_program_cdma()
231 HOST1X_UCLASS_INCR_SYNCPT_INDX_F(job->syncpt->id) | in channel_program_cdma()
233 submit_wait(job, job->syncpt->id, fence, job->class); in channel_program_cdma()
236 job->syncpt_end = host1x_syncpt_incr_max(sp, job->syncpt_incrs); in channel_program_cdma()
237 submit_gathers(job, job->syncpt_end - job->syncpt_incrs); in channel_program_cdma()
241 host1x_cdma_push(&job->channel->cdma, in channel_program_cdma()
243 HOST1X_UCLASS_INCR_SYNCPT_INDX_F(job->syncpt->id) | in channel_program_cdma()
245 submit_wait(job, job->syncpt->id, fence, job->class); in channel_program_cdma()
249 HOST1X_OPCODE_NOP, host1x_opcode_release_mlock(job->class)); in channel_program_cdma()
251 if (job->serialize) { in channel_program_cdma()
259 host1x_class_host_wait_syncpt(job->syncpt->id, in channel_program_cdma()
265 synchronize_syncpt_base(job); in channel_program_cdma()
268 if (job->class) in channel_program_cdma()
270 host1x_opcode_setclass(job->class, 0, 0), in channel_program_cdma()
273 job->syncpt_end = host1x_syncpt_incr_max(sp, job->syncpt_incrs); in channel_program_cdma()
275 submit_gathers(job, job->syncpt_end - job->syncpt_incrs); in channel_program_cdma()
281 struct host1x_job *job = container_of(cb, struct host1x_job, fence_cb); in job_complete_callback() local
284 host1x_cdma_update(&job->channel->cdma); in job_complete_callback()
287 static int channel_submit(struct host1x_job *job) in channel_submit() argument
289 struct host1x_channel *ch = job->channel; in channel_submit()
290 struct host1x_syncpt *sp = job->syncpt; in channel_submit()
297 job->num_cmds, job->num_relocs, in channel_submit()
298 job->syncpt->id, job->syncpt_incrs); in channel_submit()
301 prev_max = job->syncpt_end = host1x_syncpt_read_max(sp); in channel_submit()
313 err = host1x_cdma_begin(&ch->cdma, job); in channel_submit()
319 channel_program_cdma(job); in channel_submit()
326 job->fence = host1x_fence_create(sp, syncval, true); in channel_submit()
327 if (WARN(IS_ERR(job->fence), "Failed to create submit complete fence")) { in channel_submit()
328 job->fence = NULL; in channel_submit()
330 err = dma_fence_add_callback(job->fence, &job->fence_cb, in channel_submit()
335 host1x_cdma_end(&ch->cdma, job); in channel_submit()