Lines Matching defs:job

17 #include "../job.h"
50 static void submit_wait(struct host1x_job *job, u32 id, u32 threshold)
52 struct host1x_cdma *cdma = &job->channel->cdma;
79 static void submit_setclass(struct host1x_job *job, u32 next_class)
81 struct host1x_cdma *cdma = &job->channel->cdma;
91 if (job->memory_context)
92 stream_id = job->memory_context->stream_id;
94 stream_id = job->engine_fallback_streamid;
99 host1x_opcode_setstreamid(job->engine_streamid_offset / 4),
109 static void submit_gathers(struct host1x_job *job, struct host1x_job_cmd *cmds, u32 num_cmds,
112 struct host1x_cdma *cdma = &job->channel->cdma;
114 struct device *dev = job->channel->dev;
128 submit_wait(job, cmd->wait.id, threshold);
129 submit_setclass(job, cmd->wait.next_class);
161 static inline void synchronize_syncpt_base(struct host1x_job *job)
163 struct host1x_syncpt *sp = job->syncpt;
170 host1x_cdma_push(&job->channel->cdma,
210 static void channel_program_cdma(struct host1x_job *job)
212 struct host1x_cdma *cdma = &job->channel->cdma;
213 struct host1x_syncpt *sp = job->syncpt;
219 if (job->num_cmds == 0)
221 if (!job->cmds[0].is_wait || job->cmds[0].wait.relative)
231 for (i = 0; i < job->num_cmds; i++) {
232 struct host1x_job_cmd *cmd = &job->cmds[i];
237 submit_wait(job, cmd->wait.id, cmd->wait.threshold);
247 host1x_opcode_acquire_mlock(job->class),
248 host1x_opcode_setclass(job->class, 0, 0),
250 host1x_opcode_setstreamid(job->engine_streamid_offset / 4));
254 host1x_cdma_push(&job->channel->cdma,
256 HOST1X_UCLASS_INCR_SYNCPT_INDX_F(job->syncpt->id) |
258 submit_wait(job, job->syncpt->id, fence);
259 submit_setclass(job, job->class);
262 job->syncpt_end = host1x_syncpt_incr_max(sp, job->syncpt_incrs);
263 submit_gathers(job, job->cmds + i, job->num_cmds - i, job->syncpt_end - job->syncpt_incrs);
267 host1x_cdma_push(&job->channel->cdma,
269 HOST1X_UCLASS_INCR_SYNCPT_INDX_F(job->syncpt->id) |
271 submit_wait(job, job->syncpt->id, fence);
275 HOST1X_OPCODE_NOP, host1x_opcode_release_mlock(job->class));
277 if (job->serialize) {
280 * previous job to finish before this one can commence.
285 host1x_class_host_wait_syncpt(job->syncpt->id,
291 synchronize_syncpt_base(job);
294 if (job->class)
296 host1x_opcode_setclass(job->class, 0, 0),
299 job->syncpt_end = host1x_syncpt_incr_max(sp, job->syncpt_incrs);
301 submit_gathers(job, job->cmds, job->num_cmds, job->syncpt_end - job->syncpt_incrs);
307 struct host1x_job *job = container_of(cb, struct host1x_job, fence_cb);
310 host1x_cdma_update(&job->channel->cdma);
313 static int channel_submit(struct host1x_job *job)
315 struct host1x_channel *ch = job->channel;
316 struct host1x_syncpt *sp = job->syncpt;
323 job->num_cmds, job->num_relocs,
324 job->syncpt->id, job->syncpt_incrs);
327 prev_max = job->syncpt_end = host1x_syncpt_read_max(sp);
339 err = host1x_cdma_begin(&ch->cdma, job);
345 channel_program_cdma(job);
349 * Create fence before submitting job to HW to avoid job completing
352 job->fence = host1x_fence_create(sp, syncval, true);
353 if (WARN(IS_ERR(job->fence), "Failed to create submit complete fence")) {
354 job->fence = NULL;
356 err = dma_fence_add_callback(job->fence, &job->fence_cb,
361 host1x_cdma_end(&ch->cdma, job);