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->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
197 if (output->state > VFE_OUTPUT_RESERVED) { in vfe_enable_output()
198 dev_err(vfe->camss->dev, "Output is not in reserved state %d\n", output->state); in vfe_enable_output()
202 output->state = VFE_OUTPUT_IDLE; in vfe_enable_output()
204 output->buf[0] = vfe_buf_get_pending(output); in vfe_enable_output()
205 output->buf[1] = vfe_buf_get_pending(output); in vfe_enable_output()
207 if (!output->buf[0] && output->buf[1]) { in vfe_enable_output()
208 output->buf[0] = output->buf[1]; in vfe_enable_output()
209 output->buf[1] = NULL; in vfe_enable_output()
212 if (output->buf[0]) in vfe_enable_output()
213 output->state = VFE_OUTPUT_SINGLE; in vfe_enable_output()
215 if (output->buf[1]) in vfe_enable_output()
216 output->state = VFE_OUTPUT_CONTINUOUS; in vfe_enable_output()
218 switch (output->state) { in vfe_enable_output()
220 vfe_output_frame_drop(vfe, output, 1 << frame_skip); in vfe_enable_output()
223 vfe_output_frame_drop(vfe, output, 3 << frame_skip); in vfe_enable_output()
226 vfe_output_frame_drop(vfe, output, 0); in vfe_enable_output()
230 output->sequence = 0; in vfe_enable_output()
231 output->gen1.wait_sof = 0; in vfe_enable_output()
232 output->wait_reg_update = 0; in vfe_enable_output()
233 reinit_completion(&output->sof); in vfe_enable_output()
234 reinit_completion(&output->reg_update); in vfe_enable_output()
236 vfe_output_init_addrs(vfe, output, 0, line); in vfe_enable_output()
239 vfe->ops_gen1->set_cgc_override(vfe, output->wm_idx[0], 1); in vfe_enable_output()
240 vfe->ops_gen1->enable_irq_wm_line(vfe, output->wm_idx[0], line->id, 1); in vfe_enable_output()
241 vfe->ops_gen1->bus_connect_wm_to_rdi(vfe, output->wm_idx[0], line->id); in vfe_enable_output()
242 vfe->ops_gen1->wm_set_subsample(vfe, output->wm_idx[0]); in vfe_enable_output()
244 vfe->ops_gen1->wm_set_ub_cfg(vfe, output->wm_idx[0], in vfe_enable_output()
245 (ub_size + 1) * output->wm_idx[0], ub_size); in vfe_enable_output()
246 vfe->ops_gen1->wm_frame_based(vfe, output->wm_idx[0], 1); in vfe_enable_output()
247 vfe->ops_gen1->wm_enable(vfe, output->wm_idx[0], 1); in vfe_enable_output()
248 vfe->ops_gen1->bus_reload_wm(vfe, output->wm_idx[0]); in vfe_enable_output()
250 ub_size /= output->wm_num; in vfe_enable_output()
251 for (i = 0; i < output->wm_num; i++) { in vfe_enable_output()
252 vfe->ops_gen1->set_cgc_override(vfe, output->wm_idx[i], 1); in vfe_enable_output()
253 vfe->ops_gen1->wm_set_subsample(vfe, output->wm_idx[i]); in vfe_enable_output()
254 vfe->ops_gen1->wm_set_ub_cfg(vfe, output->wm_idx[i], in vfe_enable_output()
255 (ub_size + 1) * output->wm_idx[i], ub_size); in vfe_enable_output()
256 vfe->ops_gen1->wm_line_based(vfe, output->wm_idx[i], in vfe_enable_output()
258 vfe->ops_gen1->wm_enable(vfe, output->wm_idx[i], 1); in vfe_enable_output()
259 vfe->ops_gen1->bus_reload_wm(vfe, output->wm_idx[i]); in vfe_enable_output()
265 vfe->ops_gen1->set_xbar_cfg(vfe, output, 1); in vfe_enable_output()
283 struct vfe_output *output; in vfe_get_output() local
291 output = &line->output; in vfe_get_output()
292 if (output->state > VFE_OUTPUT_RESERVED) { in vfe_get_output()
293 dev_err(vfe->camss->dev, "Output is running\n"); in vfe_get_output()
296 output->state = VFE_OUTPUT_RESERVED; in vfe_get_output()
298 output->gen1.active_buf = 0; in vfe_get_output()
305 output->wm_num = 2; in vfe_get_output()
308 output->wm_num = 1; in vfe_get_output()
312 for (i = 0; i < output->wm_num; i++) { in vfe_get_output()
318 output->wm_idx[i] = wm_idx; in vfe_get_output()
321 output->drop_update_idx = 0; in vfe_get_output()
329 vfe_release_wm(vfe, output->wm_idx[i]); in vfe_get_output()
330 output->state = VFE_OUTPUT_OFF; in vfe_get_output()
384 struct vfe_output *output, u8 sync, in vfe_output_update_ping_addr() argument
390 for (i = 0; i < output->wm_num; i++) { in vfe_output_update_ping_addr()
391 if (output->buf[0]) in vfe_output_update_ping_addr()
392 addr = output->buf[0]->addr[i]; in vfe_output_update_ping_addr()
396 vfe->ops_gen1->wm_set_ping_addr(vfe, output->wm_idx[i], addr); in vfe_output_update_ping_addr()
398 vfe->ops_gen1->bus_reload_wm(vfe, output->wm_idx[i]); in vfe_output_update_ping_addr()
403 struct vfe_output *output, u8 sync, in vfe_output_update_pong_addr() argument
409 for (i = 0; i < output->wm_num; i++) { in vfe_output_update_pong_addr()
410 if (output->buf[1]) in vfe_output_update_pong_addr()
411 addr = output->buf[1]->addr[i]; in vfe_output_update_pong_addr()
415 vfe->ops_gen1->wm_set_pong_addr(vfe, output->wm_idx[i], addr); in vfe_output_update_pong_addr()
417 vfe->ops_gen1->bus_reload_wm(vfe, output->wm_idx[i]); in vfe_output_update_pong_addr()
422 struct vfe_output *output) in vfe_buf_update_wm_on_next() argument
424 switch (output->state) { in vfe_buf_update_wm_on_next()
426 vfe_output_frame_drop(vfe, output, 3); in vfe_buf_update_wm_on_next()
432 output->state); in vfe_buf_update_wm_on_next()
438 struct vfe_output *output) in vfe_buf_update_wm_on_last() argument
440 switch (output->state) { in vfe_buf_update_wm_on_last()
442 output->state = VFE_OUTPUT_SINGLE; in vfe_buf_update_wm_on_last()
443 vfe_output_frame_drop(vfe, output, 1); in vfe_buf_update_wm_on_last()
446 output->state = VFE_OUTPUT_STOPPING; in vfe_buf_update_wm_on_last()
447 vfe_output_frame_drop(vfe, output, 0); in vfe_buf_update_wm_on_last()
452 output->state); in vfe_buf_update_wm_on_last()
458 struct vfe_output *output, in vfe_buf_update_wm_on_new() argument
464 switch (output->state) { in vfe_buf_update_wm_on_new()
466 inactive_idx = !output->gen1.active_buf; in vfe_buf_update_wm_on_new()
468 if (!output->buf[inactive_idx]) { in vfe_buf_update_wm_on_new()
469 output->buf[inactive_idx] = new_buf; in vfe_buf_update_wm_on_new()
472 vfe_output_update_pong_addr(vfe, output, 0, line); in vfe_buf_update_wm_on_new()
474 vfe_output_update_ping_addr(vfe, output, 0, line); in vfe_buf_update_wm_on_new()
476 vfe_output_frame_drop(vfe, output, 3); in vfe_buf_update_wm_on_new()
477 output->state = VFE_OUTPUT_CONTINUOUS; in vfe_buf_update_wm_on_new()
479 vfe_buf_add_pending(output, new_buf); in vfe_buf_update_wm_on_new()
486 if (!output->buf[0]) { in vfe_buf_update_wm_on_new()
487 output->buf[0] = new_buf; in vfe_buf_update_wm_on_new()
489 vfe_output_init_addrs(vfe, output, 1, line); in vfe_buf_update_wm_on_new()
490 vfe_output_frame_drop(vfe, output, 1); in vfe_buf_update_wm_on_new()
492 output->state = VFE_OUTPUT_SINGLE; in vfe_buf_update_wm_on_new()
494 vfe_buf_add_pending(output, new_buf); in vfe_buf_update_wm_on_new()
496 "Output idle with buffer set!\n"); in vfe_buf_update_wm_on_new()
502 vfe_buf_add_pending(output, new_buf); in vfe_buf_update_wm_on_new()
524 struct vfe_output *output; in vfe_isr_sof() local
528 output = &vfe->line[line_id].output; in vfe_isr_sof()
529 if (output->gen1.wait_sof) { in vfe_isr_sof()
530 output->gen1.wait_sof = 0; in vfe_isr_sof()
531 complete(&output->sof); in vfe_isr_sof()
543 struct vfe_output *output; in vfe_isr_reg_update() local
550 output = &line->output; in vfe_isr_reg_update()
552 if (output->wait_reg_update) { in vfe_isr_reg_update()
553 output->wait_reg_update = 0; in vfe_isr_reg_update()
554 complete(&output->reg_update); in vfe_isr_reg_update()
559 if (output->state == VFE_OUTPUT_STOPPING) { in vfe_isr_reg_update()
561 if (output->last_buffer) { in vfe_isr_reg_update()
562 vb2_buffer_done(&output->last_buffer->vb.vb2_buf, in vfe_isr_reg_update()
564 output->last_buffer = NULL; in vfe_isr_reg_update()
566 output->state = VFE_OUTPUT_IDLE; in vfe_isr_reg_update()
571 output->buf[0] = vfe_buf_get_pending(output); in vfe_isr_reg_update()
572 output->buf[1] = vfe_buf_get_pending(output); in vfe_isr_reg_update()
574 if (!output->buf[0] && output->buf[1]) { in vfe_isr_reg_update()
575 output->buf[0] = output->buf[1]; in vfe_isr_reg_update()
576 output->buf[1] = NULL; in vfe_isr_reg_update()
579 if (output->buf[0]) in vfe_isr_reg_update()
580 output->state = VFE_OUTPUT_SINGLE; in vfe_isr_reg_update()
582 if (output->buf[1]) in vfe_isr_reg_update()
583 output->state = VFE_OUTPUT_CONTINUOUS; in vfe_isr_reg_update()
585 switch (output->state) { in vfe_isr_reg_update()
587 vfe_output_frame_drop(vfe, output, 2); in vfe_isr_reg_update()
590 vfe_output_frame_drop(vfe, output, 3); in vfe_isr_reg_update()
593 vfe_output_frame_drop(vfe, output, 0); in vfe_isr_reg_update()
597 vfe_output_init_addrs(vfe, output, 1, &vfe->line[line_id]); in vfe_isr_reg_update()
611 struct vfe_output *output; in vfe_isr_wm_done() local
627 output = &vfe->line[vfe->wm_output_map[wm]].output; in vfe_isr_wm_done()
629 if (output->gen1.active_buf == active_index && 0) { in vfe_isr_wm_done()
634 output->gen1.active_buf = active_index; in vfe_isr_wm_done()
636 ready_buf = output->buf[!active_index]; in vfe_isr_wm_done()
640 !active_index, output->state); in vfe_isr_wm_done()
645 ready_buf->vb.sequence = output->sequence++; in vfe_isr_wm_done()
648 output->buf[!active_index] = vfe_buf_get_pending(output); in vfe_isr_wm_done()
649 if (!output->buf[!active_index]) { in vfe_isr_wm_done()
652 vfe_buf_update_wm_on_last(vfe, output); in vfe_isr_wm_done()
654 new_addr = output->buf[!active_index]->addr; in vfe_isr_wm_done()
655 vfe_buf_update_wm_on_next(vfe, output); in vfe_isr_wm_done()
659 for (i = 0; i < output->wm_num; i++) in vfe_isr_wm_done()
660 vfe->ops_gen1->wm_set_ping_addr(vfe, output->wm_idx[i], new_addr[i]); in vfe_isr_wm_done()
662 for (i = 0; i < output->wm_num; i++) in vfe_isr_wm_done()
663 vfe->ops_gen1->wm_set_pong_addr(vfe, output->wm_idx[i], new_addr[i]); in vfe_isr_wm_done()
667 if (output->state == VFE_OUTPUT_STOPPING) in vfe_isr_wm_done()
668 output->last_buffer = ready_buf; in vfe_isr_wm_done()
692 struct vfe_output *output; in vfe_queue_buffer() local
695 output = &line->output; in vfe_queue_buffer()
699 vfe_buf_update_wm_on_new(vfe, output, buf, line); in vfe_queue_buffer()