Lines Matching refs: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()
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()
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()
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()
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
674 if (output->state != VFE_OUTPUT_RESERVED) { in vfe_enable_output()
676 output->state); in vfe_enable_output()
680 output->state = VFE_OUTPUT_IDLE; in vfe_enable_output()
682 output->buf[0] = vfe_buf_get_pending(output); in vfe_enable_output()
683 output->buf[1] = vfe_buf_get_pending(output); in vfe_enable_output()
685 if (!output->buf[0] && output->buf[1]) { in vfe_enable_output()
686 output->buf[0] = output->buf[1]; in vfe_enable_output()
687 output->buf[1] = NULL; in vfe_enable_output()
690 if (output->buf[0]) in vfe_enable_output()
691 output->state = VFE_OUTPUT_SINGLE; in vfe_enable_output()
693 if (output->buf[1]) in vfe_enable_output()
694 output->state = VFE_OUTPUT_CONTINUOUS; in vfe_enable_output()
696 switch (output->state) { in vfe_enable_output()
698 vfe_output_frame_drop(vfe, output, 1); in vfe_enable_output()
701 vfe_output_frame_drop(vfe, output, 3); in vfe_enable_output()
704 vfe_output_frame_drop(vfe, output, 0); in vfe_enable_output()
708 output->sequence = 0; in vfe_enable_output()
709 output->wait_sof = 0; in vfe_enable_output()
710 output->wait_reg_update = 0; in vfe_enable_output()
711 reinit_completion(&output->sof); in vfe_enable_output()
712 reinit_completion(&output->reg_update); in vfe_enable_output()
714 vfe_output_init_addrs(vfe, output, 0); in vfe_enable_output()
717 ops->set_cgc_override(vfe, output->wm_idx[0], 1); in vfe_enable_output()
718 ops->enable_irq_wm_line(vfe, output->wm_idx[0], line->id, 1); in vfe_enable_output()
719 ops->bus_connect_wm_to_rdi(vfe, output->wm_idx[0], line->id); in vfe_enable_output()
720 ops->wm_set_subsample(vfe, output->wm_idx[0]); in vfe_enable_output()
722 ops->wm_set_ub_cfg(vfe, output->wm_idx[0], in vfe_enable_output()
723 (ub_size + 1) * output->wm_idx[0], ub_size); in vfe_enable_output()
724 ops->wm_frame_based(vfe, output->wm_idx[0], 1); in vfe_enable_output()
725 ops->wm_enable(vfe, output->wm_idx[0], 1); in vfe_enable_output()
726 ops->bus_reload_wm(vfe, output->wm_idx[0]); in vfe_enable_output()
728 ub_size /= output->wm_num; in vfe_enable_output()
729 for (i = 0; i < output->wm_num; i++) { in vfe_enable_output()
730 ops->set_cgc_override(vfe, output->wm_idx[i], 1); in vfe_enable_output()
731 ops->wm_set_subsample(vfe, output->wm_idx[i]); in vfe_enable_output()
732 ops->wm_set_ub_cfg(vfe, output->wm_idx[i], in vfe_enable_output()
733 (ub_size + 1) * output->wm_idx[i], in vfe_enable_output()
735 ops->wm_line_based(vfe, output->wm_idx[i], in vfe_enable_output()
738 ops->wm_enable(vfe, output->wm_idx[i], 1); in vfe_enable_output()
739 ops->bus_reload_wm(vfe, output->wm_idx[i]); in vfe_enable_output()
745 ops->set_xbar_cfg(vfe, output, 1); in vfe_enable_output()
763 struct vfe_output *output = &line->output; in vfe_disable_output() local
771 output->wait_sof = 1; in vfe_disable_output()
774 time = wait_for_completion_timeout(&output->sof, in vfe_disable_output()
780 for (i = 0; i < output->wm_num; i++) in vfe_disable_output()
781 ops->wm_enable(vfe, output->wm_idx[i], 0); in vfe_disable_output()
784 output->wait_reg_update = 1; in vfe_disable_output()
787 time = wait_for_completion_timeout(&output->reg_update, in vfe_disable_output()
795 ops->wm_frame_based(vfe, output->wm_idx[0], 0); in vfe_disable_output()
796 ops->bus_disconnect_wm_from_rdi(vfe, output->wm_idx[0], in vfe_disable_output()
798 ops->enable_irq_wm_line(vfe, output->wm_idx[0], line->id, 0); in vfe_disable_output()
799 ops->set_cgc_override(vfe, output->wm_idx[0], 0); in vfe_disable_output()
802 for (i = 0; i < output->wm_num; i++) { in vfe_disable_output()
803 ops->wm_line_based(vfe, output->wm_idx[i], NULL, i, 0); in vfe_disable_output()
804 ops->set_cgc_override(vfe, output->wm_idx[i], 0); in vfe_disable_output()
810 ops->set_xbar_cfg(vfe, output, 0); in vfe_disable_output()
910 struct vfe_output *output; in vfe_isr_sof() local
914 output = &vfe->line[line_id].output; in vfe_isr_sof()
915 if (output->wait_sof) { in vfe_isr_sof()
916 output->wait_sof = 0; in vfe_isr_sof()
917 complete(&output->sof); in vfe_isr_sof()
929 struct vfe_output *output; in vfe_isr_reg_update() local
935 output = &vfe->line[line_id].output; in vfe_isr_reg_update()
937 if (output->wait_reg_update) { in vfe_isr_reg_update()
938 output->wait_reg_update = 0; in vfe_isr_reg_update()
939 complete(&output->reg_update); in vfe_isr_reg_update()
944 if (output->state == VFE_OUTPUT_STOPPING) { in vfe_isr_reg_update()
946 if (output->last_buffer) { in vfe_isr_reg_update()
947 vb2_buffer_done(&output->last_buffer->vb.vb2_buf, in vfe_isr_reg_update()
949 output->last_buffer = NULL; in vfe_isr_reg_update()
951 output->state = VFE_OUTPUT_IDLE; in vfe_isr_reg_update()
956 output->buf[0] = vfe_buf_get_pending(output); in vfe_isr_reg_update()
957 output->buf[1] = vfe_buf_get_pending(output); in vfe_isr_reg_update()
959 if (!output->buf[0] && output->buf[1]) { in vfe_isr_reg_update()
960 output->buf[0] = output->buf[1]; in vfe_isr_reg_update()
961 output->buf[1] = NULL; in vfe_isr_reg_update()
964 if (output->buf[0]) in vfe_isr_reg_update()
965 output->state = VFE_OUTPUT_SINGLE; in vfe_isr_reg_update()
967 if (output->buf[1]) in vfe_isr_reg_update()
968 output->state = VFE_OUTPUT_CONTINUOUS; in vfe_isr_reg_update()
970 switch (output->state) { in vfe_isr_reg_update()
972 vfe_output_frame_drop(vfe, output, 2); in vfe_isr_reg_update()
975 vfe_output_frame_drop(vfe, output, 3); in vfe_isr_reg_update()
978 vfe_output_frame_drop(vfe, output, 0); in vfe_isr_reg_update()
982 vfe_output_init_addrs(vfe, output, 1); in vfe_isr_reg_update()
996 struct vfe_output *output; in vfe_isr_wm_done() local
1012 output = &vfe->line[vfe->wm_output_map[wm]].output; in vfe_isr_wm_done()
1014 if (output->active_buf == active_index) { in vfe_isr_wm_done()
1019 output->active_buf = active_index; in vfe_isr_wm_done()
1021 ready_buf = output->buf[!active_index]; in vfe_isr_wm_done()
1025 !active_index, output->state); in vfe_isr_wm_done()
1030 ready_buf->vb.sequence = output->sequence++; in vfe_isr_wm_done()
1033 output->buf[!active_index] = vfe_buf_get_pending(output); in vfe_isr_wm_done()
1034 if (!output->buf[!active_index]) { in vfe_isr_wm_done()
1037 vfe_buf_update_wm_on_last(vfe, output); in vfe_isr_wm_done()
1039 new_addr = output->buf[!active_index]->addr; in vfe_isr_wm_done()
1040 vfe_buf_update_wm_on_next(vfe, output); in vfe_isr_wm_done()
1044 for (i = 0; i < output->wm_num; i++) in vfe_isr_wm_done()
1045 vfe->ops->wm_set_ping_addr(vfe, output->wm_idx[i], in vfe_isr_wm_done()
1048 for (i = 0; i < output->wm_num; i++) in vfe_isr_wm_done()
1049 vfe->ops->wm_set_pong_addr(vfe, output->wm_idx[i], in vfe_isr_wm_done()
1054 if (output->state == VFE_OUTPUT_STOPPING) in vfe_isr_wm_done()
1055 output->last_buffer = ready_buf; in vfe_isr_wm_done()
1337 struct vfe_output *output; in vfe_queue_buffer() local
1340 output = &line->output; in vfe_queue_buffer()
1344 vfe_buf_update_wm_on_new(vfe, output, buf); in vfe_queue_buffer()
1366 struct vfe_output *output; in vfe_flush_buffers() local
1369 output = &line->output; in vfe_flush_buffers()
1373 vfe_buf_flush_pending(output, state); in vfe_flush_buffers()
1375 if (output->buf[0]) in vfe_flush_buffers()
1376 vb2_buffer_done(&output->buf[0]->vb.vb2_buf, state); in vfe_flush_buffers()
1378 if (output->buf[1]) in vfe_flush_buffers()
1379 vb2_buffer_done(&output->buf[1]->vb.vb2_buf, state); in vfe_flush_buffers()
1381 if (output->last_buffer) { in vfe_flush_buffers()
1382 vb2_buffer_done(&output->last_buffer->vb.vb2_buf, state); in vfe_flush_buffers()
1383 output->last_buffer = NULL; in vfe_flush_buffers()
2076 init_completion(&l->output.sof); in msm_vfe_subdev_init()
2077 init_completion(&l->output.reg_update); in msm_vfe_subdev_init()