Lines Matching refs:job
48 vc5_job_free(struct vc5_context *vc5, struct vc5_job *job) in vc5_job_free() argument
52 set_foreach(job->bos, entry) { in vc5_job_free()
57 remove_from_ht(vc5->jobs, &job->key); in vc5_job_free()
59 if (job->write_prscs) { in vc5_job_free()
62 set_foreach(job->write_prscs, entry) { in vc5_job_free()
70 if (job->cbufs[i]) { in vc5_job_free()
71 remove_from_ht(vc5->write_jobs, job->cbufs[i]->texture); in vc5_job_free()
72 pipe_surface_reference(&job->cbufs[i], NULL); in vc5_job_free()
75 if (job->zsbuf) { in vc5_job_free()
76 remove_from_ht(vc5->write_jobs, job->zsbuf->texture); in vc5_job_free()
77 pipe_surface_reference(&job->zsbuf, NULL); in vc5_job_free()
80 if (vc5->job == job) in vc5_job_free()
81 vc5->job = NULL; in vc5_job_free()
83 vc5_destroy_cl(&job->bcl); in vc5_job_free()
84 vc5_destroy_cl(&job->rcl); in vc5_job_free()
85 vc5_destroy_cl(&job->indirect); in vc5_job_free()
86 vc5_bo_unreference(&job->tile_alloc); in vc5_job_free()
87 vc5_bo_unreference(&job->tile_state); in vc5_job_free()
89 ralloc_free(job); in vc5_job_free()
95 struct vc5_job *job = rzalloc(vc5, struct vc5_job); in vc5_job_create() local
97 job->vc5 = vc5; in vc5_job_create()
99 vc5_init_cl(job, &job->bcl); in vc5_job_create()
100 vc5_init_cl(job, &job->rcl); in vc5_job_create()
101 vc5_init_cl(job, &job->indirect); in vc5_job_create()
103 job->draw_min_x = ~0; in vc5_job_create()
104 job->draw_min_y = ~0; in vc5_job_create()
105 job->draw_max_x = 0; in vc5_job_create()
106 job->draw_max_y = 0; in vc5_job_create()
108 job->bos = _mesa_set_create(job, in vc5_job_create()
111 return job; in vc5_job_create()
115 vc5_job_add_bo(struct vc5_job *job, struct vc5_bo *bo) in vc5_job_add_bo() argument
120 if (_mesa_set_search(job->bos, bo)) in vc5_job_add_bo()
124 _mesa_set_add(job->bos, bo); in vc5_job_add_bo()
125 job->referenced_size += bo->size; in vc5_job_add_bo()
127 uint32_t *bo_handles = (void *)(uintptr_t)job->submit.bo_handles; in vc5_job_add_bo()
129 if (job->submit.bo_handle_count >= job->bo_handles_size) { in vc5_job_add_bo()
130 job->bo_handles_size = MAX2(4, job->bo_handles_size * 2); in vc5_job_add_bo()
131 bo_handles = reralloc(job, bo_handles, in vc5_job_add_bo()
132 uint32_t, job->bo_handles_size); in vc5_job_add_bo()
133 job->submit.bo_handles = (uintptr_t)(void *)bo_handles; in vc5_job_add_bo()
135 bo_handles[job->submit.bo_handle_count++] = bo->handle; in vc5_job_add_bo()
139 vc5_job_add_write_resource(struct vc5_job *job, struct pipe_resource *prsc) in vc5_job_add_write_resource() argument
141 struct vc5_context *vc5 = job->vc5; in vc5_job_add_write_resource()
143 if (!job->write_prscs) { in vc5_job_add_write_resource()
144 job->write_prscs = _mesa_set_create(job, in vc5_job_add_write_resource()
149 _mesa_set_add(job->write_prscs, prsc); in vc5_job_add_write_resource()
150 _mesa_hash_table_insert(vc5->write_jobs, prsc, job); in vc5_job_add_write_resource()
160 struct vc5_job *job = entry->data; in vc5_flush_jobs_writing_resource() local
161 vc5_job_submit(vc5, job); in vc5_flush_jobs_writing_resource()
175 struct vc5_job *job = entry->data; in vc5_flush_jobs_reading_resource() local
177 if (_mesa_set_search(job->bos, rsc->bo)) { in vc5_flush_jobs_reading_resource()
178 vc5_job_submit(vc5, job); in vc5_flush_jobs_reading_resource()
188 vc5_job_set_tile_buffer_size(struct vc5_job *job) in vc5_job_set_tile_buffer_size() argument
198 if (job->msaa) in vc5_job_set_tile_buffer_size()
201 if (job->cbufs[3] || job->cbufs[2]) in vc5_job_set_tile_buffer_size()
203 else if (job->cbufs[1]) in vc5_job_set_tile_buffer_size()
208 if (job->cbufs[i]) { in vc5_job_set_tile_buffer_size()
209 struct vc5_surface *surf = vc5_surface(job->cbufs[i]); in vc5_job_set_tile_buffer_size()
213 job->internal_bpp = max_bpp; in vc5_job_set_tile_buffer_size()
218 job->tile_width = tile_sizes[tile_size_index * 2 + 0]; in vc5_job_set_tile_buffer_size()
219 job->tile_height = tile_sizes[tile_size_index * 2 + 1]; in vc5_job_set_tile_buffer_size()
252 struct vc5_job *job = vc5_job_create(vc5); in vc5_get_job() local
257 pipe_surface_reference(&job->cbufs[i], cbufs[i]); in vc5_get_job()
260 job->msaa = true; in vc5_get_job()
265 pipe_surface_reference(&job->zsbuf, zsbuf); in vc5_get_job()
267 job->msaa = true; in vc5_get_job()
270 vc5_job_set_tile_buffer_size(job); in vc5_get_job()
275 cbufs[i]->texture, job); in vc5_get_job()
278 _mesa_hash_table_insert(vc5->write_jobs, zsbuf->texture, job); in vc5_get_job()
280 memcpy(&job->key, &local_key, sizeof(local_key)); in vc5_get_job()
281 _mesa_hash_table_insert(vc5->jobs, &job->key, job); in vc5_get_job()
283 return job; in vc5_get_job()
289 if (vc5->job) in vc5_get_job_for_fbo()
290 return vc5->job; in vc5_get_job_for_fbo()
294 struct vc5_job *job = vc5_get_job(vc5, cbufs, zsbuf); in vc5_get_job_for_fbo() local
309 job->cleared |= PIPE_CLEAR_COLOR0 << i; in vc5_get_job_for_fbo()
316 job->cleared |= PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL; in vc5_get_job_for_fbo()
319 job->draw_tiles_x = DIV_ROUND_UP(vc5->framebuffer.width, in vc5_get_job_for_fbo()
320 job->tile_width); in vc5_get_job_for_fbo()
321 job->draw_tiles_y = DIV_ROUND_UP(vc5->framebuffer.height, in vc5_get_job_for_fbo()
322 job->tile_height); in vc5_get_job_for_fbo()
324 vc5->job = job; in vc5_get_job_for_fbo()
326 return job; in vc5_get_job_for_fbo()
332 struct vc5_job *job = data; in vc5_clif_dump_lookup() local
335 set_foreach(job->bos, entry) { in vc5_clif_dump_lookup()
350 vc5_clif_dump(struct vc5_context *vc5, struct vc5_job *job) in vc5_clif_dump() argument
357 job); in vc5_clif_dump()
360 job->submit.bcl_start, job->submit.bcl_end); in vc5_clif_dump()
362 clif_dump_add_cl(clif, job->submit.bcl_start, job->submit.bcl_end); in vc5_clif_dump()
365 job->submit.rcl_start, job->submit.rcl_end); in vc5_clif_dump()
366 clif_dump_add_cl(clif, job->submit.rcl_start, job->submit.rcl_end); in vc5_clif_dump()
373 vc5_job_submit(struct vc5_context *vc5, struct vc5_job *job) in vc5_job_submit() argument
377 if (!job->needs_flush) in vc5_job_submit()
383 if (job->draw_max_x <= job->draw_min_x || in vc5_job_submit()
384 job->draw_max_y <= job->draw_min_y) { in vc5_job_submit()
389 v3d41_emit_rcl(job); in vc5_job_submit()
391 v3d33_emit_rcl(job); in vc5_job_submit()
393 if (cl_offset(&job->bcl) > 0) { in vc5_job_submit()
394 vc5_cl_ensure_space_with_branch(&job->bcl, in vc5_job_submit()
398 if (job->oq_enabled) { in vc5_job_submit()
403 cl_emit(&job->bcl, OCCLUSION_QUERY_COUNTER, counter); in vc5_job_submit()
410 cl_emit(&job->bcl, INCREMENT_SEMAPHORE, incr); in vc5_job_submit()
417 cl_emit(&job->bcl, FLUSH_ALL_STATE, flush); in vc5_job_submit()
420 job->submit.bcl_end = job->bcl.bo->offset + cl_offset(&job->bcl); in vc5_job_submit()
421 job->submit.rcl_end = job->rcl.bo->offset + cl_offset(&job->rcl); in vc5_job_submit()
427 vc5_job_add_bo(job, job->tile_alloc); in vc5_job_submit()
428 job->submit.qma = job->tile_alloc->offset; in vc5_job_submit()
429 job->submit.qms = job->tile_alloc->size; in vc5_job_submit()
431 vc5_job_add_bo(job, job->tile_state); in vc5_job_submit()
432 job->submit.qts = job->tile_state->offset; in vc5_job_submit()
435 vc5_clif_dump(vc5, job); in vc5_job_submit()
441 ret = drmIoctl(vc5->fd, DRM_IOCTL_VC5_SUBMIT_CL, &job->submit); in vc5_job_submit()
443 ret = vc5_simulator_flush(vc5, &job->submit, job); in vc5_job_submit()
463 vc5_job_free(vc5, job); in vc5_job_submit()