Lines Matching full:output
325 struct vfe_output *output = &vfe->line[i].output; in vfe_init_outputs() local
327 output->state = VFE_OUTPUT_OFF; in vfe_init_outputs()
328 output->buf[0] = NULL; in vfe_init_outputs()
329 output->buf[1] = NULL; in vfe_init_outputs()
330 INIT_LIST_HEAD(&output->pending_bufs); in vfe_init_outputs()
343 struct vfe_output *output, u8 sync) in vfe_output_init_addrs() argument
349 output->active_buf = 0; in vfe_output_init_addrs()
351 for (i = 0; i < output->wm_num; i++) { in vfe_output_init_addrs()
352 if (output->buf[0]) in vfe_output_init_addrs()
353 ping_addr = output->buf[0]->addr[i]; in vfe_output_init_addrs()
357 if (output->buf[1]) in vfe_output_init_addrs()
358 pong_addr = output->buf[1]->addr[i]; in vfe_output_init_addrs()
362 vfe->ops->wm_set_ping_addr(vfe, output->wm_idx[i], ping_addr); in vfe_output_init_addrs()
363 vfe->ops->wm_set_pong_addr(vfe, output->wm_idx[i], pong_addr); in vfe_output_init_addrs()
365 vfe->ops->bus_reload_wm(vfe, output->wm_idx[i]); in vfe_output_init_addrs()
370 struct vfe_output *output, u8 sync) in vfe_output_update_ping_addr() argument
375 for (i = 0; i < output->wm_num; i++) { in vfe_output_update_ping_addr()
376 if (output->buf[0]) in vfe_output_update_ping_addr()
377 addr = output->buf[0]->addr[i]; in vfe_output_update_ping_addr()
381 vfe->ops->wm_set_ping_addr(vfe, output->wm_idx[i], addr); in vfe_output_update_ping_addr()
383 vfe->ops->bus_reload_wm(vfe, output->wm_idx[i]); in vfe_output_update_ping_addr()
388 struct vfe_output *output, u8 sync) in vfe_output_update_pong_addr() argument
393 for (i = 0; i < output->wm_num; i++) { in vfe_output_update_pong_addr()
394 if (output->buf[1]) in vfe_output_update_pong_addr()
395 addr = output->buf[1]->addr[i]; in vfe_output_update_pong_addr()
399 vfe->ops->wm_set_pong_addr(vfe, output->wm_idx[i], addr); in vfe_output_update_pong_addr()
401 vfe->ops->bus_reload_wm(vfe, output->wm_idx[i]); in vfe_output_update_pong_addr()
433 struct vfe_output *output, in vfe_output_frame_drop() argument
440 output->drop_update_idx++; in vfe_output_frame_drop()
441 output->drop_update_idx %= VFE_FRAME_DROP_UPDATES; in vfe_output_frame_drop()
442 drop_period = VFE_FRAME_DROP_VAL + output->drop_update_idx; in vfe_output_frame_drop()
444 for (i = 0; i < output->wm_num; i++) { in vfe_output_frame_drop()
445 vfe->ops->wm_set_framedrop_period(vfe, output->wm_idx[i], in vfe_output_frame_drop()
447 vfe->ops->wm_set_framedrop_pattern(vfe, output->wm_idx[i], in vfe_output_frame_drop()
451 container_of(output, struct vfe_line, output)->id); in vfe_output_frame_drop()
454 static struct camss_buffer *vfe_buf_get_pending(struct vfe_output *output) in vfe_buf_get_pending() argument
458 if (!list_empty(&output->pending_bufs)) { in vfe_buf_get_pending()
459 buffer = list_first_entry(&output->pending_bufs, in vfe_buf_get_pending()
469 * vfe_buf_add_pending - Add output buffer to list of pending
470 * @output: VFE output
473 static void vfe_buf_add_pending(struct vfe_output *output, in vfe_buf_add_pending() argument
477 list_add_tail(&buffer->queue, &output->pending_bufs); in vfe_buf_add_pending()
482 * @output: VFE output
485 static void vfe_buf_flush_pending(struct vfe_output *output, in vfe_buf_flush_pending() argument
491 list_for_each_entry_safe(buf, t, &output->pending_bufs, queue) { in vfe_buf_flush_pending()
498 struct vfe_output *output) in vfe_buf_update_wm_on_next() argument
500 switch (output->state) { in vfe_buf_update_wm_on_next()
502 vfe_output_frame_drop(vfe, output, 3); in vfe_buf_update_wm_on_next()
508 output->state); in vfe_buf_update_wm_on_next()
514 struct vfe_output *output) in vfe_buf_update_wm_on_last() argument
516 switch (output->state) { in vfe_buf_update_wm_on_last()
518 output->state = VFE_OUTPUT_SINGLE; in vfe_buf_update_wm_on_last()
519 vfe_output_frame_drop(vfe, output, 1); in vfe_buf_update_wm_on_last()
522 output->state = VFE_OUTPUT_STOPPING; in vfe_buf_update_wm_on_last()
523 vfe_output_frame_drop(vfe, output, 0); in vfe_buf_update_wm_on_last()
528 output->state); in vfe_buf_update_wm_on_last()
534 struct vfe_output *output, in vfe_buf_update_wm_on_new() argument
539 switch (output->state) { in vfe_buf_update_wm_on_new()
541 inactive_idx = !output->active_buf; in vfe_buf_update_wm_on_new()
543 if (!output->buf[inactive_idx]) { in vfe_buf_update_wm_on_new()
544 output->buf[inactive_idx] = new_buf; in vfe_buf_update_wm_on_new()
547 vfe_output_update_pong_addr(vfe, output, 0); in vfe_buf_update_wm_on_new()
549 vfe_output_update_ping_addr(vfe, output, 0); in vfe_buf_update_wm_on_new()
551 vfe_output_frame_drop(vfe, output, 3); in vfe_buf_update_wm_on_new()
552 output->state = VFE_OUTPUT_CONTINUOUS; in vfe_buf_update_wm_on_new()
554 vfe_buf_add_pending(output, new_buf); in vfe_buf_update_wm_on_new()
561 if (!output->buf[0]) { in vfe_buf_update_wm_on_new()
562 output->buf[0] = new_buf; in vfe_buf_update_wm_on_new()
564 vfe_output_init_addrs(vfe, output, 1); in vfe_buf_update_wm_on_new()
566 vfe_output_frame_drop(vfe, output, 1); in vfe_buf_update_wm_on_new()
567 output->state = VFE_OUTPUT_SINGLE; in vfe_buf_update_wm_on_new()
569 vfe_buf_add_pending(output, new_buf); in vfe_buf_update_wm_on_new()
571 "Output idle with buffer set!\n"); in vfe_buf_update_wm_on_new()
577 vfe_buf_add_pending(output, new_buf); in vfe_buf_update_wm_on_new()
585 struct vfe_output *output; in vfe_get_output() local
593 output = &line->output; in vfe_get_output()
594 if (output->state != VFE_OUTPUT_OFF) { in vfe_get_output()
595 dev_err(vfe->camss->dev, "Output is running\n"); in vfe_get_output()
598 output->state = VFE_OUTPUT_RESERVED; in vfe_get_output()
600 output->active_buf = 0; in vfe_get_output()
607 output->wm_num = 2; in vfe_get_output()
610 output->wm_num = 1; in vfe_get_output()
614 for (i = 0; i < output->wm_num; i++) { in vfe_get_output()
620 output->wm_idx[i] = wm_idx; in vfe_get_output()
623 output->drop_update_idx = 0; in vfe_get_output()
631 vfe_release_wm(vfe, output->wm_idx[i]); in vfe_get_output()
632 output->state = VFE_OUTPUT_OFF; in vfe_get_output()
642 struct vfe_output *output = &line->output; in vfe_put_output() local
648 for (i = 0; i < output->wm_num; i++) in vfe_put_output()
649 vfe_release_wm(vfe, output->wm_idx[i]); in vfe_put_output()
651 output->state = VFE_OUTPUT_OFF; in vfe_put_output()
660 struct vfe_output *output = &line->output; in vfe_enable_output() local
687 if (output->state != VFE_OUTPUT_RESERVED) { in vfe_enable_output()
688 dev_err(vfe->camss->dev, "Output is not in reserved state %d\n", in vfe_enable_output()
689 output->state); in vfe_enable_output()
693 output->state = VFE_OUTPUT_IDLE; in vfe_enable_output()
695 output->buf[0] = vfe_buf_get_pending(output); in vfe_enable_output()
696 output->buf[1] = vfe_buf_get_pending(output); in vfe_enable_output()
698 if (!output->buf[0] && output->buf[1]) { in vfe_enable_output()
699 output->buf[0] = output->buf[1]; in vfe_enable_output()
700 output->buf[1] = NULL; in vfe_enable_output()
703 if (output->buf[0]) in vfe_enable_output()
704 output->state = VFE_OUTPUT_SINGLE; in vfe_enable_output()
706 if (output->buf[1]) in vfe_enable_output()
707 output->state = VFE_OUTPUT_CONTINUOUS; in vfe_enable_output()
709 switch (output->state) { in vfe_enable_output()
711 vfe_output_frame_drop(vfe, output, 1 << frame_skip); in vfe_enable_output()
714 vfe_output_frame_drop(vfe, output, 3 << frame_skip); in vfe_enable_output()
717 vfe_output_frame_drop(vfe, output, 0); in vfe_enable_output()
721 output->sequence = 0; in vfe_enable_output()
722 output->wait_sof = 0; in vfe_enable_output()
723 output->wait_reg_update = 0; in vfe_enable_output()
724 reinit_completion(&output->sof); in vfe_enable_output()
725 reinit_completion(&output->reg_update); in vfe_enable_output()
727 vfe_output_init_addrs(vfe, output, 0); in vfe_enable_output()
730 ops->set_cgc_override(vfe, output->wm_idx[0], 1); in vfe_enable_output()
731 ops->enable_irq_wm_line(vfe, output->wm_idx[0], line->id, 1); in vfe_enable_output()
732 ops->bus_connect_wm_to_rdi(vfe, output->wm_idx[0], line->id); in vfe_enable_output()
733 ops->wm_set_subsample(vfe, output->wm_idx[0]); in vfe_enable_output()
735 ops->wm_set_ub_cfg(vfe, output->wm_idx[0], in vfe_enable_output()
736 (ub_size + 1) * output->wm_idx[0], ub_size); in vfe_enable_output()
737 ops->wm_frame_based(vfe, output->wm_idx[0], 1); in vfe_enable_output()
738 ops->wm_enable(vfe, output->wm_idx[0], 1); in vfe_enable_output()
739 ops->bus_reload_wm(vfe, output->wm_idx[0]); in vfe_enable_output()
741 ub_size /= output->wm_num; in vfe_enable_output()
742 for (i = 0; i < output->wm_num; i++) { in vfe_enable_output()
743 ops->set_cgc_override(vfe, output->wm_idx[i], 1); in vfe_enable_output()
744 ops->wm_set_subsample(vfe, output->wm_idx[i]); in vfe_enable_output()
745 ops->wm_set_ub_cfg(vfe, output->wm_idx[i], in vfe_enable_output()
746 (ub_size + 1) * output->wm_idx[i], in vfe_enable_output()
748 ops->wm_line_based(vfe, output->wm_idx[i], in vfe_enable_output()
751 ops->wm_enable(vfe, output->wm_idx[i], 1); in vfe_enable_output()
752 ops->bus_reload_wm(vfe, output->wm_idx[i]); in vfe_enable_output()
758 ops->set_xbar_cfg(vfe, output, 1); in vfe_enable_output()
776 struct vfe_output *output = &line->output; in vfe_disable_output() local
784 output->wait_sof = 1; in vfe_disable_output()
787 time = wait_for_completion_timeout(&output->sof, in vfe_disable_output()
793 for (i = 0; i < output->wm_num; i++) in vfe_disable_output()
794 ops->wm_enable(vfe, output->wm_idx[i], 0); in vfe_disable_output()
797 output->wait_reg_update = 1; in vfe_disable_output()
800 time = wait_for_completion_timeout(&output->reg_update, in vfe_disable_output()
808 ops->wm_frame_based(vfe, output->wm_idx[0], 0); in vfe_disable_output()
809 ops->bus_disconnect_wm_from_rdi(vfe, output->wm_idx[0], in vfe_disable_output()
811 ops->enable_irq_wm_line(vfe, output->wm_idx[0], line->id, 0); in vfe_disable_output()
812 ops->set_cgc_override(vfe, output->wm_idx[0], 0); in vfe_disable_output()
815 for (i = 0; i < output->wm_num; i++) { in vfe_disable_output()
816 ops->wm_line_based(vfe, output->wm_idx[i], NULL, i, 0); in vfe_disable_output()
817 ops->set_cgc_override(vfe, output->wm_idx[i], 0); in vfe_disable_output()
823 ops->set_xbar_cfg(vfe, output, 0); in vfe_disable_output()
923 struct vfe_output *output; in vfe_isr_sof() local
927 output = &vfe->line[line_id].output; in vfe_isr_sof()
928 if (output->wait_sof) { in vfe_isr_sof()
929 output->wait_sof = 0; in vfe_isr_sof()
930 complete(&output->sof); in vfe_isr_sof()
942 struct vfe_output *output; in vfe_isr_reg_update() local
948 output = &vfe->line[line_id].output; in vfe_isr_reg_update()
950 if (output->wait_reg_update) { in vfe_isr_reg_update()
951 output->wait_reg_update = 0; in vfe_isr_reg_update()
952 complete(&output->reg_update); in vfe_isr_reg_update()
957 if (output->state == VFE_OUTPUT_STOPPING) { in vfe_isr_reg_update()
959 if (output->last_buffer) { in vfe_isr_reg_update()
960 vb2_buffer_done(&output->last_buffer->vb.vb2_buf, in vfe_isr_reg_update()
962 output->last_buffer = NULL; in vfe_isr_reg_update()
964 output->state = VFE_OUTPUT_IDLE; in vfe_isr_reg_update()
969 output->buf[0] = vfe_buf_get_pending(output); in vfe_isr_reg_update()
970 output->buf[1] = vfe_buf_get_pending(output); in vfe_isr_reg_update()
972 if (!output->buf[0] && output->buf[1]) { in vfe_isr_reg_update()
973 output->buf[0] = output->buf[1]; in vfe_isr_reg_update()
974 output->buf[1] = NULL; in vfe_isr_reg_update()
977 if (output->buf[0]) in vfe_isr_reg_update()
978 output->state = VFE_OUTPUT_SINGLE; in vfe_isr_reg_update()
980 if (output->buf[1]) in vfe_isr_reg_update()
981 output->state = VFE_OUTPUT_CONTINUOUS; in vfe_isr_reg_update()
983 switch (output->state) { in vfe_isr_reg_update()
985 vfe_output_frame_drop(vfe, output, 2); in vfe_isr_reg_update()
988 vfe_output_frame_drop(vfe, output, 3); in vfe_isr_reg_update()
991 vfe_output_frame_drop(vfe, output, 0); in vfe_isr_reg_update()
995 vfe_output_init_addrs(vfe, output, 1); in vfe_isr_reg_update()
1009 struct vfe_output *output; in vfe_isr_wm_done() local
1025 output = &vfe->line[vfe->wm_output_map[wm]].output; in vfe_isr_wm_done()
1027 if (output->active_buf == active_index) { in vfe_isr_wm_done()
1032 output->active_buf = active_index; in vfe_isr_wm_done()
1034 ready_buf = output->buf[!active_index]; in vfe_isr_wm_done()
1038 !active_index, output->state); in vfe_isr_wm_done()
1043 ready_buf->vb.sequence = output->sequence++; in vfe_isr_wm_done()
1046 output->buf[!active_index] = vfe_buf_get_pending(output); in vfe_isr_wm_done()
1047 if (!output->buf[!active_index]) { in vfe_isr_wm_done()
1050 vfe_buf_update_wm_on_last(vfe, output); in vfe_isr_wm_done()
1052 new_addr = output->buf[!active_index]->addr; in vfe_isr_wm_done()
1053 vfe_buf_update_wm_on_next(vfe, output); in vfe_isr_wm_done()
1057 for (i = 0; i < output->wm_num; i++) in vfe_isr_wm_done()
1058 vfe->ops->wm_set_ping_addr(vfe, output->wm_idx[i], in vfe_isr_wm_done()
1061 for (i = 0; i < output->wm_num; i++) in vfe_isr_wm_done()
1062 vfe->ops->wm_set_pong_addr(vfe, output->wm_idx[i], in vfe_isr_wm_done()
1067 if (output->state == VFE_OUTPUT_STOPPING) in vfe_isr_wm_done()
1068 output->last_buffer = ready_buf; in vfe_isr_wm_done()
1348 struct vfe_output *output; in vfe_queue_buffer() local
1351 output = &line->output; in vfe_queue_buffer()
1355 vfe_buf_update_wm_on_new(vfe, output, buf); in vfe_queue_buffer()
1377 struct vfe_output *output; in vfe_flush_buffers() local
1380 output = &line->output; in vfe_flush_buffers()
1384 vfe_buf_flush_pending(output, state); in vfe_flush_buffers()
1386 if (output->buf[0]) in vfe_flush_buffers()
1387 vb2_buffer_done(&output->buf[0]->vb.vb2_buf, state); in vfe_flush_buffers()
1389 if (output->buf[1]) in vfe_flush_buffers()
1390 vb2_buffer_done(&output->buf[1]->vb.vb2_buf, state); in vfe_flush_buffers()
1392 if (output->last_buffer) { in vfe_flush_buffers()
1393 vb2_buffer_done(&output->last_buffer->vb.vb2_buf, state); in vfe_flush_buffers()
1394 output->last_buffer = NULL; in vfe_flush_buffers()
2087 init_completion(&l->output.sof); in msm_vfe_subdev_init()
2088 init_completion(&l->output.reg_update); in msm_vfe_subdev_init()