Lines Matching refs:exec

51 	struct vc4_exec_info *exec,			\
106 vc4_use_bo(struct vc4_exec_info *exec, uint32_t hindex) in vc4_use_bo() argument
108 struct vc4_dev *vc4 = exec->dev; in vc4_use_bo()
115 if (hindex >= exec->bo_count) { in vc4_use_bo()
117 hindex, exec->bo_count); in vc4_use_bo()
120 obj = exec->bo[hindex]; in vc4_use_bo()
133 vc4_use_handle(struct vc4_exec_info *exec, uint32_t gem_handles_packet_index) in vc4_use_handle() argument
135 return vc4_use_bo(exec, exec->bo_index[gem_handles_packet_index]); in vc4_use_handle()
139 validate_bin_pos(struct vc4_exec_info *exec, void *untrusted, uint32_t pos) in validate_bin_pos() argument
144 return (untrusted - 1 == exec->bin_u + pos); in validate_bin_pos()
163 vc4_check_tex_size(struct vc4_exec_info *exec, struct drm_gem_dma_object *fbo, in vc4_check_tex_size() argument
167 struct vc4_dev *vc4 = exec->dev; in vc4_check_tex_size()
224 if (!validate_bin_pos(exec, untrusted, exec->args->bin_cl_size - 1)) { in validate_flush()
228 exec->found_flush = true; in validate_flush()
236 if (exec->found_start_tile_binning_packet) { in validate_start_tile_binning()
240 exec->found_start_tile_binning_packet = true; in validate_start_tile_binning()
242 if (!exec->found_tile_binning_mode_config_packet) { in validate_start_tile_binning()
253 if (!validate_bin_pos(exec, untrusted, exec->args->bin_cl_size - 2)) { in validate_increment_semaphore()
258 exec->found_increment_semaphore_packet = true; in validate_increment_semaphore()
274 if (exec->shader_state_count == 0) { in validate_indexed_prim_list()
278 shader_state = &exec->shader_state[exec->shader_state_count - 1]; in validate_indexed_prim_list()
283 ib = vc4_use_handle(exec, 0); in validate_indexed_prim_list()
287 exec->bin_dep_seqno = max(exec->bin_dep_seqno, in validate_indexed_prim_list()
311 if (exec->shader_state_count == 0) { in validate_gl_array_primitive()
315 shader_state = &exec->shader_state[exec->shader_state_count - 1]; in validate_gl_array_primitive()
332 uint32_t i = exec->shader_state_count++; in validate_gl_shader_state()
334 if (i >= exec->shader_state_size) { in validate_gl_shader_state()
339 exec->shader_state[i].addr = *(uint32_t *)untrusted; in validate_gl_shader_state()
340 exec->shader_state[i].max_index = 0; in validate_gl_shader_state()
342 if (exec->shader_state[i].addr & ~0xf) { in validate_gl_shader_state()
347 *(uint32_t *)validated = (exec->shader_rec_p + in validate_gl_shader_state()
348 exec->shader_state[i].addr); in validate_gl_shader_state()
350 exec->shader_rec_p += in validate_gl_shader_state()
351 roundup(gl_shader_rec_size(exec->shader_state[i].addr), 16); in validate_gl_shader_state()
359 struct drm_device *dev = exec->exec_bo->base.dev; in validate_tile_binning_config()
366 if (exec->found_tile_binning_mode_config_packet) { in validate_tile_binning_config()
370 exec->found_tile_binning_mode_config_packet = true; in validate_tile_binning_config()
372 exec->bin_tiles_x = *(uint8_t *)(untrusted + 12); in validate_tile_binning_config()
373 exec->bin_tiles_y = *(uint8_t *)(untrusted + 13); in validate_tile_binning_config()
374 tile_count = exec->bin_tiles_x * exec->bin_tiles_y; in validate_tile_binning_config()
377 if (exec->bin_tiles_x == 0 || in validate_tile_binning_config()
378 exec->bin_tiles_y == 0) { in validate_tile_binning_config()
380 exec->bin_tiles_x, exec->bin_tiles_y); in validate_tile_binning_config()
402 exec->bin_slots |= BIT(bin_slot); in validate_tile_binning_config()
411 exec->tile_alloc_offset = bin_addr + roundup(tile_state_size, 4096); in validate_tile_binning_config()
423 *(uint32_t *)(validated + 0) = exec->tile_alloc_offset; in validate_tile_binning_config()
426 exec->tile_alloc_offset); in validate_tile_binning_config()
436 memcpy(exec->bo_index, untrusted, sizeof(exec->bo_index)); in validate_gem_handles()
446 int (*func)(struct vc4_exec_info *exec, void *validated,
491 struct vc4_exec_info *exec) in vc4_validate_bin_cl() argument
494 uint32_t len = exec->args->bin_cl_size; in vc4_validate_bin_cl()
531 if (info->func && info->func(exec, in vc4_validate_bin_cl()
549 exec->ct0ea = exec->ct0ca + dst_offset; in vc4_validate_bin_cl()
551 if (!exec->found_start_tile_binning_packet) { in vc4_validate_bin_cl()
563 if (!exec->found_increment_semaphore_packet || !exec->found_flush) { in vc4_validate_bin_cl()
573 reloc_tex(struct vc4_exec_info *exec, in reloc_tex() argument
585 uint32_t *validated_p0 = exec->uniforms_v + sample->p_offset[0]; in reloc_tex()
595 tex = vc4_use_bo(exec, texture_handle_index); in reloc_tex()
690 if (!vc4_check_tex_size(exec, tex, offset + cube_map_stride * 5, in reloc_tex()
742 exec->bin_dep_seqno = max(exec->bin_dep_seqno, in reloc_tex()
757 struct vc4_exec_info *exec, in validate_gl_shader_rec() argument
778 if (nr_relocs * 4 > exec->shader_rec_size) { in validate_gl_shader_rec()
781 nr_relocs, exec->shader_rec_size); in validate_gl_shader_rec()
784 src_handles = exec->shader_rec_u; in validate_gl_shader_rec()
785 exec->shader_rec_u += nr_relocs * 4; in validate_gl_shader_rec()
786 exec->shader_rec_size -= nr_relocs * 4; in validate_gl_shader_rec()
788 if (packet_size > exec->shader_rec_size) { in validate_gl_shader_rec()
791 packet_size, exec->shader_rec_size); in validate_gl_shader_rec()
794 pkt_u = exec->shader_rec_u; in validate_gl_shader_rec()
795 pkt_v = exec->shader_rec_v; in validate_gl_shader_rec()
797 exec->shader_rec_u += packet_size; in validate_gl_shader_rec()
804 exec->shader_rec_v += roundup(packet_size, 16); in validate_gl_shader_rec()
805 exec->shader_rec_size -= packet_size; in validate_gl_shader_rec()
808 if (src_handles[i] > exec->bo_count) { in validate_gl_shader_rec()
813 bo[i] = exec->bo[src_handles[i]]; in validate_gl_shader_rec()
818 bo[i] = vc4_use_bo(exec, src_handles[i]); in validate_gl_shader_rec()
856 exec->uniforms_size) { in validate_gl_shader_rec()
861 texture_handles_u = exec->uniforms_u; in validate_gl_shader_rec()
865 memcpy(exec->uniforms_v, uniform_data_u, in validate_gl_shader_rec()
871 if (!reloc_tex(exec, in validate_gl_shader_rec()
888 ((uint32_t *)exec->uniforms_v)[o] = exec->uniforms_p; in validate_gl_shader_rec()
891 *(uint32_t *)(pkt_v + o + 4) = exec->uniforms_p; in validate_gl_shader_rec()
893 exec->uniforms_u += validated_shader->uniforms_src_size; in validate_gl_shader_rec()
894 exec->uniforms_v += validated_shader->uniforms_size; in validate_gl_shader_rec()
895 exec->uniforms_p += validated_shader->uniforms_size; in validate_gl_shader_rec()
907 exec->bin_dep_seqno = max(exec->bin_dep_seqno, in validate_gl_shader_rec()
939 struct vc4_exec_info *exec) in vc4_validate_shader_recs() argument
948 for (i = 0; i < exec->shader_state_count; i++) { in vc4_validate_shader_recs()
949 ret = validate_gl_shader_rec(dev, exec, &exec->shader_state[i]); in vc4_validate_shader_recs()