• Home
  • Raw
  • Download

Lines Matching full:job

61 v3dv_job_add_bo(struct v3dv_job *job, struct v3dv_bo *bo)  in v3dv_job_add_bo()  argument
66 if (_mesa_set_search(job->bos, bo)) in v3dv_job_add_bo()
69 _mesa_set_add(job->bos, bo); in v3dv_job_add_bo()
70 job->bo_count++; in v3dv_job_add_bo()
158 job_destroy_gpu_cl_resources(struct v3dv_job *job) in job_destroy_gpu_cl_resources() argument
160 assert(job->type == V3DV_JOB_TYPE_GPU_CL || in job_destroy_gpu_cl_resources()
161 job->type == V3DV_JOB_TYPE_GPU_CL_SECONDARY); in job_destroy_gpu_cl_resources()
163 v3dv_cl_destroy(&job->bcl); in job_destroy_gpu_cl_resources()
164 v3dv_cl_destroy(&job->rcl); in job_destroy_gpu_cl_resources()
165 v3dv_cl_destroy(&job->indirect); in job_destroy_gpu_cl_resources()
171 _mesa_set_destroy(job->bos, NULL); in job_destroy_gpu_cl_resources()
173 v3dv_bo_free(job->device, job->tile_alloc); in job_destroy_gpu_cl_resources()
174 v3dv_bo_free(job->device, job->tile_state); in job_destroy_gpu_cl_resources()
178 job_destroy_cloned_gpu_cl_resources(struct v3dv_job *job) in job_destroy_cloned_gpu_cl_resources() argument
180 assert(job->type == V3DV_JOB_TYPE_GPU_CL); in job_destroy_cloned_gpu_cl_resources()
182 list_for_each_entry_safe(struct v3dv_bo, bo, &job->bcl.bo_list, list_link) { in job_destroy_cloned_gpu_cl_resources()
184 vk_free(&job->device->alloc, bo); in job_destroy_cloned_gpu_cl_resources()
187 list_for_each_entry_safe(struct v3dv_bo, bo, &job->rcl.bo_list, list_link) { in job_destroy_cloned_gpu_cl_resources()
189 vk_free(&job->device->alloc, bo); in job_destroy_cloned_gpu_cl_resources()
192 list_for_each_entry_safe(struct v3dv_bo, bo, &job->indirect.bo_list, list_link) { in job_destroy_cloned_gpu_cl_resources()
194 vk_free(&job->device->alloc, bo); in job_destroy_cloned_gpu_cl_resources()
199 job_destroy_gpu_csd_resources(struct v3dv_job *job) in job_destroy_gpu_csd_resources() argument
201 assert(job->type == V3DV_JOB_TYPE_GPU_CSD); in job_destroy_gpu_csd_resources()
202 assert(job->cmd_buffer); in job_destroy_gpu_csd_resources()
204 v3dv_cl_destroy(&job->indirect); in job_destroy_gpu_csd_resources()
206 _mesa_set_destroy(job->bos, NULL); in job_destroy_gpu_csd_resources()
208 if (job->csd.shared_memory) in job_destroy_gpu_csd_resources()
209 v3dv_bo_free(job->device, job->csd.shared_memory); in job_destroy_gpu_csd_resources()
213 job_destroy_cpu_wait_events_resources(struct v3dv_job *job) in job_destroy_cpu_wait_events_resources() argument
215 assert(job->type == V3DV_JOB_TYPE_CPU_WAIT_EVENTS); in job_destroy_cpu_wait_events_resources()
216 assert(job->cmd_buffer); in job_destroy_cpu_wait_events_resources()
217 vk_free(&job->cmd_buffer->device->alloc, job->cpu.event_wait.events); in job_destroy_cpu_wait_events_resources()
221 job_destroy_cpu_csd_indirect_resources(struct v3dv_job *job) in job_destroy_cpu_csd_indirect_resources() argument
223 assert(job->type == V3DV_JOB_TYPE_CPU_CSD_INDIRECT); in job_destroy_cpu_csd_indirect_resources()
224 assert(job->cmd_buffer); in job_destroy_cpu_csd_indirect_resources()
225 v3dv_job_destroy(job->cpu.csd_indirect.csd_job); in job_destroy_cpu_csd_indirect_resources()
229 v3dv_job_destroy(struct v3dv_job *job) in v3dv_job_destroy() argument
231 assert(job); in v3dv_job_destroy()
233 list_del(&job->list_link); in v3dv_job_destroy()
239 if (!job->is_clone) { in v3dv_job_destroy()
240 switch (job->type) { in v3dv_job_destroy()
243 job_destroy_gpu_cl_resources(job); in v3dv_job_destroy()
246 job_destroy_gpu_csd_resources(job); in v3dv_job_destroy()
249 job_destroy_cpu_wait_events_resources(job); in v3dv_job_destroy()
252 job_destroy_cpu_csd_indirect_resources(job); in v3dv_job_destroy()
259 if (job->type == V3DV_JOB_TYPE_GPU_CL) in v3dv_job_destroy()
260 job_destroy_cloned_gpu_cl_resources(job); in v3dv_job_destroy()
263 vk_free(&job->device->alloc, job); in v3dv_job_destroy()
300 list_for_each_entry_safe(struct v3dv_job, job, in cmd_buffer_free_resources()
302 v3dv_job_destroy(job); in cmd_buffer_free_resources()
305 if (cmd_buffer->state.job) in cmd_buffer_free_resources()
306 v3dv_job_destroy(cmd_buffer->state.job); in cmd_buffer_free_resources()
337 v3dv_job_emit_binning_flush(struct v3dv_job *job) in v3dv_job_emit_binning_flush() argument
339 assert(job); in v3dv_job_emit_binning_flush()
341 v3dv_cl_ensure_space_with_branch(&job->bcl, cl_packet_length(FLUSH)); in v3dv_job_emit_binning_flush()
342 v3dv_return_if_oom(NULL, job); in v3dv_job_emit_binning_flush()
344 cl_emit(&job->bcl, FLUSH, flush); in v3dv_job_emit_binning_flush()
381 if (!cmd_buffer->state.job) in cmd_buffer_can_merge_subpass()
384 if (cmd_buffer->state.job->always_flush) in cmd_buffer_can_merge_subpass()
390 /* Each render pass starts a new job */ in cmd_buffer_can_merge_subpass()
394 /* Two subpasses can be merged in the same job if we can emit a single RCL in cmd_buffer_can_merge_subpass()
396 * triggers the "render job finished" interrupt). We can do this so long in cmd_buffer_can_merge_subpass()
439 * Computes and sets the job frame tiling information required to setup frame
443 job_compute_frame_tiling(struct v3dv_job *job, in job_compute_frame_tiling() argument
461 assert(job); in job_compute_frame_tiling()
462 struct v3dv_frame_tiling *tiling = &job->frame_tiling; in job_compute_frame_tiling()
514 v3dv_job_start_frame(struct v3dv_job *job, in v3dv_job_start_frame() argument
522 assert(job); in v3dv_job_start_frame()
524 /* Start by computing frame tiling spec for this job */ in v3dv_job_start_frame()
526 job_compute_frame_tiling(job, in v3dv_job_start_frame()
530 v3dv_cl_ensure_space_with_branch(&job->bcl, 256); in v3dv_job_start_frame()
531 v3dv_return_if_oom(NULL, job); in v3dv_job_start_frame()
555 job->tile_alloc = v3dv_bo_alloc(job->device, tile_alloc_size, in v3dv_job_start_frame()
557 if (!job->tile_alloc) { in v3dv_job_start_frame()
558 v3dv_flag_oom(NULL, job); in v3dv_job_start_frame()
562 v3dv_job_add_bo(job, job->tile_alloc); in v3dv_job_start_frame()
569 job->tile_state = v3dv_bo_alloc(job->device, tile_state_size, "TSDA", true); in v3dv_job_start_frame()
570 if (!job->tile_state) { in v3dv_job_start_frame()
571 v3dv_flag_oom(NULL, job); in v3dv_job_start_frame()
575 v3dv_job_add_bo(job, job->tile_state); in v3dv_job_start_frame()
580 cl_emit(&job->bcl, NUMBER_OF_LAYERS, config) { in v3dv_job_start_frame()
584 cl_emit(&job->bcl, TILE_BINNING_MODE_CFG, config) { in v3dv_job_start_frame()
593 cl_emit(&job->bcl, FLUSH_VCD_CACHE, bin); in v3dv_job_start_frame()
598 cl_emit(&job->bcl, START_TILE_BINNING, bin); in v3dv_job_start_frame()
600 job->ez_state = VC5_EZ_UNDECIDED; in v3dv_job_start_frame()
601 job->first_ez_state = VC5_EZ_UNDECIDED; in v3dv_job_start_frame()
607 assert(cmd_buffer->state.job); in cmd_buffer_end_render_pass_frame()
609 /* Typically, we have a single job for each subpass and we emit the job's RCL in cmd_buffer_end_render_pass_frame()
611 * such as vkCmdClearAttachments need to run in their own separate job and in cmd_buffer_end_render_pass_frame()
614 * those jobs, so we only emit the subpass RCL if the job has not recorded in cmd_buffer_end_render_pass_frame()
617 if (v3dv_cl_offset(&cmd_buffer->state.job->rcl) == 0) in cmd_buffer_end_render_pass_frame()
620 v3dv_job_emit_binning_flush(cmd_buffer->state.job); in cmd_buffer_end_render_pass_frame()
626 assert(cmd_buffer->state.job); in cmd_buffer_end_render_pass_secondary()
627 v3dv_cl_ensure_space_with_branch(&cmd_buffer->state.job->bcl, in cmd_buffer_end_render_pass_secondary()
630 cl_emit(&cmd_buffer->state.job->bcl, RETURN_FROM_SUB_LIST, ret); in cmd_buffer_end_render_pass_secondary()
639 struct v3dv_job *job = vk_zalloc(&device->alloc, in v3dv_cmd_buffer_create_cpu_job() local
642 if (!job) { in v3dv_cmd_buffer_create_cpu_job()
647 v3dv_job_init(job, type, device, cmd_buffer, subpass_idx); in v3dv_cmd_buffer_create_cpu_job()
648 return job; in v3dv_cmd_buffer_create_cpu_job()
660 struct v3dv_job *job = in cmd_buffer_add_cpu_jobs_for_pending_state() local
666 job->cpu.query_end = state->query.end.states[i]; in cmd_buffer_add_cpu_jobs_for_pending_state()
667 list_addtail(&job->list_link, &cmd_buffer->jobs); in cmd_buffer_add_cpu_jobs_for_pending_state()
675 struct v3dv_job *job = cmd_buffer->state.job; in v3dv_cmd_buffer_finish_job() local
676 if (!job) in v3dv_cmd_buffer_finish_job()
680 v3dv_job_destroy(job); in v3dv_cmd_buffer_finish_job()
681 cmd_buffer->state.job = NULL; in v3dv_cmd_buffer_finish_job()
685 /* If we have created a job for a command buffer then we should have in v3dv_cmd_buffer_finish_job()
686 * recorded something into it: if the job was started in a render pass, it in v3dv_cmd_buffer_finish_job()
692 v3dv_cl_offset(&job->bcl) > 0); in v3dv_cmd_buffer_finish_job()
694 /* When we merge multiple subpasses into the same job we must only emit one in v3dv_cmd_buffer_finish_job()
695 * RCL, so we do that here, when we decided that we need to finish the job. in v3dv_cmd_buffer_finish_job()
699 assert(v3dv_cl_offset(&job->rcl) != 0 || cmd_buffer->state.pass); in v3dv_cmd_buffer_finish_job()
701 /* If we are finishing a job inside a render pass we have two scenarios: in v3dv_cmd_buffer_finish_job()
703 * 1. It is a regular CL, in which case we will submit the job to the GPU, in v3dv_cmd_buffer_finish_job()
710 * will be the primary job that branches to this CL. in v3dv_cmd_buffer_finish_job()
713 if (job->type == V3DV_JOB_TYPE_GPU_CL) { in v3dv_cmd_buffer_finish_job()
716 assert(job->type == V3DV_JOB_TYPE_GPU_CL_SECONDARY); in v3dv_cmd_buffer_finish_job()
721 list_addtail(&job->list_link, &cmd_buffer->jobs); in v3dv_cmd_buffer_finish_job()
722 cmd_buffer->state.job = NULL; in v3dv_cmd_buffer_finish_job()
724 /* If we have recorded any state with this last GPU job that requires to in v3dv_cmd_buffer_finish_job()
725 * emit CPU jobs after the job is completed, add them now. The only in v3dv_cmd_buffer_finish_job()
728 * job into which we execute the secondary. in v3dv_cmd_buffer_finish_job()
737 job_type_is_gpu(struct v3dv_job *job) in job_type_is_gpu() argument
739 switch (job->type) { in job_type_is_gpu()
752 struct v3dv_job *job) in cmd_buffer_serialize_job_if_needed() argument
754 assert(cmd_buffer && job); in cmd_buffer_serialize_job_if_needed()
762 if (!job_type_is_gpu(job)) in cmd_buffer_serialize_job_if_needed()
765 job->serialize = true; in cmd_buffer_serialize_job_if_needed()
767 (job->type == V3DV_JOB_TYPE_GPU_CL || in cmd_buffer_serialize_job_if_needed()
768 job->type == V3DV_JOB_TYPE_GPU_CL_SECONDARY)) { in cmd_buffer_serialize_job_if_needed()
769 job->needs_bcl_sync = true; in cmd_buffer_serialize_job_if_needed()
777 v3dv_job_init(struct v3dv_job *job, in v3dv_job_init() argument
783 assert(job); in v3dv_job_init()
785 /* Make sure we haven't made this new job current before calling here */ in v3dv_job_init()
786 assert(!cmd_buffer || cmd_buffer->state.job != job); in v3dv_job_init()
788 job->type = type; in v3dv_job_init()
790 job->device = device; in v3dv_job_init()
791 job->cmd_buffer = cmd_buffer; in v3dv_job_init()
793 list_inithead(&job->list_link); in v3dv_job_init()
798 job->bos = in v3dv_job_init()
800 job->bo_count = 0; in v3dv_job_init()
802 v3dv_cl_init(job, &job->indirect); in v3dv_job_init()
805 job->always_flush = true; in v3dv_job_init()
810 v3dv_cl_init(job, &job->bcl); in v3dv_job_init()
811 v3dv_cl_init(job, &job->rcl); in v3dv_job_init()
816 * new job. in v3dv_job_init()
829 /* Keep track of the first subpass that we are recording in this new job. in v3dv_job_init()
834 job->first_subpass = subpass_idx; in v3dv_job_init()
836 cmd_buffer_serialize_job_if_needed(cmd_buffer, job); in v3dv_job_init()
845 /* Don't create a new job if we can merge the current subpass into in v3dv_cmd_buffer_start_job()
846 * the current job. in v3dv_cmd_buffer_start_job()
851 cmd_buffer->state.job->is_subpass_finish = false; in v3dv_cmd_buffer_start_job()
852 return cmd_buffer->state.job; in v3dv_cmd_buffer_start_job()
855 /* Ensure we are not starting a new job without finishing a previous one */ in v3dv_cmd_buffer_start_job()
856 if (cmd_buffer->state.job != NULL) in v3dv_cmd_buffer_start_job()
859 assert(cmd_buffer->state.job == NULL); in v3dv_cmd_buffer_start_job()
860 struct v3dv_job *job = vk_zalloc(&cmd_buffer->device->alloc, in v3dv_cmd_buffer_start_job() local
864 if (!job) { in v3dv_cmd_buffer_start_job()
865 fprintf(stderr, "Error: failed to allocate CPU memory for job\n"); in v3dv_cmd_buffer_start_job()
870 v3dv_job_init(job, type, cmd_buffer->device, cmd_buffer, subpass_idx); in v3dv_cmd_buffer_start_job()
871 cmd_buffer->state.job = job; in v3dv_cmd_buffer_start_job()
873 return job; in v3dv_cmd_buffer_start_job()
996 * that we are no longer in a subpass by finishing the current job and in cmd_buffer_subpass_handle_pending_resolves()
1000 if (cmd_buffer->state.job) in cmd_buffer_subpass_handle_pending_resolves()
1085 * so we want to create a job for them here. in cmd_buffer_begin_render_pass_secondary()
1087 struct v3dv_job *job = in cmd_buffer_begin_render_pass_secondary() local
1090 if (!job) { in cmd_buffer_begin_render_pass_secondary()
1177 emit_clip_window(struct v3dv_job *job, const VkRect2D *rect) in emit_clip_window() argument
1179 assert(job); in emit_clip_window()
1181 v3dv_cl_ensure_space_with_branch(&job->bcl, cl_packet_length(CLIP_WINDOW)); in emit_clip_window()
1182 v3dv_return_if_oom(NULL, job); in emit_clip_window()
1184 cl_emit(&job->bcl, CLIP_WINDOW, clip) { in emit_clip_window()
1500 return state->job->first_subpass > att_first_subpass_idx || in check_needs_load()
1501 state->job->is_subpass_continue || in check_needs_load()
1535 * if the current job is continuing subpass work started by a previous in cmd_buffer_render_pass_emit_loads()
1536 * job, for the same reason. in cmd_buffer_render_pass_emit_loads()
1652 assert(state->job->first_subpass >= ds_attachment->first_subpass); in cmd_buffer_render_pass_emit_stores()
1673 state->job->first_subpass == ds_attachment->first_subpass && in cmd_buffer_render_pass_emit_stores()
1675 !state->job->is_subpass_continue && in cmd_buffer_render_pass_emit_stores()
1681 state->job->first_subpass == ds_attachment->first_subpass && in cmd_buffer_render_pass_emit_stores()
1683 !state->job->is_subpass_continue && in cmd_buffer_render_pass_emit_stores()
1691 !state->job->is_subpass_finish); in cmd_buffer_render_pass_emit_stores()
1697 !state->job->is_subpass_finish); in cmd_buffer_render_pass_emit_stores()
1732 assert(state->job->first_subpass >= attachment->first_subpass); in cmd_buffer_render_pass_emit_stores()
1739 state->job->first_subpass == attachment->first_subpass && in cmd_buffer_render_pass_emit_stores()
1741 !state->job->is_subpass_continue; in cmd_buffer_render_pass_emit_stores()
1747 !state->job->is_subpass_finish; in cmd_buffer_render_pass_emit_stores()
1757 * job, so we will need to store the multisampled sttachment even if that in cmd_buffer_render_pass_emit_stores()
1810 struct v3dv_job *job = cmd_buffer->state.job; in cmd_buffer_render_pass_emit_per_tile_rcl() local
1811 assert(job); in cmd_buffer_render_pass_emit_per_tile_rcl()
1816 struct v3dv_cl *cl = &job->indirect; in cmd_buffer_render_pass_emit_per_tile_rcl()
1846 cl_emit(&job->rcl, START_ADDRESS_OF_GENERIC_TILE_LIST, branch) { in cmd_buffer_render_pass_emit_per_tile_rcl()
1858 struct v3dv_job *job = cmd_buffer->state.job; in cmd_buffer_emit_render_pass_layer_rcl() local
1859 struct v3dv_cl *rcl = &job->rcl; in cmd_buffer_emit_render_pass_layer_rcl()
1864 const struct v3dv_frame_tiling *tiling = &job->frame_tiling; in cmd_buffer_emit_render_pass_layer_rcl()
1868 list.address = v3dv_cl_address(job->tile_alloc, tile_alloc_offset); in cmd_buffer_emit_render_pass_layer_rcl()
1953 set_rcl_early_z_config(struct v3dv_job *job, in set_rcl_early_z_config() argument
1960 switch (job->first_ez_state) { in set_rcl_early_z_config()
1989 struct v3dv_job *job = cmd_buffer->state.job; in cmd_buffer_emit_render_pass_rcl() local
1990 assert(job); in cmd_buffer_emit_render_pass_rcl()
2005 const struct v3dv_frame_tiling *tiling = &job->frame_tiling; in cmd_buffer_emit_render_pass_rcl()
2008 v3dv_cl_ensure_space_with_branch(&job->rcl, 200 + in cmd_buffer_emit_render_pass_rcl()
2016 struct v3dv_cl *rcl = &job->rcl; in cmd_buffer_emit_render_pass_rcl()
2040 set_rcl_early_z_config(job, in cmd_buffer_emit_render_pass_rcl()
2269 /* Starting a new job can trigger a finish of the current one, so don't in cmd_buffer_subpass_create_job()
2270 * change the command buffer state for the new job until we are done creating in cmd_buffer_subpass_create_job()
2271 * the new job. in cmd_buffer_subpass_create_job()
2273 struct v3dv_job *job = in cmd_buffer_subpass_create_job() local
2275 if (!job) in cmd_buffer_subpass_create_job()
2280 /* If we are starting a new job we need to setup binning. We only do this in cmd_buffer_subpass_create_job()
2286 job->first_subpass == state->subpass_idx) { in cmd_buffer_subpass_create_job()
2297 v3dv_job_start_frame(job, in cmd_buffer_subpass_create_job()
2306 return job; in cmd_buffer_subpass_create_job()
2316 struct v3dv_job *job = in v3dv_cmd_buffer_subpass_start() local
2319 if (!job) in v3dv_cmd_buffer_subpass_start()
2342 return job; in v3dv_cmd_buffer_subpass_start()
2352 struct v3dv_job *job; in v3dv_cmd_buffer_subpass_resume() local
2354 job = cmd_buffer_subpass_create_job(cmd_buffer, subpass_idx, in v3dv_cmd_buffer_subpass_resume()
2358 job = cmd_buffer_subpass_create_job(cmd_buffer, subpass_idx, in v3dv_cmd_buffer_subpass_resume()
2362 if (!job) in v3dv_cmd_buffer_subpass_resume()
2365 job->is_subpass_continue = true; in v3dv_cmd_buffer_subpass_resume()
2367 return job; in v3dv_cmd_buffer_subpass_resume()
2373 /* We can end up here without a job if the last command recorded into the in v3dv_cmd_buffer_subpass_finish()
2374 * subpass already finished the job (for example a pipeline barrier). In in v3dv_cmd_buffer_subpass_finish()
2378 struct v3dv_job *job = cmd_buffer->state.job; in v3dv_cmd_buffer_subpass_finish() local
2379 if (job) in v3dv_cmd_buffer_subpass_finish()
2380 job->is_subpass_finish = true; in v3dv_cmd_buffer_subpass_finish()
2414 * finishing a recording job is when we are recording a secondary in v3dv_EndCommandBuffer()
2417 if (cmd_buffer->state.job) { in v3dv_EndCommandBuffer()
2488 /* Clones a job for inclusion in the given command buffer. Note that this
2489 * doesn't make a deep copy so the cloned job it doesn't own any resources.
2490 * Useful when we need to have a job in more than one list, which happens
2495 job_clone_in_cmd_buffer(struct v3dv_job *job, in job_clone_in_cmd_buffer() argument
2498 struct v3dv_job *clone_job = vk_alloc(&job->device->alloc, in job_clone_in_cmd_buffer()
2507 *clone_job = *job; in job_clone_in_cmd_buffer()
2513 * cloned job. Otherwise functions like list_length() will loop forever. in job_clone_in_cmd_buffer()
2515 if (job->type == V3DV_JOB_TYPE_GPU_CL) { in job_clone_in_cmd_buffer()
2516 clone_bo_list(cmd_buffer, &clone_job->bcl.bo_list, &job->bcl.bo_list); in job_clone_in_cmd_buffer()
2517 clone_bo_list(cmd_buffer, &clone_job->rcl.bo_list, &job->rcl.bo_list); in job_clone_in_cmd_buffer()
2519 &job->indirect.bo_list); in job_clone_in_cmd_buffer()
2531 struct v3dv_job *job = in cmd_buffer_subpass_split_for_barrier() local
2534 if (!job) in cmd_buffer_subpass_split_for_barrier()
2537 job->serialize = true; in cmd_buffer_subpass_split_for_barrier()
2538 job->needs_bcl_sync = is_bcl_barrier; in cmd_buffer_subpass_split_for_barrier()
2539 return job; in cmd_buffer_subpass_split_for_barrier()
2547 assert(primary->state.job); in cmd_buffer_execute_inside_pass()
2557 /* FIXME: if our primary job tiling doesn't enable MSSA but any of the in cmd_buffer_execute_inside_pass()
2559 * job to enable MSAA. See cmd_buffer_restart_job_for_msaa_if_needed. in cmd_buffer_execute_inside_pass()
2572 /* If the job is a CL, then we branch to it from the primary BCL. in cmd_buffer_execute_inside_pass()
2588 * need to split the primary to create a new job that can consume in cmd_buffer_execute_inside_pass()
2592 * the RETURN_FROM_SUB_LIST into the primary job to skip the in cmd_buffer_execute_inside_pass()
2595 struct v3dv_job *primary_job = primary->state.job; in cmd_buffer_execute_inside_pass()
2611 /* Make sure our primary job has all required BO references */ in cmd_buffer_execute_inside_pass()
2641 /* This is a regular job (CPU or GPU), so just finish the current in cmd_buffer_execute_inside_pass()
2642 * primary job (if any) and then add the secondary job to the in cmd_buffer_execute_inside_pass()
2643 * primary's job list right after it. in cmd_buffer_execute_inside_pass()
2660 * current primary job is finished. in cmd_buffer_execute_inside_pass()
2693 * their job list into the primary's. However, because they may be in cmd_buffer_execute_outside_pass()
2695 * single list_link in each job, we can't just add then to the primary's in cmd_buffer_execute_outside_pass()
2696 * job list and we instead have to clone them first. in cmd_buffer_execute_outside_pass()
2698 * Alternatively, we could create a "execute secondary" CPU job that in cmd_buffer_execute_outside_pass()
2709 struct v3dv_job *job = job_clone_in_cmd_buffer(secondary_job, primary); in cmd_buffer_execute_outside_pass() local
2710 if (!job) in cmd_buffer_execute_outside_pass()
2714 job->serialize = true; in cmd_buffer_execute_outside_pass()
2716 job->needs_bcl_sync = true; in cmd_buffer_execute_outside_pass()
2723 * barrier state consumed with whatever comes after it (first job in in cmd_buffer_execute_outside_pass()
2843 job_update_ez_state(struct v3dv_job *job, in job_update_ez_state() argument
2849 job->ez_state = VC5_EZ_DISABLED; in job_update_ez_state()
2856 job->ez_state = VC5_EZ_DISABLED; in job_update_ez_state()
2874 if (job->ez_state == VC5_EZ_UNDECIDED) in job_update_ez_state()
2875 job->ez_state = pipeline->ez_state; in job_update_ez_state()
2876 else if (job->ez_state != pipeline->ez_state) in job_update_ez_state()
2877 job->ez_state = VC5_EZ_DISABLED; in job_update_ez_state()
2884 job->ez_state = VC5_EZ_DISABLED; in job_update_ez_state()
2890 job->ez_state = VC5_EZ_DISABLED; in job_update_ez_state()
2892 if (job->first_ez_state == VC5_EZ_UNDECIDED && in job_update_ez_state()
2893 job->ez_state != VC5_EZ_DISABLED) { in job_update_ez_state()
2894 job->first_ez_state = job->ez_state; in job_update_ez_state()
3118 assert(cmd_buffer->state.job); in bind_graphics_pipeline()
3119 cmd_buffer->state.job->always_flush = true; in bind_graphics_pipeline()
3337 emit_clip_window(cmd_buffer->state.job, &cmd_buffer->state.clip_window); in emit_scissor()
3352 struct v3dv_job *job = cmd_buffer->state.job; in emit_viewport() local
3353 assert(job); in emit_viewport()
3360 v3dv_cl_ensure_space_with_branch(&job->bcl, required_cl_size); in emit_viewport()
3363 cl_emit(&job->bcl, CLIPPER_XY_SCALING, clip) { in emit_viewport()
3368 cl_emit(&job->bcl, CLIPPER_Z_SCALE_AND_OFFSET, clip) { in emit_viewport()
3372 cl_emit(&job->bcl, CLIPPER_Z_MIN_MAX_CLIPPING_PLANES, clip) { in emit_viewport()
3380 cl_emit(&job->bcl, VIEWPORT_OFFSET, vp) { in emit_viewport()
3391 struct v3dv_job *job = cmd_buffer->state.job; in emit_stencil() local
3392 assert(job); in emit_stencil()
3401 v3dv_cl_ensure_space_with_branch(&job->bcl, in emit_stencil()
3409 cl_emit_with_prepacked(&job->bcl, STENCIL_CFG, in emit_stencil()
3428 cl_emit_prepacked(&job->bcl, &pipeline->stencil_cfg[i]); in emit_stencil()
3453 struct v3dv_job *job = cmd_buffer->state.job; in emit_depth_bias() local
3454 assert(job); in emit_depth_bias()
3456 v3dv_cl_ensure_space_with_branch(&job->bcl, cl_packet_length(DEPTH_OFFSET)); in emit_depth_bias()
3460 cl_emit(&job->bcl, DEPTH_OFFSET, bias) { in emit_depth_bias()
3473 struct v3dv_job *job = cmd_buffer->state.job; in emit_line_width() local
3474 assert(job); in emit_line_width()
3476 v3dv_cl_ensure_space_with_branch(&job->bcl, cl_packet_length(LINE_WIDTH)); in emit_line_width()
3479 cl_emit(&job->bcl, LINE_WIDTH, line) { in emit_line_width()
3492 struct v3dv_job *job = cmd_buffer->state.job; in emit_sample_state() local
3493 assert(job); in emit_sample_state()
3495 v3dv_cl_ensure_space_with_branch(&job->bcl, cl_packet_length(SAMPLE_STATE)); in emit_sample_state()
3498 cl_emit(&job->bcl, SAMPLE_STATE, state) { in emit_sample_state()
3507 struct v3dv_job *job = cmd_buffer->state.job; in emit_blend() local
3508 assert(job); in emit_blend()
3519 v3dv_cl_ensure_space_with_branch(&job->bcl, blend_packets_size); in emit_blend()
3524 cl_emit(&job->bcl, BLEND_ENABLES, enables) { in emit_blend()
3531 cl_emit_prepacked(&job->bcl, &pipeline->blend.cfg[i]); in emit_blend()
3534 cl_emit(&job->bcl, COLOR_WRITE_MASKS, mask) { in emit_blend()
3542 cl_emit(&job->bcl, BLEND_CONSTANT_COLOR, color) { in emit_blend()
3553 emit_flat_shade_flags(struct v3dv_job *job, in emit_flat_shade_flags() argument
3559 v3dv_cl_ensure_space_with_branch(&job->bcl, in emit_flat_shade_flags()
3561 v3dv_return_if_oom(NULL, job); in emit_flat_shade_flags()
3563 cl_emit(&job->bcl, FLAT_SHADE_FLAGS, flags) { in emit_flat_shade_flags()
3572 emit_noperspective_flags(struct v3dv_job *job, in emit_noperspective_flags() argument
3578 v3dv_cl_ensure_space_with_branch(&job->bcl, in emit_noperspective_flags()
3580 v3dv_return_if_oom(NULL, job); in emit_noperspective_flags()
3582 cl_emit(&job->bcl, NON_PERSPECTIVE_FLAGS, flags) { in emit_noperspective_flags()
3591 emit_centroid_flags(struct v3dv_job *job, in emit_centroid_flags() argument
3597 v3dv_cl_ensure_space_with_branch(&job->bcl, in emit_centroid_flags()
3599 v3dv_return_if_oom(NULL, job); in emit_centroid_flags()
3601 cl_emit(&job->bcl, CENTROID_FLAGS, flags) { in emit_centroid_flags()
3610 emit_varying_flags(struct v3dv_job *job, in emit_varying_flags() argument
3613 void (*flag_emit_callback)(struct v3dv_job *job, in emit_varying_flags() argument
3625 flag_emit_callback(job, i, flags[i], in emit_varying_flags()
3629 flag_emit_callback(job, i, flags[i], in emit_varying_flags()
3633 flag_emit_callback(job, i, flags[i], in emit_varying_flags()
3647 struct v3dv_job *job = cmd_buffer->state.job; in emit_varyings_state() local
3659 if (!emit_varying_flags(job, num_flags, flat_shade_flags, in emit_varyings_state()
3662 &job->bcl, cl_packet_length(ZERO_ALL_FLAT_SHADE_FLAGS)); in emit_varyings_state()
3665 cl_emit(&job->bcl, ZERO_ALL_FLAT_SHADE_FLAGS, flags); in emit_varyings_state()
3668 if (!emit_varying_flags(job, num_flags, noperspective_flags, in emit_varyings_state()
3671 &job->bcl, cl_packet_length(ZERO_ALL_NON_PERSPECTIVE_FLAGS)); in emit_varyings_state()
3674 cl_emit(&job->bcl, ZERO_ALL_NON_PERSPECTIVE_FLAGS, flags); in emit_varyings_state()
3677 if (!emit_varying_flags(job, num_flags, centroid_flags, in emit_varyings_state()
3680 &job->bcl, cl_packet_length(ZERO_ALL_CENTROID_FLAGS)); in emit_varyings_state()
3683 cl_emit(&job->bcl, ZERO_ALL_CENTROID_FLAGS, flags); in emit_varyings_state()
3690 struct v3dv_job *job = cmd_buffer->state.job; in emit_configuration_bits() local
3691 assert(job); in emit_configuration_bits()
3696 job_update_ez_state(job, pipeline, &cmd_buffer->state); in emit_configuration_bits()
3698 v3dv_cl_ensure_space_with_branch(&job->bcl, cl_packet_length(CFG_BITS)); in emit_configuration_bits()
3701 cl_emit_with_prepacked(&job->bcl, CFG_BITS, pipeline->cfg_bits, config) { in emit_configuration_bits()
3702 config.early_z_updates_enable = job->ez_state != VC5_EZ_DISABLED; in emit_configuration_bits()
3710 struct v3dv_job *job = cmd_buffer->state.job; in emit_gl_shader_state() local
3711 assert(job); in emit_gl_shader_state()
3728 job->tmu_dirty_rcl |= pipeline->vs_bin->current_variant->prog_data.vs->base.tmu_dirty_rcl; in emit_gl_shader_state()
3729 job->tmu_dirty_rcl |= pipeline->vs->current_variant->prog_data.vs->base.tmu_dirty_rcl; in emit_gl_shader_state()
3730 job->tmu_dirty_rcl |= pipeline->fs->current_variant->prog_data.fs->base.tmu_dirty_rcl; in emit_gl_shader_state()
3736 v3dv_cl_ensure_space(&job->indirect, in emit_gl_shader_state()
3743 cl_emit_with_prepacked(&job->indirect, GL_SHADER_STATE_RECORD, in emit_gl_shader_state()
3801 cl_emit_with_prepacked(&job->indirect, GL_SHADER_STATE_ATTRIBUTE_RECORD, in emit_gl_shader_state()
3845 cl_emit(&job->indirect, GL_SHADER_STATE_ATTRIBUTE_RECORD, attr) { in emit_gl_shader_state()
3847 attr.address = v3dv_cl_address(job->indirect.bo, 0); in emit_gl_shader_state()
3859 v3dv_cl_ensure_space_with_branch(&job->bcl, in emit_gl_shader_state()
3863 cl_emit_prepacked(&job->bcl, &pipeline->vcm_cache_size); in emit_gl_shader_state()
3866 v3dv_cl_ensure_space_with_branch(&job->bcl, in emit_gl_shader_state()
3870 cl_emit(&job->bcl, GL_SHADER_STATE, state) { in emit_gl_shader_state()
3871 state.address = v3dv_cl_address(job->indirect.bo, in emit_gl_shader_state()
3884 struct v3dv_job *job = cmd_buffer->state.job; in emit_occlusion_query() local
3885 assert(job); in emit_occlusion_query()
3887 v3dv_cl_ensure_space_with_branch(&job->bcl, in emit_occlusion_query()
3891 cl_emit(&job->bcl, OCCLUSION_QUERY_COUNTER, counter) { in emit_occlusion_query()
3991 * operation in its own job (possibly with an RT config that is in v3dv_cmd_buffer_meta_state_pop()
3993 * after it requires that we create a new job with the subpass RT setup. in v3dv_cmd_buffer_meta_state_pop()
4074 struct v3dv_job *job = cmd_buffer->state.job; in cmd_buffer_emit_draw() local
4075 assert(job); in cmd_buffer_emit_draw()
4086 &job->bcl, cl_packet_length(BASE_VERTEX_BASE_INSTANCE)); in cmd_buffer_emit_draw()
4089 cl_emit(&job->bcl, BASE_VERTEX_BASE_INSTANCE, base) { in cmd_buffer_emit_draw()
4097 &job->bcl, cl_packet_length(VERTEX_ARRAY_INSTANCED_PRIMS)); in cmd_buffer_emit_draw()
4100 cl_emit(&job->bcl, VERTEX_ARRAY_INSTANCED_PRIMS, prim) { in cmd_buffer_emit_draw()
4108 &job->bcl, cl_packet_length(VERTEX_ARRAY_PRIMS)); in cmd_buffer_emit_draw()
4110 cl_emit(&job->bcl, VERTEX_ARRAY_PRIMS, prim) { in cmd_buffer_emit_draw()
4121 struct v3dv_job *job = cmd_buffer->state.job; in cmd_buffer_pre_draw_split_job() local
4122 assert(job); in cmd_buffer_pre_draw_split_job()
4124 /* If the job has been flagged with 'always_flush' and it has already in cmd_buffer_pre_draw_split_job()
4125 * recorded any draw calls then we need to start a new job for it. in cmd_buffer_pre_draw_split_job()
4127 if (job->always_flush && job->draw_count > 0) { in cmd_buffer_pre_draw_split_job()
4129 /* First, flag the current job as not being the last in the in cmd_buffer_pre_draw_split_job()
4132 job->is_subpass_finish = false; in cmd_buffer_pre_draw_split_job()
4134 /* Now start a new job in the same subpass and flag it as continuing in cmd_buffer_pre_draw_split_job()
4137 job = v3dv_cmd_buffer_subpass_resume(cmd_buffer, in cmd_buffer_pre_draw_split_job()
4139 assert(job->draw_count == 0); in cmd_buffer_pre_draw_split_job()
4142 job->always_flush = true; in cmd_buffer_pre_draw_split_job()
4145 assert(job->draw_count == 0 || !job->always_flush); in cmd_buffer_pre_draw_split_job()
4146 return job; in cmd_buffer_pre_draw_split_job()
4164 * the job won't be valid in the scenario described by the spec.
4167 * we are in that scenario, in which case, it will restart the current job
4173 assert(cmd_buffer->state.job); in cmd_buffer_restart_job_for_msaa_if_needed()
4179 if (cmd_buffer->state.job->draw_count > 0) in cmd_buffer_restart_job_for_msaa_if_needed()
4186 cmd_buffer->state.job->frame_tiling.msaa) { in cmd_buffer_restart_job_for_msaa_if_needed()
4195 * restart the primary job into which they are being recorded. in cmd_buffer_restart_job_for_msaa_if_needed()
4200 /* Drop the current job and restart it with MSAA enabled */ in cmd_buffer_restart_job_for_msaa_if_needed()
4201 struct v3dv_job *old_job = cmd_buffer->state.job; in cmd_buffer_restart_job_for_msaa_if_needed()
4202 cmd_buffer->state.job = NULL; in cmd_buffer_restart_job_for_msaa_if_needed()
4204 struct v3dv_job *job = vk_zalloc(&cmd_buffer->device->alloc, in cmd_buffer_restart_job_for_msaa_if_needed() local
4207 if (!job) { in cmd_buffer_restart_job_for_msaa_if_needed()
4212 v3dv_job_init(job, V3DV_JOB_TYPE_GPU_CL, cmd_buffer->device, cmd_buffer, in cmd_buffer_restart_job_for_msaa_if_needed()
4214 cmd_buffer->state.job = job; in cmd_buffer_restart_job_for_msaa_if_needed()
4216 v3dv_job_start_frame(job, in cmd_buffer_restart_job_for_msaa_if_needed()
4234 * an active job. In that case, create a new job continuing the current in cmd_buffer_emit_pre_draw()
4237 struct v3dv_job *job = cmd_buffer->state.job; in cmd_buffer_emit_pre_draw() local
4238 if (!job) { in cmd_buffer_emit_pre_draw()
4239 job = v3dv_cmd_buffer_subpass_resume(cmd_buffer, in cmd_buffer_emit_pre_draw()
4243 /* Restart single sample job for MSAA pipeline if needed */ in cmd_buffer_emit_pre_draw()
4246 /* If the job is configured to flush on every draw call we need to create in cmd_buffer_emit_pre_draw()
4247 * a new job now. in cmd_buffer_emit_pre_draw()
4249 job = cmd_buffer_pre_draw_split_job(cmd_buffer); in cmd_buffer_emit_pre_draw()
4250 job->draw_count++; in cmd_buffer_emit_pre_draw()
4349 struct v3dv_job *job = cmd_buffer->state.job; in v3dv_CmdDrawIndexed() local
4350 assert(job); in v3dv_CmdDrawIndexed()
4359 &job->bcl, cl_packet_length(BASE_VERTEX_BASE_INSTANCE)); in v3dv_CmdDrawIndexed()
4362 cl_emit(&job->bcl, BASE_VERTEX_BASE_INSTANCE, base) { in v3dv_CmdDrawIndexed()
4370 &job->bcl, cl_packet_length(INDEXED_PRIM_LIST)); in v3dv_CmdDrawIndexed()
4373 cl_emit(&job->bcl, INDEXED_PRIM_LIST, prim) { in v3dv_CmdDrawIndexed()
4382 &job->bcl, cl_packet_length(INDEXED_INSTANCED_PRIM_LIST)); in v3dv_CmdDrawIndexed()
4385 cl_emit(&job->bcl, INDEXED_INSTANCED_PRIM_LIST, prim) { in v3dv_CmdDrawIndexed()
4412 struct v3dv_job *job = cmd_buffer->state.job; in v3dv_CmdDrawIndirect() local
4413 assert(job); in v3dv_CmdDrawIndirect()
4419 &job->bcl, cl_packet_length(INDIRECT_VERTEX_ARRAY_INSTANCED_PRIMS)); in v3dv_CmdDrawIndirect()
4422 cl_emit(&job->bcl, INDIRECT_VERTEX_ARRAY_INSTANCED_PRIMS, prim) { in v3dv_CmdDrawIndirect()
4447 struct v3dv_job *job = cmd_buffer->state.job; in v3dv_CmdDrawIndexedIndirect() local
4448 assert(job); in v3dv_CmdDrawIndexedIndirect()
4455 &job->bcl, cl_packet_length(INDIRECT_INDEXED_INSTANCED_PRIM_LIST)); in v3dv_CmdDrawIndexedIndirect()
4458 cl_emit(&job->bcl, INDIRECT_INDEXED_INSTANCED_PRIM_LIST, prim) { in v3dv_CmdDrawIndexedIndirect()
4489 /* If we have a recording job, finish it here */ in v3dv_CmdPipelineBarrier()
4490 struct v3dv_job *job = cmd_buffer->state.job; in v3dv_CmdPipelineBarrier() local
4491 if (job) in v3dv_CmdPipelineBarrier()
4560 struct v3dv_job *job = cmd_buffer->state.job; in v3dv_CmdBindIndexBuffer() local
4561 assert(job); in v3dv_CmdBindIndexBuffer()
4564 &job->bcl, cl_packet_length(INDEX_BUFFER_SETUP)); in v3dv_CmdBindIndexBuffer()
4569 /* If we have started a new job we always need to emit index buffer state. in v3dv_CmdBindIndexBuffer()
4581 cl_emit(&job->bcl, INDEX_BUFFER_SETUP, ib) { in v3dv_CmdBindIndexBuffer()
4768 * be in the middle of job recording. in v3dv_cmd_buffer_reset_queries()
4771 assert(cmd_buffer->state.job == NULL); in v3dv_cmd_buffer_reset_queries()
4776 struct v3dv_job *job = in v3dv_cmd_buffer_reset_queries() local
4782 job->cpu.query_reset.pool = pool; in v3dv_cmd_buffer_reset_queries()
4783 job->cpu.query_reset.first = first; in v3dv_cmd_buffer_reset_queries()
4784 job->cpu.query_reset.count = count; in v3dv_cmd_buffer_reset_queries()
4786 list_addtail(&job->list_link, &cmd_buffer->jobs); in v3dv_cmd_buffer_reset_queries()
4840 * job to flag all of these queries as possibly available right after the in v3dv_cmd_buffer_end_query()
4841 * render pass job in which they have been recorded. in v3dv_cmd_buffer_end_query()
4857 /* Otherwise, schedule the CPU job immediately */ in v3dv_cmd_buffer_end_query()
4858 struct v3dv_job *job = in v3dv_cmd_buffer_end_query() local
4864 job->cpu.query_end.pool = pool; in v3dv_cmd_buffer_end_query()
4865 job->cpu.query_end.query = query; in v3dv_cmd_buffer_end_query()
4866 list_addtail(&job->list_link, &cmd_buffer->jobs); in v3dv_cmd_buffer_end_query()
4884 * be in the middle of job recording. in v3dv_cmd_buffer_copy_query_results()
4887 assert(cmd_buffer->state.job == NULL); in v3dv_cmd_buffer_copy_query_results()
4892 struct v3dv_job *job = in v3dv_cmd_buffer_copy_query_results() local
4898 job->cpu.query_copy_results.pool = pool; in v3dv_cmd_buffer_copy_query_results()
4899 job->cpu.query_copy_results.first = first; in v3dv_cmd_buffer_copy_query_results()
4900 job->cpu.query_copy_results.count = count; in v3dv_cmd_buffer_copy_query_results()
4901 job->cpu.query_copy_results.dst = dst; in v3dv_cmd_buffer_copy_query_results()
4902 job->cpu.query_copy_results.offset = offset; in v3dv_cmd_buffer_copy_query_results()
4903 job->cpu.query_copy_results.stride = stride; in v3dv_cmd_buffer_copy_query_results()
4904 job->cpu.query_copy_results.flags = flags; in v3dv_cmd_buffer_copy_query_results()
4906 list_addtail(&job->list_link, &cmd_buffer->jobs); in v3dv_cmd_buffer_copy_query_results()
4914 struct v3dv_job *job = vk_zalloc(&device->alloc, in v3dv_cmd_buffer_add_tfu_job() local
4917 if (!job) { in v3dv_cmd_buffer_add_tfu_job()
4922 v3dv_job_init(job, V3DV_JOB_TYPE_GPU_TFU, device, cmd_buffer, -1); in v3dv_cmd_buffer_add_tfu_job()
4923 job->tfu = *tfu; in v3dv_cmd_buffer_add_tfu_job()
4924 list_addtail(&job->list_link, &cmd_buffer->jobs); in v3dv_cmd_buffer_add_tfu_job()
4936 * should not be in the middle of job recording. in v3dv_CmdSetEvent()
4939 assert(cmd_buffer->state.job == NULL); in v3dv_CmdSetEvent()
4941 struct v3dv_job *job = in v3dv_CmdSetEvent() local
4947 job->cpu.event_set.event = event; in v3dv_CmdSetEvent()
4948 job->cpu.event_set.state = 1; in v3dv_CmdSetEvent()
4950 list_addtail(&job->list_link, &cmd_buffer->jobs); in v3dv_CmdSetEvent()
4962 * should not be in the middle of job recording. in v3dv_CmdResetEvent()
4965 assert(cmd_buffer->state.job == NULL); in v3dv_CmdResetEvent()
4967 struct v3dv_job *job = in v3dv_CmdResetEvent() local
4973 job->cpu.event_set.event = event; in v3dv_CmdResetEvent()
4974 job->cpu.event_set.state = 0; in v3dv_CmdResetEvent()
4976 list_addtail(&job->list_link, &cmd_buffer->jobs); in v3dv_CmdResetEvent()
4996 struct v3dv_job *job = in v3dv_CmdWaitEvents() local
5004 job->cpu.event_wait.events = in v3dv_CmdWaitEvents()
5007 if (!job->cpu.event_wait.events) { in v3dv_CmdWaitEvents()
5011 job->cpu.event_wait.event_count = eventCount; in v3dv_CmdWaitEvents()
5014 job->cpu.event_wait.events[i] = v3dv_event_from_handle(pEvents[i]); in v3dv_CmdWaitEvents()
5017 * an active job. in v3dv_CmdWaitEvents()
5020 * inside a render pass, it is safe to move the wait job so it happens right in v3dv_CmdWaitEvents()
5021 * before the current job we are currently recording for the subpass, if any in v3dv_CmdWaitEvents()
5025 * If we are outside a render pass then we should not have any on-going job in v3dv_CmdWaitEvents()
5026 * and we are free to just add the wait job without restrictions. in v3dv_CmdWaitEvents()
5028 assert(cmd_buffer->state.pass || !cmd_buffer->state.job); in v3dv_CmdWaitEvents()
5029 list_addtail(&job->list_link, &cmd_buffer->jobs); in v3dv_CmdWaitEvents()
5042 * job here... in v3dv_CmdWriteTimestamp()
5047 struct v3dv_job *job = in v3dv_CmdWriteTimestamp() local
5053 job->cpu.query_timestamp.pool = query_pool; in v3dv_CmdWriteTimestamp()
5054 job->cpu.query_timestamp.query = query; in v3dv_CmdWriteTimestamp()
5056 list_addtail(&job->list_link, &cmd_buffer->jobs); in v3dv_CmdWriteTimestamp()
5057 cmd_buffer->state.job = NULL; in v3dv_CmdWriteTimestamp()
5103 struct v3dv_job *job = info->csd_job; in v3dv_cmd_buffer_rewrite_indirect_csd_job() local
5105 assert(job->type == V3DV_JOB_TYPE_GPU_CSD); in v3dv_cmd_buffer_rewrite_indirect_csd_job()
5108 struct drm_v3d_submit_csd *submit = &job->csd.submit; in v3dv_cmd_buffer_rewrite_indirect_csd_job()
5110 job->csd.wg_count[0] = wg_counts[0]; in v3dv_cmd_buffer_rewrite_indirect_csd_job()
5111 job->csd.wg_count[1] = wg_counts[1]; in v3dv_cmd_buffer_rewrite_indirect_csd_job()
5112 job->csd.wg_count[2] = wg_counts[2]; in v3dv_cmd_buffer_rewrite_indirect_csd_job()
5124 * job, since we are about to overwrite some of the uniform data. in v3dv_cmd_buffer_rewrite_indirect_csd_job()
5127 v3dv_bo_wait(job->device, job->indirect.bo, infinite); in v3dv_cmd_buffer_rewrite_indirect_csd_job()
5134 assert(info->wg_uniform_offsets[i] >= (uint32_t *) job->indirect.base); in v3dv_cmd_buffer_rewrite_indirect_csd_job()
5135 assert(info->wg_uniform_offsets[i] < (uint32_t *) job->indirect.next); in v3dv_cmd_buffer_rewrite_indirect_csd_job()
5153 struct v3dv_job *job = vk_zalloc(&cmd_buffer->device->alloc, in cmd_buffer_create_csd_job() local
5156 if (!job) { in cmd_buffer_create_csd_job()
5161 v3dv_job_init(job, V3DV_JOB_TYPE_GPU_CSD, cmd_buffer->device, cmd_buffer, -1); in cmd_buffer_create_csd_job()
5162 cmd_buffer->state.job = job; in cmd_buffer_create_csd_job()
5164 struct drm_v3d_submit_csd *submit = &job->csd.submit; in cmd_buffer_create_csd_job()
5166 job->csd.wg_count[0] = group_count_x; in cmd_buffer_create_csd_job()
5167 job->csd.wg_count[1] = group_count_y; in cmd_buffer_create_csd_job()
5168 job->csd.wg_count[2] = group_count_z; in cmd_buffer_create_csd_job()
5203 job->csd.shared_memory = in cmd_buffer_create_csd_job()
5207 if (!job->csd.shared_memory) { in cmd_buffer_create_csd_job()
5209 return job; in cmd_buffer_create_csd_job()
5213 v3dv_job_add_bo(job, variant->assembly_bo); in cmd_buffer_create_csd_job()
5220 v3dv_job_add_bo(job, uniforms.bo); in cmd_buffer_create_csd_job()
5222 return job; in cmd_buffer_create_csd_job()
5234 struct v3dv_job *job = in cmd_buffer_dispatch() local
5241 list_addtail(&job->list_link, &cmd_buffer->jobs); in cmd_buffer_dispatch()
5242 cmd_buffer->state.job = NULL; in cmd_buffer_dispatch()
5262 /* We can't do indirect dispatches, so instead we record a CPU job that, in cmd_buffer_dispatch_indirect()
5266 struct v3dv_job *job = in cmd_buffer_dispatch_indirect() local
5272 /* We need to create a CSD job now, even if we still don't know the actual in cmd_buffer_dispatch_indirect()
5273 * dispatch parameters, because the job setup needs to be done using the in cmd_buffer_dispatch_indirect()
5275 * constants, etc.). So we create the job with default dispatch parameters in cmd_buffer_dispatch_indirect()
5277 * parameters don't match the ones we used to setup the job. in cmd_buffer_dispatch_indirect()
5282 &job->cpu.csd_indirect.wg_uniform_offsets[0], in cmd_buffer_dispatch_indirect()
5283 &job->cpu.csd_indirect.wg_size); in cmd_buffer_dispatch_indirect()
5287 job->cpu.csd_indirect.buffer = buffer; in cmd_buffer_dispatch_indirect()
5288 job->cpu.csd_indirect.offset = offset; in cmd_buffer_dispatch_indirect()
5289 job->cpu.csd_indirect.csd_job = csd_job; in cmd_buffer_dispatch_indirect()
5294 job->cpu.csd_indirect.needs_wg_uniform_rewrite = in cmd_buffer_dispatch_indirect()
5295 job->cpu.csd_indirect.wg_uniform_offsets[0] || in cmd_buffer_dispatch_indirect()
5296 job->cpu.csd_indirect.wg_uniform_offsets[1] || in cmd_buffer_dispatch_indirect()
5297 job->cpu.csd_indirect.wg_uniform_offsets[2]; in cmd_buffer_dispatch_indirect()
5299 list_addtail(&job->list_link, &cmd_buffer->jobs); in cmd_buffer_dispatch_indirect()
5300 cmd_buffer->state.job = NULL; in cmd_buffer_dispatch_indirect()