• Home
  • Raw
  • Download

Lines Matching refs:vc4

38 	struct vc4_dev *vc4 = to_vc4_dev(dev);  in vc4_queue_hangcheck()  local
40 mod_timer(&vc4->hangcheck.timer, in vc4_queue_hangcheck()
70 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_get_hang_state_ioctl() local
75 spin_lock_irqsave(&vc4->job_lock, irqflags); in vc4_get_hang_state_ioctl()
76 kernel_state = vc4->hang_state; in vc4_get_hang_state_ioctl()
78 spin_unlock_irqrestore(&vc4->job_lock, irqflags); in vc4_get_hang_state_ioctl()
88 spin_unlock_irqrestore(&vc4->job_lock, irqflags); in vc4_get_hang_state_ioctl()
92 vc4->hang_state = NULL; in vc4_get_hang_state_ioctl()
93 spin_unlock_irqrestore(&vc4->job_lock, irqflags); in vc4_get_hang_state_ioctl()
142 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_save_hang_state() local
156 spin_lock_irqsave(&vc4->job_lock, irqflags); in vc4_save_hang_state()
157 exec[0] = vc4_first_bin_job(vc4); in vc4_save_hang_state()
158 exec[1] = vc4_first_render_job(vc4); in vc4_save_hang_state()
160 spin_unlock_irqrestore(&vc4->job_lock, irqflags); in vc4_save_hang_state()
180 spin_unlock_irqrestore(&vc4->job_lock, irqflags); in vc4_save_hang_state()
207 spin_unlock_irqrestore(&vc4->job_lock, irqflags); in vc4_save_hang_state()
235 spin_lock_irqsave(&vc4->job_lock, irqflags); in vc4_save_hang_state()
236 if (vc4->hang_state) { in vc4_save_hang_state()
237 spin_unlock_irqrestore(&vc4->job_lock, irqflags); in vc4_save_hang_state()
240 vc4->hang_state = kernel_state; in vc4_save_hang_state()
241 spin_unlock_irqrestore(&vc4->job_lock, irqflags); in vc4_save_hang_state()
248 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_reset() local
252 mutex_lock(&vc4->power_lock); in vc4_reset()
253 if (vc4->power_refcount) { in vc4_reset()
257 pm_runtime_put_sync_suspend(&vc4->v3d->pdev->dev); in vc4_reset()
258 pm_runtime_get_sync(&vc4->v3d->pdev->dev); in vc4_reset()
260 mutex_unlock(&vc4->power_lock); in vc4_reset()
274 struct vc4_dev *vc4 = in vc4_reset_work() local
277 vc4_save_hang_state(vc4->dev); in vc4_reset_work()
279 vc4_reset(vc4->dev); in vc4_reset_work()
286 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_hangcheck_elapsed() local
291 spin_lock_irqsave(&vc4->job_lock, irqflags); in vc4_hangcheck_elapsed()
293 bin_exec = vc4_first_bin_job(vc4); in vc4_hangcheck_elapsed()
294 render_exec = vc4_first_render_job(vc4); in vc4_hangcheck_elapsed()
298 spin_unlock_irqrestore(&vc4->job_lock, irqflags); in vc4_hangcheck_elapsed()
314 spin_unlock_irqrestore(&vc4->job_lock, irqflags); in vc4_hangcheck_elapsed()
319 spin_unlock_irqrestore(&vc4->job_lock, irqflags); in vc4_hangcheck_elapsed()
325 schedule_work(&vc4->hangcheck.reset_work); in vc4_hangcheck_elapsed()
331 struct vc4_dev *vc4 = to_vc4_dev(dev); in submit_cl() local
344 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_wait_for_seqno() local
349 if (vc4->finished_seqno >= seqno) in vc4_wait_for_seqno()
359 prepare_to_wait(&vc4->job_wait_queue, &wait, in vc4_wait_for_seqno()
368 if (vc4->finished_seqno >= seqno) in vc4_wait_for_seqno()
382 finish_wait(&vc4->job_wait_queue, &wait); in vc4_wait_for_seqno()
391 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_flush_caches() local
415 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_submit_next_bin_job() local
419 exec = vc4_first_bin_job(vc4); in vc4_submit_next_bin_job()
439 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_submit_next_render_job() local
440 struct vc4_exec_info *exec = vc4_first_render_job(vc4); in vc4_submit_next_render_job()
451 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_move_job_to_render() local
452 bool was_empty = list_empty(&vc4->render_job_list); in vc4_move_job_to_render()
454 list_move_tail(&exec->head, &vc4->render_job_list); in vc4_move_job_to_render()
492 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_queue_submit() local
496 spin_lock_irqsave(&vc4->job_lock, irqflags); in vc4_queue_submit()
498 seqno = ++vc4->emit_seqno; in vc4_queue_submit()
502 list_add_tail(&exec->head, &vc4->bin_job_list); in vc4_queue_submit()
508 if (vc4_first_bin_job(vc4) == exec) { in vc4_queue_submit()
513 spin_unlock_irqrestore(&vc4->job_lock, irqflags); in vc4_queue_submit()
700 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_complete_exec() local
716 mutex_lock(&vc4->power_lock); in vc4_complete_exec()
717 if (--vc4->power_refcount == 0) { in vc4_complete_exec()
718 pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); in vc4_complete_exec()
719 pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); in vc4_complete_exec()
721 mutex_unlock(&vc4->power_lock); in vc4_complete_exec()
727 vc4_job_handle_completed(struct vc4_dev *vc4) in vc4_job_handle_completed() argument
732 spin_lock_irqsave(&vc4->job_lock, irqflags); in vc4_job_handle_completed()
733 while (!list_empty(&vc4->job_done_list)) { in vc4_job_handle_completed()
735 list_first_entry(&vc4->job_done_list, in vc4_job_handle_completed()
739 spin_unlock_irqrestore(&vc4->job_lock, irqflags); in vc4_job_handle_completed()
740 vc4_complete_exec(vc4->dev, exec); in vc4_job_handle_completed()
741 spin_lock_irqsave(&vc4->job_lock, irqflags); in vc4_job_handle_completed()
744 list_for_each_entry_safe(cb, cb_temp, &vc4->seqno_cb_list, work.entry) { in vc4_job_handle_completed()
745 if (cb->seqno <= vc4->finished_seqno) { in vc4_job_handle_completed()
751 spin_unlock_irqrestore(&vc4->job_lock, irqflags); in vc4_job_handle_completed()
765 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_queue_seqno_cb() local
772 spin_lock_irqsave(&vc4->job_lock, irqflags); in vc4_queue_seqno_cb()
773 if (seqno > vc4->finished_seqno) { in vc4_queue_seqno_cb()
775 list_add_tail(&cb->work.entry, &vc4->seqno_cb_list); in vc4_queue_seqno_cb()
779 spin_unlock_irqrestore(&vc4->job_lock, irqflags); in vc4_queue_seqno_cb()
791 struct vc4_dev *vc4 = in vc4_job_done_work() local
794 vc4_job_handle_completed(vc4); in vc4_job_done_work()
860 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_submit_cl_ioctl() local
876 mutex_lock(&vc4->power_lock); in vc4_submit_cl_ioctl()
877 if (vc4->power_refcount++ == 0) in vc4_submit_cl_ioctl()
878 ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); in vc4_submit_cl_ioctl()
879 mutex_unlock(&vc4->power_lock); in vc4_submit_cl_ioctl()
913 args->seqno = vc4->emit_seqno; in vc4_submit_cl_ioctl()
918 vc4_complete_exec(vc4->dev, exec); in vc4_submit_cl_ioctl()
926 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_gem_init() local
928 INIT_LIST_HEAD(&vc4->bin_job_list); in vc4_gem_init()
929 INIT_LIST_HEAD(&vc4->render_job_list); in vc4_gem_init()
930 INIT_LIST_HEAD(&vc4->job_done_list); in vc4_gem_init()
931 INIT_LIST_HEAD(&vc4->seqno_cb_list); in vc4_gem_init()
932 spin_lock_init(&vc4->job_lock); in vc4_gem_init()
934 INIT_WORK(&vc4->hangcheck.reset_work, vc4_reset_work); in vc4_gem_init()
935 setup_timer(&vc4->hangcheck.timer, in vc4_gem_init()
939 INIT_WORK(&vc4->job_done_work, vc4_job_done_work); in vc4_gem_init()
941 mutex_init(&vc4->power_lock); in vc4_gem_init()
947 struct vc4_dev *vc4 = to_vc4_dev(dev); in vc4_gem_destroy() local
952 WARN_ON(vc4->emit_seqno != vc4->finished_seqno); in vc4_gem_destroy()
957 if (vc4->overflow_mem) { in vc4_gem_destroy()
958 drm_gem_object_unreference_unlocked(&vc4->overflow_mem->base.base); in vc4_gem_destroy()
959 vc4->overflow_mem = NULL; in vc4_gem_destroy()
962 if (vc4->hang_state) in vc4_gem_destroy()
963 vc4_free_hang_state(dev, vc4->hang_state); in vc4_gem_destroy()