Lines Matching refs:exec
157 struct vc4_exec_info *exec[2]; in vc4_save_hang_state() local
169 exec[0] = vc4_first_bin_job(vc4); in vc4_save_hang_state()
170 exec[1] = vc4_first_render_job(vc4); in vc4_save_hang_state()
171 if (!exec[0] && !exec[1]) { in vc4_save_hang_state()
179 if (!exec[i]) in vc4_save_hang_state()
183 list_for_each_entry(bo, &exec[i]->unref_list, unref_head) in vc4_save_hang_state()
185 state->bo_count += exec[i]->bo_count + unref_list_count; in vc4_save_hang_state()
198 if (!exec[i]) in vc4_save_hang_state()
201 for (j = 0; j < exec[i]->bo_count; j++) { in vc4_save_hang_state()
202 bo = to_vc4_bo(exec[i]->bo[j]); in vc4_save_hang_state()
210 drm_gem_object_get(exec[i]->bo[j]); in vc4_save_hang_state()
211 kernel_state->bo[k++] = exec[i]->bo[j]; in vc4_save_hang_state()
214 list_for_each_entry(bo, &exec[i]->unref_list, unref_head) { in vc4_save_hang_state()
225 if (exec[0]) in vc4_save_hang_state()
226 state->start_bin = exec[0]->ct0ca; in vc4_save_hang_state()
227 if (exec[1]) in vc4_save_hang_state()
228 state->start_render = exec[1]->ct1ca; in vc4_save_hang_state()
475 struct vc4_exec_info *exec; in vc4_submit_next_bin_job() local
481 exec = vc4_first_bin_job(vc4); in vc4_submit_next_bin_job()
482 if (!exec) in vc4_submit_next_bin_job()
490 if (exec->perfmon && vc4->active_perfmon != exec->perfmon) in vc4_submit_next_bin_job()
491 vc4_perfmon_start(vc4, exec->perfmon); in vc4_submit_next_bin_job()
496 if (exec->ct0ca != exec->ct0ea) { in vc4_submit_next_bin_job()
497 trace_vc4_submit_cl(dev, false, exec->seqno, exec->ct0ca, in vc4_submit_next_bin_job()
498 exec->ct0ea); in vc4_submit_next_bin_job()
499 submit_cl(dev, 0, exec->ct0ca, exec->ct0ea); in vc4_submit_next_bin_job()
503 vc4_move_job_to_render(dev, exec); in vc4_submit_next_bin_job()
511 if (next && next->perfmon == exec->perfmon) in vc4_submit_next_bin_job()
520 struct vc4_exec_info *exec = vc4_first_render_job(vc4); in vc4_submit_next_render_job() local
522 if (!exec) in vc4_submit_next_render_job()
536 trace_vc4_submit_cl(dev, true, exec->seqno, exec->ct1ca, exec->ct1ea); in vc4_submit_next_render_job()
537 submit_cl(dev, 1, exec->ct1ca, exec->ct1ea); in vc4_submit_next_render_job()
541 vc4_move_job_to_render(struct drm_device *dev, struct vc4_exec_info *exec) in vc4_move_job_to_render() argument
549 list_move_tail(&exec->head, &vc4->render_job_list); in vc4_move_job_to_render()
555 vc4_update_bo_seqnos(struct vc4_exec_info *exec, uint64_t seqno) in vc4_update_bo_seqnos() argument
560 for (i = 0; i < exec->bo_count; i++) { in vc4_update_bo_seqnos()
561 bo = to_vc4_bo(exec->bo[i]); in vc4_update_bo_seqnos()
564 dma_resv_add_fence(bo->base.base.resv, exec->fence, in vc4_update_bo_seqnos()
568 list_for_each_entry(bo, &exec->unref_list, unref_head) { in vc4_update_bo_seqnos()
572 for (i = 0; i < exec->rcl_write_bo_count; i++) { in vc4_update_bo_seqnos()
573 bo = to_vc4_bo(&exec->rcl_write_bo[i]->base); in vc4_update_bo_seqnos()
576 dma_resv_add_fence(bo->base.base.resv, exec->fence, in vc4_update_bo_seqnos()
583 struct vc4_exec_info *exec, in vc4_unlock_bo_reservations() argument
588 for (i = 0; i < exec->bo_count; i++) in vc4_unlock_bo_reservations()
589 dma_resv_unlock(exec->bo[i]->resv); in vc4_unlock_bo_reservations()
603 struct vc4_exec_info *exec, in vc4_lock_bo_reservations() argument
614 bo = exec->bo[contended_lock]; in vc4_lock_bo_reservations()
622 for (i = 0; i < exec->bo_count; i++) { in vc4_lock_bo_reservations()
626 bo = exec->bo[i]; in vc4_lock_bo_reservations()
633 bo = exec->bo[j]; in vc4_lock_bo_reservations()
638 bo = exec->bo[contended_lock]; in vc4_lock_bo_reservations()
658 for (i = 0; i < exec->bo_count; i++) { in vc4_lock_bo_reservations()
659 bo = exec->bo[i]; in vc4_lock_bo_reservations()
663 vc4_unlock_bo_reservations(dev, exec, acquire_ctx); in vc4_lock_bo_reservations()
681 vc4_queue_submit(struct drm_device *dev, struct vc4_exec_info *exec, in vc4_queue_submit() argument
699 exec->seqno = seqno; in vc4_queue_submit()
702 vc4->dma_fence_context, exec->seqno); in vc4_queue_submit()
703 fence->seqno = exec->seqno; in vc4_queue_submit()
704 exec->fence = &fence->base; in vc4_queue_submit()
707 drm_syncobj_replace_fence(out_sync, exec->fence); in vc4_queue_submit()
709 vc4_update_bo_seqnos(exec, seqno); in vc4_queue_submit()
711 vc4_unlock_bo_reservations(dev, exec, acquire_ctx); in vc4_queue_submit()
713 list_add_tail(&exec->head, &vc4->bin_job_list); in vc4_queue_submit()
721 if (vc4_first_bin_job(vc4) == exec && in vc4_queue_submit()
722 (!renderjob || renderjob->perfmon == exec->perfmon)) { in vc4_queue_submit()
746 struct vc4_exec_info *exec) in vc4_cl_lookup_bos() argument
748 struct drm_vc4_submit_cl *args = exec->args; in vc4_cl_lookup_bos()
752 exec->bo_count = args->bo_handle_count; in vc4_cl_lookup_bos()
754 if (!exec->bo_count) { in vc4_cl_lookup_bos()
763 exec->bo_count, &exec->bo); in vc4_cl_lookup_bos()
768 for (i = 0; i < exec->bo_count; i++) { in vc4_cl_lookup_bos()
769 ret = vc4_bo_inc_usecnt(to_vc4_bo(exec->bo[i])); in vc4_cl_lookup_bos()
786 vc4_bo_dec_usecnt(to_vc4_bo(exec->bo[i])); in vc4_cl_lookup_bos()
790 for (i = 0; i < exec->bo_count && exec->bo[i]; i++) in vc4_cl_lookup_bos()
791 drm_gem_object_put(exec->bo[i]); in vc4_cl_lookup_bos()
793 kvfree(exec->bo); in vc4_cl_lookup_bos()
794 exec->bo = NULL; in vc4_cl_lookup_bos()
799 vc4_get_bcl(struct drm_device *dev, struct vc4_exec_info *exec) in vc4_get_bcl() argument
801 struct drm_vc4_submit_cl *args = exec->args; in vc4_get_bcl()
841 exec->shader_rec_u = temp + shader_rec_offset; in vc4_get_bcl()
842 exec->uniforms_u = temp + uniforms_offset; in vc4_get_bcl()
843 exec->shader_state = temp + exec_size; in vc4_get_bcl()
844 exec->shader_state_size = args->shader_rec_count; in vc4_get_bcl()
853 if (copy_from_user(exec->shader_rec_u, in vc4_get_bcl()
860 if (copy_from_user(exec->uniforms_u, in vc4_get_bcl()
873 exec->exec_bo = &bo->base; in vc4_get_bcl()
875 list_add_tail(&to_vc4_bo(&exec->exec_bo->base)->unref_head, in vc4_get_bcl()
876 &exec->unref_list); in vc4_get_bcl()
878 exec->ct0ca = exec->exec_bo->dma_addr + bin_offset; in vc4_get_bcl()
880 exec->bin_u = bin; in vc4_get_bcl()
882 exec->shader_rec_v = exec->exec_bo->vaddr + shader_rec_offset; in vc4_get_bcl()
883 exec->shader_rec_p = exec->exec_bo->dma_addr + shader_rec_offset; in vc4_get_bcl()
884 exec->shader_rec_size = args->shader_rec_size; in vc4_get_bcl()
886 exec->uniforms_v = exec->exec_bo->vaddr + uniforms_offset; in vc4_get_bcl()
887 exec->uniforms_p = exec->exec_bo->dma_addr + uniforms_offset; in vc4_get_bcl()
888 exec->uniforms_size = args->uniforms_size; in vc4_get_bcl()
891 exec->exec_bo->vaddr + bin_offset, in vc4_get_bcl()
893 exec); in vc4_get_bcl()
897 ret = vc4_validate_shader_recs(dev, exec); in vc4_get_bcl()
901 if (exec->found_tile_binning_mode_config_packet) { in vc4_get_bcl()
902 ret = vc4_v3d_bin_bo_get(vc4, &exec->bin_bo_used); in vc4_get_bcl()
911 ret = vc4_wait_for_seqno(dev, exec->bin_dep_seqno, ~0ull, true); in vc4_get_bcl()
919 vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) in vc4_complete_exec() argument
928 if (exec->fence) { in vc4_complete_exec()
929 dma_fence_signal(exec->fence); in vc4_complete_exec()
930 dma_fence_put(exec->fence); in vc4_complete_exec()
933 if (exec->bo) { in vc4_complete_exec()
934 for (i = 0; i < exec->bo_count; i++) { in vc4_complete_exec()
935 struct vc4_bo *bo = to_vc4_bo(exec->bo[i]); in vc4_complete_exec()
938 drm_gem_object_put(exec->bo[i]); in vc4_complete_exec()
940 kvfree(exec->bo); in vc4_complete_exec()
943 while (!list_empty(&exec->unref_list)) { in vc4_complete_exec()
944 struct vc4_bo *bo = list_first_entry(&exec->unref_list, in vc4_complete_exec()
952 vc4->bin_alloc_used &= ~exec->bin_slots; in vc4_complete_exec()
956 if (exec->bin_bo_used) in vc4_complete_exec()
960 vc4_perfmon_put(exec->perfmon); in vc4_complete_exec()
964 kfree(exec); in vc4_complete_exec()
978 struct vc4_exec_info *exec = in vc4_job_handle_completed() local
981 list_del(&exec->head); in vc4_job_handle_completed()
984 vc4_complete_exec(&vc4->base, exec); in vc4_job_handle_completed()
1125 struct vc4_exec_info *exec; in vc4_submit_cl_ioctl() local
1155 exec = kcalloc(1, sizeof(*exec), GFP_KERNEL); in vc4_submit_cl_ioctl()
1156 if (!exec) { in vc4_submit_cl_ioctl()
1160 exec->dev = vc4; in vc4_submit_cl_ioctl()
1164 kfree(exec); in vc4_submit_cl_ioctl()
1168 exec->args = args; in vc4_submit_cl_ioctl()
1169 INIT_LIST_HEAD(&exec->unref_list); in vc4_submit_cl_ioctl()
1171 ret = vc4_cl_lookup_bos(dev, file_priv, exec); in vc4_submit_cl_ioctl()
1176 exec->perfmon = vc4_perfmon_find(vc4file, in vc4_submit_cl_ioctl()
1178 if (!exec->perfmon) { in vc4_submit_cl_ioctl()
1207 if (exec->args->bin_cl_size != 0) { in vc4_submit_cl_ioctl()
1208 ret = vc4_get_bcl(dev, exec); in vc4_submit_cl_ioctl()
1212 exec->ct0ca = 0; in vc4_submit_cl_ioctl()
1213 exec->ct0ea = 0; in vc4_submit_cl_ioctl()
1216 ret = vc4_get_rcl(dev, exec); in vc4_submit_cl_ioctl()
1220 ret = vc4_lock_bo_reservations(dev, exec, &acquire_ctx); in vc4_submit_cl_ioctl()
1241 exec->args = NULL; in vc4_submit_cl_ioctl()
1243 ret = vc4_queue_submit(dev, exec, &acquire_ctx, out_sync); in vc4_submit_cl_ioctl()
1260 vc4_complete_exec(&vc4->base, exec); in vc4_submit_cl_ioctl()