Lines Matching refs:geo

506 static void vou_adjust_input(struct sh_vou_geometry *geo, v4l2_std_id std)  in vou_adjust_input()  argument
518 v4l_bound_align_image(&geo->in_width, in vou_adjust_input()
520 &geo->in_height, in vou_adjust_input()
526 unsigned int found = geo->output.width * vou_scale_h_den[i] / in vou_adjust_input()
533 err = abs(found - geo->in_width); in vou_adjust_input()
543 geo->in_width = best; in vou_adjust_input()
544 geo->scale_idx_h = idx; in vou_adjust_input()
551 unsigned int found = geo->output.height * vou_scale_v_den[i] / in vou_adjust_input()
558 err = abs(found - geo->in_height); in vou_adjust_input()
568 geo->in_height = best; in vou_adjust_input()
569 geo->scale_idx_v = idx; in vou_adjust_input()
576 static void vou_adjust_output(struct sh_vou_geometry *geo, v4l2_std_id std) in vou_adjust_output() argument
578 unsigned int best_err = UINT_MAX, best = geo->in_width, in vou_adjust_output()
595 unsigned int found = geo->in_width * vou_scale_h_num[i] / in vou_adjust_output()
602 err = abs(found - geo->output.width); in vou_adjust_output()
612 geo->output.width = best; in vou_adjust_output()
613 geo->scale_idx_h = idx_h; in vou_adjust_output()
614 if (geo->output.left + best > width_max) in vou_adjust_output()
615 geo->output.left = width_max - best; in vou_adjust_output()
617 pr_debug("%s(): W %u * %u/%u = %u\n", __func__, geo->in_width, in vou_adjust_output()
625 unsigned int found = geo->in_height * vou_scale_v_num[i] / in vou_adjust_output()
632 err = abs(found - geo->output.height); in vou_adjust_output()
642 geo->output.height = best; in vou_adjust_output()
643 geo->scale_idx_v = idx_v; in vou_adjust_output()
644 if (geo->output.top + best > height_max) in vou_adjust_output()
645 geo->output.top = height_max - best; in vou_adjust_output()
647 pr_debug("%s(): H %u * %u/%u = %u\n", __func__, geo->in_height, in vou_adjust_output()
691 struct sh_vou_geometry geo; in sh_vou_set_fmt_vid_out() local
710 geo.in_width = pix->width; in sh_vou_set_fmt_vid_out()
711 geo.in_height = pix->height; in sh_vou_set_fmt_vid_out()
712 geo.output = vou_dev->rect; in sh_vou_set_fmt_vid_out()
714 vou_adjust_output(&geo, vou_dev->std); in sh_vou_set_fmt_vid_out()
716 mbfmt->width = geo.output.width; in sh_vou_set_fmt_vid_out()
717 mbfmt->height = geo.output.height; in sh_vou_set_fmt_vid_out()
725 geo.output.width, geo.output.height, mbfmt->width, mbfmt->height); in sh_vou_set_fmt_vid_out()
738 if (mbfmt->width != geo.output.width || in sh_vou_set_fmt_vid_out()
739 mbfmt->height != geo.output.height) { in sh_vou_set_fmt_vid_out()
740 geo.output.width = mbfmt->width; in sh_vou_set_fmt_vid_out()
741 geo.output.height = mbfmt->height; in sh_vou_set_fmt_vid_out()
743 vou_adjust_input(&geo, vou_dev->std); in sh_vou_set_fmt_vid_out()
747 vou_dev->rect = geo.output; in sh_vou_set_fmt_vid_out()
748 pix->width = geo.in_width; in sh_vou_set_fmt_vid_out()
749 pix->height = geo.in_height; in sh_vou_set_fmt_vid_out()
759 geo.scale_idx_h, geo.scale_idx_v); in sh_vou_set_fmt_vid_out()
933 struct sh_vou_geometry geo; in sh_vou_s_selection() local
967 geo.output = *rect; in sh_vou_s_selection()
968 geo.in_width = pix->width; in sh_vou_s_selection()
969 geo.in_height = pix->height; in sh_vou_s_selection()
972 sd_sel.r.width = geo.output.width; in sh_vou_s_selection()
973 sd_sel.r.height = geo.output.height; in sh_vou_s_selection()
980 format.format.width = geo.output.width; in sh_vou_s_selection()
981 format.format.height = geo.output.height; in sh_vou_s_selection()
994 geo.output.width = format.format.width; in sh_vou_s_selection()
995 geo.output.height = format.format.height; in sh_vou_s_selection()
1001 vou_adjust_input(&geo, vou_dev->std); in sh_vou_s_selection()
1004 vou_dev->rect = geo.output; in sh_vou_s_selection()
1005 pix->width = geo.in_width; in sh_vou_s_selection()
1006 pix->height = geo.in_height; in sh_vou_s_selection()
1009 geo.scale_idx_h, geo.scale_idx_v); in sh_vou_s_selection()