Lines Matching refs:v3d

41 v3d_job_free(struct v3d_context *v3d, struct v3d_job *job)
48 _mesa_hash_table_remove_key(v3d->jobs, &job->key);
54 _mesa_hash_table_remove_key(v3d->write_jobs, prsc);
60 _mesa_hash_table_remove_key(v3d->write_jobs,
68 _mesa_hash_table_remove_key(v3d->write_jobs,
71 _mesa_hash_table_remove_key(v3d->write_jobs,
78 if (v3d->job == job)
79 v3d->job = NULL;
91 v3d_job_create(struct v3d_context *v3d)
93 struct v3d_job *job = rzalloc(v3d, struct v3d_job);
95 job->v3d = v3d;
139 struct v3d_context *v3d = job->v3d;
148 _mesa_hash_table_insert(v3d->write_jobs, prsc, job);
152 v3d_flush_jobs_using_bo(struct v3d_context *v3d, struct v3d_bo *bo)
154 hash_table_foreach(v3d->jobs, entry) {
158 v3d_job_submit(v3d, job);
187 v3d_flush_jobs_writing_resource(struct v3d_context *v3d,
192 struct hash_entry *entry = _mesa_hash_table_search(v3d->write_jobs,
202 v3d->sync_on_last_compute_job = true;
217 needs_flush = !v3d->job || v3d->job != job;
232 v3d_job_submit(v3d, job);
236 v3d_flush_jobs_reading_resource(struct v3d_context *v3d,
249 v3d_flush_jobs_writing_resource(v3d, prsc, flush_cond,
252 hash_table_foreach(v3d->jobs, entry) {
261 needs_flush = !v3d->job || v3d->job != job;
270 v3d_job_submit(v3d, job);
272 /* Reminder: v3d->jobs is safe to keep iterating even
288 v3d_get_job(struct v3d_context *v3d,
305 struct hash_entry *entry = _mesa_hash_table_search(v3d->jobs,
313 struct v3d_job *job = v3d_job_create(v3d);
318 v3d_flush_jobs_reading_resource(v3d, cbufs[i]->texture,
328 v3d_flush_jobs_reading_resource(v3d, zsbuf->texture,
343 _mesa_hash_table_insert(v3d->write_jobs,
347 _mesa_hash_table_insert(v3d->write_jobs, zsbuf->texture, job);
351 v3d_flush_jobs_reading_resource(v3d,
355 _mesa_hash_table_insert(v3d->write_jobs,
365 _mesa_hash_table_insert(v3d->jobs, &job->key, job);
371 v3d_get_job_for_fbo(struct v3d_context *v3d)
373 if (v3d->job)
374 return v3d->job;
376 uint32_t nr_cbufs = v3d->framebuffer.nr_cbufs;
377 struct pipe_surface **cbufs = v3d->framebuffer.cbufs;
378 struct pipe_surface *zsbuf = v3d->framebuffer.zsbuf;
379 struct v3d_job *job = v3d_get_job(v3d, nr_cbufs, cbufs, zsbuf, NULL);
381 if (v3d->framebuffer.samples >= 1) {
391 /* The dirty flags are tracking what's been updated while v3d->job has
395 v3d->dirty = ~0;
420 job->draw_tiles_x = DIV_ROUND_UP(v3d->framebuffer.width,
422 job->draw_tiles_y = DIV_ROUND_UP(v3d->framebuffer.height,
425 v3d->job = job;
431 v3d_clif_dump(struct v3d_context *v3d, struct v3d_job *job)
438 struct clif_dump *clif = clif_dump_init(&v3d->screen->devinfo,
461 v3d_read_and_accumulate_primitive_counters(struct v3d_context *v3d)
463 assert(v3d->prim_counts);
466 struct v3d_resource *rsc = v3d_resource(v3d->prim_counts);
468 uint32_t *map = v3d_bo_map(rsc->bo) + v3d->prim_counts_offset;
469 v3d->tf_prims_generated += map[V3D_PRIM_COUNTS_TF_WRITTEN];
473 if (v3d->prog.gs)
474 v3d->prims_generated += map[V3D_PRIM_COUNTS_WRITTEN];
482 v3d_job_submit(struct v3d_context *v3d, struct v3d_job *job)
484 struct v3d_screen *screen = v3d->screen;
493 v3d->n_primitives_generated_queries_in_flight > 0 &&
494 v3d->prog.gs;
497 v3d_ensure_prim_counts_allocated(v3d);
506 v3d41_bcl_epilogue(v3d, job);
508 v3d33_bcl_epilogue(v3d, job);
515 job->submit.in_sync_rcl = v3d->out_sync;
518 job->submit.out_sync = v3d->out_sync;
523 if (v3d->active_perfmon) {
525 job->submit.perfmon_id = v3d->active_perfmon->kperfmon_id;
532 if (v3d->active_perfmon != v3d->last_perfmon) {
533 v3d->last_perfmon = v3d->active_perfmon;
534 job->submit.in_sync_bcl = v3d->out_sync;
553 v3d_clif_dump(v3d, job);
558 ret = v3d_ioctl(v3d->fd, DRM_IOCTL_V3D_SUBMIT_CL, &job->submit);
565 if (v3d->active_perfmon)
566 v3d->active_perfmon->job_submitted = true;
585 (v3d->streamout.num_targets &&
587 v3d_read_and_accumulate_primitive_counters(v3d);
591 v3d_job_free(v3d, job);
607 v3d_job_init(struct v3d_context *v3d)
609 v3d->jobs = _mesa_hash_table_create(v3d,
612 v3d->write_jobs = _mesa_hash_table_create(v3d,