Lines Matching refs:job

37                struct v3dv_job *job,
51 set_foreach(job->bos, entry) {
93 /* If we're not the first job, that means we're waiting on some
127 handle_reset_query_cpu_job(struct v3dv_queue *queue, struct v3dv_job *job,
130 struct v3dv_reset_query_cpu_job_info *info = &job->cpu.query_reset;
138 v3dv_bo_wait(job->device, info->pool->bo, PIPE_TIMEOUT_INFINITE);
156 VkResult result = vk_sync_wait_many(&job->device->vk, wait_count, waits,
163 v3dv_reset_query_pools(job->device, info->pool, info->first, info->count);
169 export_perfmon_last_job_sync(struct v3dv_queue *queue, struct v3dv_job *job, int *fd)
172 if (job->device->pdevice->caps.multisync) {
182 err = drmSyncobjExportSyncFile(job->device->pdevice->render_fd,
188 return vk_errorf(&job->device->queue, VK_ERROR_UNKNOWN,
197 return vk_errorf(&job->device->queue, VK_ERROR_UNKNOWN,
202 err = drmSyncobjExportSyncFile(job->device->pdevice->render_fd,
207 return vk_errorf(&job->device->queue, VK_ERROR_UNKNOWN,
215 handle_end_query_cpu_job(struct v3dv_job *job, uint32_t counter_pass_idx)
219 mtx_lock(&job->device->query_mutex);
221 struct v3dv_end_query_cpu_job_info *info = &job->cpu.query_end;
222 struct v3dv_queue *queue = &job->device->queue;
228 result = export_perfmon_last_job_sync(queue, job, &fd);
242 err = drmSyncobjImportSyncFile(job->device->pdevice->render_fd,
259 cnd_broadcast(&job->device->query_ended);
260 mtx_unlock(&job->device->query_mutex);
266 handle_copy_query_results_cpu_job(struct v3dv_job *job)
269 &job->cpu.query_copy_results;
276 if (!bo->map && !v3dv_bo_map(job->device, bo, bo->size))
277 return vk_error(job->device, VK_ERROR_OUT_OF_HOST_MEMORY);
281 v3dv_get_query_pool_results(job->device,
293 handle_set_event_cpu_job(struct v3dv_queue *queue, struct v3dv_job *job,
314 struct v3dv_event_set_cpu_job_info *info = &job->cpu.event_set;
321 check_wait_events_complete(struct v3dv_job *job)
323 assert(job->type == V3DV_JOB_TYPE_CPU_WAIT_EVENTS);
325 struct v3dv_event_wait_cpu_job_info *info = &job->cpu.event_wait;
334 handle_wait_events_cpu_job(struct v3dv_job *job)
336 assert(job->type == V3DV_JOB_TYPE_CPU_WAIT_EVENTS);
340 while (!check_wait_events_complete(job))
348 struct v3dv_job *job,
351 assert(job->type == V3DV_JOB_TYPE_CPU_COPY_BUFFER_TO_IMAGE);
353 &job->cpu.copy_buffer_to_image;
365 if (!dst_bo->map && !v3dv_bo_map(job->device, dst_bo, dst_bo->size))
366 return vk_error(job->device, VK_ERROR_OUT_OF_HOST_MEMORY);
371 if (!src_bo->map && !v3dv_bo_map(job->device, src_bo, src_bo->size))
372 return vk_error(job->device, VK_ERROR_OUT_OF_HOST_MEMORY);
400 handle_timestamp_query_cpu_job(struct v3dv_queue *queue, struct v3dv_job *job,
403 assert(job->type == V3DV_JOB_TYPE_CPU_TIMESTAMP_QUERY);
404 struct v3dv_timestamp_query_cpu_job_info *info = &job->cpu.query_timestamp;
411 mtx_lock(&job->device->query_mutex);
425 cnd_broadcast(&job->device->query_ended);
426 mtx_unlock(&job->device->query_mutex);
433 struct v3dv_job *job,
436 assert(job->type == V3DV_JOB_TYPE_CPU_CSD_INDIRECT);
437 struct v3dv_csd_indirect_cpu_job_info *info = &job->cpu.csd_indirect;
447 if (!bo->map && !v3dv_bo_map(job->device, bo, bo->size))
448 return vk_error(job->device, VK_ERROR_OUT_OF_HOST_MEMORY);
475 /* If multisync is supported, we wait on semaphores in the first job
535 /* If multisync is supported, we are signalling semaphores in the last job
579 struct v3dv_job *job,
587 /* If this is the first job submitted to a given GPU queue in this cmd buf
593 /* If the serialize flag is set the job needs to be serialized in the
598 * barrier is a CL and/or a TFU job.
600 bool sync_csd = job->serialize & V3DV_BARRIER_COMPUTE_BIT;
601 bool sync_tfu = job->serialize & V3DV_BARRIER_TRANSFER_BIT;
602 bool sync_cl = job->serialize & (V3DV_BARRIER_GRAPHICS_BIT |
642 struct v3dv_job *job,
653 * this v3dv_queue_type to track the last job submitted to this queue.
696 struct v3dv_job *job,
705 in_syncs = set_in_syncs(queue, job, queue_sync,
710 out_syncs = set_out_syncs(queue, job, queue_sync,
737 struct v3dv_job *job,
746 /* Sanity check: we should only flag a bcl sync on a job that needs to be
749 assert(job->serialize || !job->needs_bcl_sync);
751 /* We expect to have just one RCL per job which should fit in just one BO.
754 assert(list_length(&job->rcl.bo_list) == 1);
755 assert(list_length(&job->bcl.bo_list) >= 1);
757 list_first_entry(&job->bcl.bo_list, struct v3dv_bo, list_link);
759 submit.bcl_end = job->bcl.bo->offset + v3dv_cl_offset(&job->bcl);
760 submit.rcl_start = job->rcl.bo->offset;
761 submit.rcl_end = job->rcl.bo->offset + v3dv_cl_offset(&job->rcl);
763 submit.qma = job->tile_alloc->offset;
764 submit.qms = job->tile_alloc->size;
765 submit.qts = job->tile_state->offset;
768 if (job->tmu_dirty_rcl)
771 /* If the job uses VK_KHR_buffer_device_addess we need to ensure all
775 if (job->uses_buffer_device_address) {
778 v3dv_job_add_bo(job, *bo);
782 submit.bo_handle_count = job->bo_count;
786 set_foreach(job->bos, entry) {
793 submit.perfmon_id = job->perf ?
794 job->perf->kperfmon_ids[counter_pass_idx] : 0;
798 /* We need a binning sync if we are the first CL job waiting on a semaphore
799 * with a wait stage that involves the geometry pipeline, or if the job
803 * We need a render sync if the job doesn't need a binning sync but has
805 * don't start until the previous RCL job has finished so we don't really
807 * TFU job, which are not automatically serialized with CL jobs.
809 bool needs_bcl_sync = job->needs_bcl_sync || needs_perf_sync;
825 bool needs_rcl_sync = job->serialize && !needs_bcl_sync;
833 set_multisync(&ms, sync_info, NULL, device, job,
851 v3dv_clif_dump(device, job, &submit);
875 struct v3dv_job *job,
881 const bool needs_sync = sync_info->wait_count || job->serialize;
888 set_multisync(&ms, sync_info, NULL, device, job,
893 job->tfu.flags |= DRM_V3D_SUBMIT_EXTENSION;
894 job->tfu.extensions = (uintptr_t)(void *)&ms;
896 job->tfu.in_sync = 0;
897 job->tfu.out_sync = 0;
900 job->tfu.in_sync = needs_sync ? last_job_sync : 0;
901 job->tfu.out_sync = last_job_sync;
904 DRM_IOCTL_V3D_SUBMIT_TFU, &job->tfu);
917 struct v3dv_job *job,
924 struct drm_v3d_submit_csd *submit = &job->csd.submit;
926 /* If the job uses VK_KHR_buffer_device_addess we need to ensure all
930 if (job->uses_buffer_device_address) {
933 v3dv_job_add_bo(job, *bo);
937 submit->bo_handle_count = job->bo_count;
941 set_foreach(job->bos, entry) {
948 const bool needs_sync = sync_info->wait_count || job->serialize;
955 set_multisync(&ms, sync_info, NULL, device, job,
970 submit->perfmon_id = job->perf ?
971 job->perf->kperfmon_ids[counter_pass_idx] : 0;
996 struct v3dv_job *job,
1001 switch (job->type) {
1003 return handle_cl_job(queue, job, counter_pass_idx, sync_info, signal_syncs);
1005 return handle_tfu_job(queue, job, sync_info, signal_syncs);
1007 return handle_csd_job(queue, job, counter_pass_idx, sync_info, signal_syncs);
1009 return handle_reset_query_cpu_job(queue, job, sync_info);
1011 return handle_end_query_cpu_job(job, counter_pass_idx);
1013 return handle_copy_query_results_cpu_job(job);
1015 return handle_set_event_cpu_job(queue, job, sync_info);
1017 return handle_wait_events_cpu_job(job);
1019 return handle_copy_buffer_to_image_cpu_job(queue, job, sync_info);
1021 return handle_csd_indirect_cpu_job(queue, job, sync_info);
1023 return handle_timestamp_query_cpu_job(queue, job, sync_info);
1025 unreachable("Unhandled job type");
1092 list_for_each_entry_safe(struct v3dv_job, job,
1095 result = queue_handle_job(queue, job, submit->perf_pass_index,
1114 /* Finish by submitting a no-op job that synchronizes across all queues.