Lines Matching full:v3d
5 * DOC: Broadcom V3D scheduling
121 v3d_switch_perfmon(struct v3d_dev *v3d, struct v3d_job *job) in v3d_switch_perfmon() argument
123 if (job->perfmon != v3d->active_perfmon) in v3d_switch_perfmon()
124 v3d_perfmon_stop(v3d, v3d->active_perfmon, true); in v3d_switch_perfmon()
126 if (job->perfmon && v3d->active_perfmon != job->perfmon) in v3d_switch_perfmon()
127 v3d_perfmon_start(v3d, job->perfmon); in v3d_switch_perfmon()
133 struct v3d_dev *v3d = job->v3d; in v3d_job_start_stats() local
135 struct v3d_stats *global_stats = &v3d->queue[queue].stats; in v3d_job_start_stats()
165 struct v3d_dev *v3d = job->v3d; in v3d_job_update_stats() local
167 struct v3d_stats *global_stats = &v3d->queue[queue].stats; in v3d_job_update_stats()
180 struct v3d_dev *v3d = job->base.v3d; in v3d_bin_job_run() local
181 struct drm_device *dev = &v3d->drm; in v3d_bin_job_run()
191 spin_lock_irqsave(&v3d->job_lock, irqflags); in v3d_bin_job_run()
192 v3d->bin_job = job; in v3d_bin_job_run()
197 spin_unlock_irqrestore(&v3d->job_lock, irqflags); in v3d_bin_job_run()
199 v3d_invalidate_caches(v3d); in v3d_bin_job_run()
201 fence = v3d_fence_create(v3d, V3D_BIN); in v3d_bin_job_run()
213 v3d_switch_perfmon(v3d, &job->base); in v3d_bin_job_run()
236 struct v3d_dev *v3d = job->base.v3d; in v3d_render_job_run() local
237 struct drm_device *dev = &v3d->drm; in v3d_render_job_run()
243 v3d->render_job = job; in v3d_render_job_run()
251 v3d_invalidate_caches(v3d); in v3d_render_job_run()
253 fence = v3d_fence_create(v3d, V3D_RENDER); in v3d_render_job_run()
265 v3d_switch_perfmon(v3d, &job->base); in v3d_render_job_run()
282 struct v3d_dev *v3d = job->base.v3d; in v3d_tfu_job_run() local
283 struct drm_device *dev = &v3d->drm; in v3d_tfu_job_run()
286 fence = v3d_fence_create(v3d, V3D_TFU); in v3d_tfu_job_run()
290 v3d->tfu_job = job; in v3d_tfu_job_run()
299 V3D_WRITE(V3D_TFU_IIA(v3d->ver), job->args.iia); in v3d_tfu_job_run()
300 V3D_WRITE(V3D_TFU_IIS(v3d->ver), job->args.iis); in v3d_tfu_job_run()
301 V3D_WRITE(V3D_TFU_ICA(v3d->ver), job->args.ica); in v3d_tfu_job_run()
302 V3D_WRITE(V3D_TFU_IUA(v3d->ver), job->args.iua); in v3d_tfu_job_run()
303 V3D_WRITE(V3D_TFU_IOA(v3d->ver), job->args.ioa); in v3d_tfu_job_run()
304 if (v3d->ver >= 71) in v3d_tfu_job_run()
306 V3D_WRITE(V3D_TFU_IOS(v3d->ver), job->args.ios); in v3d_tfu_job_run()
307 V3D_WRITE(V3D_TFU_COEF0(v3d->ver), job->args.coef[0]); in v3d_tfu_job_run()
308 if (v3d->ver >= 71 || (job->args.coef[0] & V3D_TFU_COEF0_USECOEF)) { in v3d_tfu_job_run()
309 V3D_WRITE(V3D_TFU_COEF1(v3d->ver), job->args.coef[1]); in v3d_tfu_job_run()
310 V3D_WRITE(V3D_TFU_COEF2(v3d->ver), job->args.coef[2]); in v3d_tfu_job_run()
311 V3D_WRITE(V3D_TFU_COEF3(v3d->ver), job->args.coef[3]); in v3d_tfu_job_run()
314 V3D_WRITE(V3D_TFU_ICFG(v3d->ver), job->args.icfg | V3D_TFU_ICFG_IOC); in v3d_tfu_job_run()
323 struct v3d_dev *v3d = job->base.v3d; in v3d_csd_job_run() local
324 struct drm_device *dev = &v3d->drm; in v3d_csd_job_run()
328 v3d->csd_job = job; in v3d_csd_job_run()
330 v3d_invalidate_caches(v3d); in v3d_csd_job_run()
332 fence = v3d_fence_create(v3d, V3D_CSD); in v3d_csd_job_run()
343 v3d_switch_perfmon(v3d, &job->base); in v3d_csd_job_run()
345 csd_cfg0_reg = V3D_CSD_QUEUED_CFG0(v3d->ver); in v3d_csd_job_run()
349 /* Although V3D 7.1 has an eighth configuration register, we are not in v3d_csd_job_run()
354 if (v3d->ver >= 71) in v3d_csd_job_run()
503 struct v3d_dev *v3d = job->base.v3d; in v3d_reset_performance_queries() local
515 v3d_perfmon_stop(v3d, perfmon, false); in v3d_reset_performance_queries()
535 struct v3d_dev *v3d = job->base.v3d; in v3d_write_performance_query_result() local
550 v3d_perfmon_stop(v3d, perfmon, true); in v3d_write_performance_query_result()
613 struct v3d_dev *v3d = job->base.v3d; in v3d_cpu_job_run() local
615 v3d->cpu_job = job; in v3d_cpu_job_run()
623 trace_v3d_cpu_job_begin(&v3d->drm, job->job_type); in v3d_cpu_job_run()
627 trace_v3d_cpu_job_end(&v3d->drm, job->job_type); in v3d_cpu_job_run()
637 struct v3d_dev *v3d = job->v3d; in v3d_cache_clean_job_run() local
641 v3d_clean_caches(v3d); in v3d_cache_clean_job_run()
649 v3d_gpu_reset_for_timeout(struct v3d_dev *v3d, struct drm_sched_job *sched_job) in v3d_gpu_reset_for_timeout() argument
653 mutex_lock(&v3d->reset_lock); in v3d_gpu_reset_for_timeout()
657 drm_sched_stop(&v3d->queue[q].sched, sched_job); in v3d_gpu_reset_for_timeout()
663 v3d_reset(v3d); in v3d_gpu_reset_for_timeout()
666 drm_sched_resubmit_jobs(&v3d->queue[q].sched); in v3d_gpu_reset_for_timeout()
670 drm_sched_start(&v3d->queue[q].sched); in v3d_gpu_reset_for_timeout()
673 mutex_unlock(&v3d->reset_lock); in v3d_gpu_reset_for_timeout()
688 struct v3d_dev *v3d = job->v3d; in v3d_cl_job_timedout() local
698 return v3d_gpu_reset_for_timeout(v3d, sched_job); in v3d_cl_job_timedout()
724 return v3d_gpu_reset_for_timeout(job->v3d, sched_job); in v3d_generic_job_timedout()
731 struct v3d_dev *v3d = job->base.v3d; in v3d_csd_job_timedout() local
732 u32 batches = V3D_CORE_READ(0, V3D_CSD_CURRENT_CFG4(v3d->ver)); in v3d_csd_job_timedout()
742 return v3d_gpu_reset_for_timeout(v3d, sched_job); in v3d_csd_job_timedout()
782 v3d_sched_init(struct v3d_dev *v3d) in v3d_sched_init() argument
789 ret = drm_sched_init(&v3d->queue[V3D_BIN].sched, in v3d_sched_init()
794 NULL, "v3d_bin", v3d->drm.dev); in v3d_sched_init()
798 ret = drm_sched_init(&v3d->queue[V3D_RENDER].sched, in v3d_sched_init()
803 NULL, "v3d_render", v3d->drm.dev); in v3d_sched_init()
807 ret = drm_sched_init(&v3d->queue[V3D_TFU].sched, in v3d_sched_init()
812 NULL, "v3d_tfu", v3d->drm.dev); in v3d_sched_init()
816 if (v3d_has_csd(v3d)) { in v3d_sched_init()
817 ret = drm_sched_init(&v3d->queue[V3D_CSD].sched, in v3d_sched_init()
822 NULL, "v3d_csd", v3d->drm.dev); in v3d_sched_init()
826 ret = drm_sched_init(&v3d->queue[V3D_CACHE_CLEAN].sched, in v3d_sched_init()
831 NULL, "v3d_cache_clean", v3d->drm.dev); in v3d_sched_init()
836 ret = drm_sched_init(&v3d->queue[V3D_CPU].sched, in v3d_sched_init()
841 NULL, "v3d_cpu", v3d->drm.dev); in v3d_sched_init()
848 v3d_sched_fini(v3d); in v3d_sched_init()
853 v3d_sched_fini(struct v3d_dev *v3d) in v3d_sched_fini() argument
858 if (v3d->queue[q].sched.ready) in v3d_sched_fini()
859 drm_sched_fini(&v3d->queue[q].sched); in v3d_sched_fini()