Lines Matching full:output
39 struct vfe_output *output = &line->output; in vfe_disable_output() local
47 output->gen1.wait_sof = 1; in vfe_disable_output()
50 time = wait_for_completion_timeout(&output->sof, msecs_to_jiffies(VFE_NEXT_SOF_MS)); in vfe_disable_output()
55 for (i = 0; i < output->wm_num; i++) in vfe_disable_output()
56 vfe->ops_gen1->wm_enable(vfe, output->wm_idx[i], 0); in vfe_disable_output()
59 output->wait_reg_update = 1; in vfe_disable_output()
62 time = wait_for_completion_timeout(&output->reg_update, msecs_to_jiffies(VFE_NEXT_SOF_MS)); in vfe_disable_output()
69 vfe->ops_gen1->wm_frame_based(vfe, output->wm_idx[0], 0); in vfe_disable_output()
70 vfe->ops_gen1->bus_disconnect_wm_from_rdi(vfe, output->wm_idx[0], line->id); in vfe_disable_output()
71 vfe->ops_gen1->enable_irq_wm_line(vfe, output->wm_idx[0], line->id, 0); in vfe_disable_output()
72 vfe->ops_gen1->set_cgc_override(vfe, output->wm_idx[0], 0); in vfe_disable_output()
75 for (i = 0; i < output->wm_num; i++) { in vfe_disable_output()
76 vfe->ops_gen1->wm_line_based(vfe, output->wm_idx[i], NULL, i, 0); in vfe_disable_output()
77 vfe->ops_gen1->set_cgc_override(vfe, output->wm_idx[i], 0); in vfe_disable_output()
83 vfe->ops_gen1->set_xbar_cfg(vfe, output, 0); in vfe_disable_output()
121 struct vfe_output *output, u8 sync, in vfe_output_init_addrs() argument
128 output->gen1.active_buf = 0; in vfe_output_init_addrs()
130 for (i = 0; i < output->wm_num; i++) { in vfe_output_init_addrs()
131 if (output->buf[0]) in vfe_output_init_addrs()
132 ping_addr = output->buf[0]->addr[i]; in vfe_output_init_addrs()
136 if (output->buf[1]) in vfe_output_init_addrs()
137 pong_addr = output->buf[1]->addr[i]; in vfe_output_init_addrs()
141 vfe->ops_gen1->wm_set_ping_addr(vfe, output->wm_idx[i], ping_addr); in vfe_output_init_addrs()
142 vfe->ops_gen1->wm_set_pong_addr(vfe, output->wm_idx[i], pong_addr); in vfe_output_init_addrs()
144 vfe->ops_gen1->bus_reload_wm(vfe, output->wm_idx[i]); in vfe_output_init_addrs()
149 struct vfe_output *output, in vfe_output_frame_drop() argument
156 output->drop_update_idx++; in vfe_output_frame_drop()
157 output->drop_update_idx %= VFE_FRAME_DROP_UPDATES; in vfe_output_frame_drop()
158 drop_period = VFE_FRAME_DROP_VAL + output->drop_update_idx; in vfe_output_frame_drop()
160 for (i = 0; i < output->wm_num; i++) { in vfe_output_frame_drop()
161 vfe->ops_gen1->wm_set_framedrop_period(vfe, output->wm_idx[i], drop_period); in vfe_output_frame_drop()
162 vfe->ops_gen1->wm_set_framedrop_pattern(vfe, output->wm_idx[i], drop_pattern); in vfe_output_frame_drop()
165 vfe->res->hw_ops->reg_update(vfe, container_of(output, struct vfe_line, output)->id); in vfe_output_frame_drop()
171 struct vfe_output *output = &line->output; in vfe_enable_output() local
198 if (output->state > VFE_OUTPUT_RESERVED) { in vfe_enable_output()
199 dev_err(vfe->camss->dev, "Output is not in reserved state %d\n", output->state); in vfe_enable_output()
203 output->state = VFE_OUTPUT_IDLE; in vfe_enable_output()
205 output->buf[0] = vfe_buf_get_pending(output); in vfe_enable_output()
206 output->buf[1] = vfe_buf_get_pending(output); in vfe_enable_output()
208 if (!output->buf[0] && output->buf[1]) { in vfe_enable_output()
209 output->buf[0] = output->buf[1]; in vfe_enable_output()
210 output->buf[1] = NULL; in vfe_enable_output()
213 if (output->buf[0]) in vfe_enable_output()
214 output->state = VFE_OUTPUT_SINGLE; in vfe_enable_output()
216 if (output->buf[1]) in vfe_enable_output()
217 output->state = VFE_OUTPUT_CONTINUOUS; in vfe_enable_output()
219 switch (output->state) { in vfe_enable_output()
221 vfe_output_frame_drop(vfe, output, 1 << frame_skip); in vfe_enable_output()
224 vfe_output_frame_drop(vfe, output, 3 << frame_skip); in vfe_enable_output()
227 vfe_output_frame_drop(vfe, output, 0); in vfe_enable_output()
231 output->sequence = 0; in vfe_enable_output()
232 output->gen1.wait_sof = 0; in vfe_enable_output()
233 output->wait_reg_update = 0; in vfe_enable_output()
234 reinit_completion(&output->sof); in vfe_enable_output()
235 reinit_completion(&output->reg_update); in vfe_enable_output()
237 vfe_output_init_addrs(vfe, output, 0, line); in vfe_enable_output()
240 vfe->ops_gen1->set_cgc_override(vfe, output->wm_idx[0], 1); in vfe_enable_output()
241 vfe->ops_gen1->enable_irq_wm_line(vfe, output->wm_idx[0], line->id, 1); in vfe_enable_output()
242 vfe->ops_gen1->bus_connect_wm_to_rdi(vfe, output->wm_idx[0], line->id); in vfe_enable_output()
243 vfe->ops_gen1->wm_set_subsample(vfe, output->wm_idx[0]); in vfe_enable_output()
245 vfe->ops_gen1->wm_set_ub_cfg(vfe, output->wm_idx[0], in vfe_enable_output()
246 (ub_size + 1) * output->wm_idx[0], ub_size); in vfe_enable_output()
247 vfe->ops_gen1->wm_frame_based(vfe, output->wm_idx[0], 1); in vfe_enable_output()
248 vfe->ops_gen1->wm_enable(vfe, output->wm_idx[0], 1); in vfe_enable_output()
249 vfe->ops_gen1->bus_reload_wm(vfe, output->wm_idx[0]); in vfe_enable_output()
251 ub_size /= output->wm_num; in vfe_enable_output()
252 for (i = 0; i < output->wm_num; i++) { in vfe_enable_output()
253 vfe->ops_gen1->set_cgc_override(vfe, output->wm_idx[i], 1); in vfe_enable_output()
254 vfe->ops_gen1->wm_set_subsample(vfe, output->wm_idx[i]); in vfe_enable_output()
255 vfe->ops_gen1->wm_set_ub_cfg(vfe, output->wm_idx[i], in vfe_enable_output()
256 (ub_size + 1) * output->wm_idx[i], ub_size); in vfe_enable_output()
257 vfe->ops_gen1->wm_line_based(vfe, output->wm_idx[i], in vfe_enable_output()
259 vfe->ops_gen1->wm_enable(vfe, output->wm_idx[i], 1); in vfe_enable_output()
260 vfe->ops_gen1->bus_reload_wm(vfe, output->wm_idx[i]); in vfe_enable_output()
266 vfe->ops_gen1->set_xbar_cfg(vfe, output, 1); in vfe_enable_output()
284 struct vfe_output *output; in vfe_get_output() local
292 output = &line->output; in vfe_get_output()
293 if (output->state > VFE_OUTPUT_RESERVED) { in vfe_get_output()
294 dev_err(vfe->camss->dev, "Output is running\n"); in vfe_get_output()
297 output->state = VFE_OUTPUT_RESERVED; in vfe_get_output()
299 output->gen1.active_buf = 0; in vfe_get_output()
306 output->wm_num = 2; in vfe_get_output()
309 output->wm_num = 1; in vfe_get_output()
313 for (i = 0; i < output->wm_num; i++) { in vfe_get_output()
319 output->wm_idx[i] = wm_idx; in vfe_get_output()
322 output->drop_update_idx = 0; in vfe_get_output()
330 vfe_release_wm(vfe, output->wm_idx[i]); in vfe_get_output()
331 output->state = VFE_OUTPUT_OFF; in vfe_get_output()
385 struct vfe_output *output, u8 sync, in vfe_output_update_ping_addr() argument
391 for (i = 0; i < output->wm_num; i++) { in vfe_output_update_ping_addr()
392 if (output->buf[0]) in vfe_output_update_ping_addr()
393 addr = output->buf[0]->addr[i]; in vfe_output_update_ping_addr()
397 vfe->ops_gen1->wm_set_ping_addr(vfe, output->wm_idx[i], addr); in vfe_output_update_ping_addr()
399 vfe->ops_gen1->bus_reload_wm(vfe, output->wm_idx[i]); in vfe_output_update_ping_addr()
404 struct vfe_output *output, u8 sync, in vfe_output_update_pong_addr() argument
410 for (i = 0; i < output->wm_num; i++) { in vfe_output_update_pong_addr()
411 if (output->buf[1]) in vfe_output_update_pong_addr()
412 addr = output->buf[1]->addr[i]; in vfe_output_update_pong_addr()
416 vfe->ops_gen1->wm_set_pong_addr(vfe, output->wm_idx[i], addr); in vfe_output_update_pong_addr()
418 vfe->ops_gen1->bus_reload_wm(vfe, output->wm_idx[i]); in vfe_output_update_pong_addr()
423 struct vfe_output *output) in vfe_buf_update_wm_on_next() argument
425 switch (output->state) { in vfe_buf_update_wm_on_next()
427 vfe_output_frame_drop(vfe, output, 3); in vfe_buf_update_wm_on_next()
433 output->state); in vfe_buf_update_wm_on_next()
439 struct vfe_output *output) in vfe_buf_update_wm_on_last() argument
441 switch (output->state) { in vfe_buf_update_wm_on_last()
443 output->state = VFE_OUTPUT_SINGLE; in vfe_buf_update_wm_on_last()
444 vfe_output_frame_drop(vfe, output, 1); in vfe_buf_update_wm_on_last()
447 output->state = VFE_OUTPUT_STOPPING; in vfe_buf_update_wm_on_last()
448 vfe_output_frame_drop(vfe, output, 0); in vfe_buf_update_wm_on_last()
453 output->state); in vfe_buf_update_wm_on_last()
459 struct vfe_output *output, in vfe_buf_update_wm_on_new() argument
465 switch (output->state) { in vfe_buf_update_wm_on_new()
467 inactive_idx = !output->gen1.active_buf; in vfe_buf_update_wm_on_new()
469 if (!output->buf[inactive_idx]) { in vfe_buf_update_wm_on_new()
470 output->buf[inactive_idx] = new_buf; in vfe_buf_update_wm_on_new()
473 vfe_output_update_pong_addr(vfe, output, 0, line); in vfe_buf_update_wm_on_new()
475 vfe_output_update_ping_addr(vfe, output, 0, line); in vfe_buf_update_wm_on_new()
477 vfe_output_frame_drop(vfe, output, 3); in vfe_buf_update_wm_on_new()
478 output->state = VFE_OUTPUT_CONTINUOUS; in vfe_buf_update_wm_on_new()
480 vfe_buf_add_pending(output, new_buf); in vfe_buf_update_wm_on_new()
487 if (!output->buf[0]) { in vfe_buf_update_wm_on_new()
488 output->buf[0] = new_buf; in vfe_buf_update_wm_on_new()
490 vfe_output_init_addrs(vfe, output, 1, line); in vfe_buf_update_wm_on_new()
491 vfe_output_frame_drop(vfe, output, 1); in vfe_buf_update_wm_on_new()
493 output->state = VFE_OUTPUT_SINGLE; in vfe_buf_update_wm_on_new()
495 vfe_buf_add_pending(output, new_buf); in vfe_buf_update_wm_on_new()
497 "Output idle with buffer set!\n"); in vfe_buf_update_wm_on_new()
503 vfe_buf_add_pending(output, new_buf); in vfe_buf_update_wm_on_new()
525 struct vfe_output *output; in vfe_isr_sof() local
529 output = &vfe->line[line_id].output; in vfe_isr_sof()
530 if (output->gen1.wait_sof) { in vfe_isr_sof()
531 output->gen1.wait_sof = 0; in vfe_isr_sof()
532 complete(&output->sof); in vfe_isr_sof()
544 struct vfe_output *output; in vfe_isr_reg_update() local
551 output = &line->output; in vfe_isr_reg_update()
553 if (output->wait_reg_update) { in vfe_isr_reg_update()
554 output->wait_reg_update = 0; in vfe_isr_reg_update()
555 complete(&output->reg_update); in vfe_isr_reg_update()
560 if (output->state == VFE_OUTPUT_STOPPING) { in vfe_isr_reg_update()
562 if (output->last_buffer) { in vfe_isr_reg_update()
563 vb2_buffer_done(&output->last_buffer->vb.vb2_buf, in vfe_isr_reg_update()
565 output->last_buffer = NULL; in vfe_isr_reg_update()
567 output->state = VFE_OUTPUT_IDLE; in vfe_isr_reg_update()
572 output->buf[0] = vfe_buf_get_pending(output); in vfe_isr_reg_update()
573 output->buf[1] = vfe_buf_get_pending(output); in vfe_isr_reg_update()
575 if (!output->buf[0] && output->buf[1]) { in vfe_isr_reg_update()
576 output->buf[0] = output->buf[1]; in vfe_isr_reg_update()
577 output->buf[1] = NULL; in vfe_isr_reg_update()
580 if (output->buf[0]) in vfe_isr_reg_update()
581 output->state = VFE_OUTPUT_SINGLE; in vfe_isr_reg_update()
583 if (output->buf[1]) in vfe_isr_reg_update()
584 output->state = VFE_OUTPUT_CONTINUOUS; in vfe_isr_reg_update()
586 switch (output->state) { in vfe_isr_reg_update()
588 vfe_output_frame_drop(vfe, output, 2); in vfe_isr_reg_update()
591 vfe_output_frame_drop(vfe, output, 3); in vfe_isr_reg_update()
594 vfe_output_frame_drop(vfe, output, 0); in vfe_isr_reg_update()
598 vfe_output_init_addrs(vfe, output, 1, &vfe->line[line_id]); in vfe_isr_reg_update()
612 struct vfe_output *output; in vfe_isr_wm_done() local
628 output = &vfe->line[vfe->wm_output_map[wm]].output; in vfe_isr_wm_done()
630 if (output->gen1.active_buf == active_index && 0) { in vfe_isr_wm_done()
635 output->gen1.active_buf = active_index; in vfe_isr_wm_done()
637 ready_buf = output->buf[!active_index]; in vfe_isr_wm_done()
641 !active_index, output->state); in vfe_isr_wm_done()
646 ready_buf->vb.sequence = output->sequence++; in vfe_isr_wm_done()
649 output->buf[!active_index] = vfe_buf_get_pending(output); in vfe_isr_wm_done()
650 if (!output->buf[!active_index]) { in vfe_isr_wm_done()
653 vfe_buf_update_wm_on_last(vfe, output); in vfe_isr_wm_done()
655 new_addr = output->buf[!active_index]->addr; in vfe_isr_wm_done()
656 vfe_buf_update_wm_on_next(vfe, output); in vfe_isr_wm_done()
660 for (i = 0; i < output->wm_num; i++) in vfe_isr_wm_done()
661 vfe->ops_gen1->wm_set_ping_addr(vfe, output->wm_idx[i], new_addr[i]); in vfe_isr_wm_done()
663 for (i = 0; i < output->wm_num; i++) in vfe_isr_wm_done()
664 vfe->ops_gen1->wm_set_pong_addr(vfe, output->wm_idx[i], new_addr[i]); in vfe_isr_wm_done()
668 if (output->state == VFE_OUTPUT_STOPPING) in vfe_isr_wm_done()
669 output->last_buffer = ready_buf; in vfe_isr_wm_done()
693 struct vfe_output *output; in vfe_queue_buffer() local
696 output = &line->output; in vfe_queue_buffer()
700 vfe_buf_update_wm_on_new(vfe, output, buf, line); in vfe_queue_buffer()