/drivers/media/platform/omap/ |
D | omap_voutlib.c | 44 struct v4l2_framebuffer *fbuf, struct v4l2_rect *crop) in omap_vout_default_crop() argument 46 crop->width = (pix->width < fbuf->fmt.width) ? in omap_vout_default_crop() 48 crop->height = (pix->height < fbuf->fmt.height) ? in omap_vout_default_crop() 50 crop->width &= ~1; in omap_vout_default_crop() 51 crop->height &= ~1; in omap_vout_default_crop() 52 crop->left = ((pix->width - crop->width) >> 1) & ~1; in omap_vout_default_crop() 53 crop->top = ((pix->height - crop->height) >> 1) & ~1; in omap_vout_default_crop() 111 int omap_vout_new_window(struct v4l2_rect *crop, in omap_vout_new_window() argument 129 if ((crop->height/win->w.height) >= 2) in omap_vout_new_window() 130 crop->height = win->w.height * 2; in omap_vout_new_window() [all …]
|
D | omap_vout_vrfb.c | 297 struct v4l2_rect *crop = &vout->crop; in omap_vout_calculate_vrfb_offset() local 329 ctop = (pix->height - crop->height) - crop->top; in omap_vout_calculate_vrfb_offset() 330 cleft = (pix->width - crop->width) - crop->left; in omap_vout_calculate_vrfb_offset() 342 temp_ps * cleft + crop->top * temp_ps; in omap_vout_calculate_vrfb_offset() 345 cleft + crop->top * temp_ps + (line_length * in omap_vout_calculate_vrfb_offset() 346 ((crop->width / (vr_ps)) - 1) * ps); in omap_vout_calculate_vrfb_offset() 361 (crop->height - 1) * ps); in omap_vout_calculate_vrfb_offset() 370 temp_ps * crop->left + ctop * ps; in omap_vout_calculate_vrfb_offset() 373 temp_ps * crop->left + ctop * ps + in omap_vout_calculate_vrfb_offset() 374 (line_length * ((crop->width / vr_ps) - 1) * in omap_vout_calculate_vrfb_offset() [all …]
|
D | omap_voutlib.h | 16 struct v4l2_framebuffer *fbuf, struct v4l2_rect *crop); 19 struct v4l2_rect *crop, struct v4l2_window *win, 26 int omap_vout_new_window(struct v4l2_rect *crop, 31 struct v4l2_framebuffer *fbuf, struct v4l2_rect *crop,
|
/drivers/media/platform/vsp1/ |
D | vsp1_rwpf.c | 82 return &rwpf->crop; in vsp1_rwpf_get_crop() 104 struct v4l2_rect *crop; in vsp1_rwpf_set_format() local 134 crop = vsp1_rwpf_get_crop(rwpf, cfg, fmt->which); in vsp1_rwpf_set_format() 135 crop->left = 0; in vsp1_rwpf_set_format() 136 crop->top = 0; in vsp1_rwpf_set_format() 137 crop->width = fmt->format.width; in vsp1_rwpf_set_format() 138 crop->height = fmt->format.height; in vsp1_rwpf_set_format() 186 struct v4l2_rect *crop; in vsp1_rwpf_set_selection() local 222 crop = vsp1_rwpf_get_crop(rwpf, cfg, sel->which); in vsp1_rwpf_set_selection() 223 *crop = sel->r; in vsp1_rwpf_set_selection() [all …]
|
D | vsp1_rpf.c | 80 const struct v4l2_rect *crop = &rpf->crop; in rpf_s_stream() local 99 (crop->width << VI6_RPF_SRC_BSIZE_BHSIZE_SHIFT) | in rpf_s_stream() 100 (crop->height << VI6_RPF_SRC_BSIZE_BVSIZE_SHIFT)); in rpf_s_stream() 102 (crop->width << VI6_RPF_SRC_ESIZE_EHSIZE_SHIFT) | in rpf_s_stream() 103 (crop->height << VI6_RPF_SRC_ESIZE_EVSIZE_SHIFT)); in rpf_s_stream() 105 rpf->offsets[0] = crop->top * format->plane_fmt[0].bytesperline in rpf_s_stream() 106 + crop->left * fmtinfo->bpp[0] / 8; in rpf_s_stream() 114 rpf->offsets[1] = crop->top * format->plane_fmt[1].bytesperline in rpf_s_stream() 115 + crop->left * fmtinfo->bpp[1] / 8; in rpf_s_stream()
|
D | vsp1_wpf.c | 79 const struct v4l2_rect *crop = &wpf->crop; in wpf_s_stream() local 125 (crop->left << VI6_WPF_SZCLIP_OFST_SHIFT) | in wpf_s_stream() 126 (crop->width << VI6_WPF_SZCLIP_SIZE_SHIFT)); in wpf_s_stream() 128 (crop->top << VI6_WPF_SZCLIP_OFST_SHIFT) | in wpf_s_stream() 129 (crop->height << VI6_WPF_SZCLIP_SIZE_SHIFT)); in wpf_s_stream()
|
/drivers/media/platform/omap3isp/ |
D | ispresizer.c | 142 return &res->crop.request; in __resizer_get_crop() 508 clock = div_u64((u64)limit * res->crop.active.height, ofmt->height); in omap3isp_resizer_max_rate() 510 *max_rate = div_u64((u64)clock * res->crop.active.width, ofmt->width); in omap3isp_resizer_max_rate() 589 requests_per_frame = DIV_ROUND_UP(res->crop.active.width * 2, 256) in resizer_adjust_bandwidth() 590 * res->crop.active.height; in resizer_adjust_bandwidth() 927 res->crop_offset = (res->crop.active.top * input->width + in resizer_set_crop_params() 928 res->crop.active.left) * 2; in resizer_set_crop_params() 947 resizer_set_start(res, res->crop.active.left * 2, in resizer_set_crop_params() 948 res->crop.active.top); in resizer_set_crop_params() 955 resizer_set_input_size(res, res->crop.active.width, in resizer_set_crop_params() [all …]
|
D | ispccdc.c | 1121 const struct v4l2_rect *crop; in ccdc_configure() local 1230 crop = &ccdc->crop; in ccdc_configure() 1238 sph = crop->left * 2; in ccdc_configure() 1239 nph = crop->width * 2 - 1; in ccdc_configure() 1241 sph = crop->left; in ccdc_configure() 1242 nph = crop->width - 1; in ccdc_configure() 1248 isp_reg_writel(isp, (crop->top << ISPCCDC_VERT_START_SLV0_SHIFT) | in ccdc_configure() 1249 (crop->top << ISPCCDC_VERT_START_SLV1_SHIFT), in ccdc_configure() 1251 isp_reg_writel(isp, (crop->height - 1) in ccdc_configure() 1954 return &ccdc->crop; in __ccdc_get_crop() [all …]
|
D | isppreview.c | 1069 unsigned int sph = prev->crop.left; in preview_config_input_size() 1070 unsigned int eph = prev->crop.left + prev->crop.width - 1; in preview_config_input_size() 1071 unsigned int slv = prev->crop.top; in preview_config_input_size() 1072 unsigned int elv = prev->crop.top + prev->crop.height - 1; in preview_config_input_size() 1701 return &prev->crop; in __preview_get_crop() 1740 struct v4l2_rect *crop; in preview_try_format() local 1794 crop = __preview_get_crop(prev, cfg, which); in preview_try_format() 1795 fmt->width = crop->width; in preview_try_format() 1796 fmt->height = crop->height; in preview_try_format() 1819 struct v4l2_rect *crop) in preview_try_crop() argument [all …]
|
/drivers/media/platform/exynos-gsc/ |
D | gsc-core.c | 233 frame->crop.width = width; in gsc_set_frame_size() 234 frame->crop.height = height; in gsc_set_frame_size() 235 frame->crop.left = 0; in gsc_set_frame_size() 236 frame->crop.top = 0; in gsc_set_frame_size() 291 remainder = s_frame->crop.width % (*wratio * walign); in gsc_check_src_scale_info() 293 s_frame->crop.width -= remainder; in gsc_check_src_scale_info() 294 gsc_cal_prescaler_ratio(var, s_frame->crop.width, tx, wratio); in gsc_check_src_scale_info() 296 s_frame->crop.width + remainder, s_frame->crop.width); in gsc_check_src_scale_info() 299 remainder = s_frame->crop.height % (*hratio * halign); in gsc_check_src_scale_info() 301 s_frame->crop.height -= remainder; in gsc_check_src_scale_info() [all …]
|
D | gsc-regs.c | 131 cfg = GSC_SRCIMG_OFFSET_X(frame->crop.left); in gsc_hw_set_in_size() 132 cfg |= GSC_SRCIMG_OFFSET_Y(frame->crop.top); in gsc_hw_set_in_size() 141 cfg = GSC_CROPPED_WIDTH(frame->crop.width); in gsc_hw_set_in_size() 142 cfg |= GSC_CROPPED_HEIGHT(frame->crop.height); in gsc_hw_set_in_size() 245 cfg = GSC_DSTIMG_OFFSET_X(frame->crop.left); in gsc_hw_set_out_size() 246 cfg |= GSC_DSTIMG_OFFSET_Y(frame->crop.top); in gsc_hw_set_out_size() 257 cfg = GSC_SCALED_WIDTH(frame->crop.height); in gsc_hw_set_out_size() 258 cfg |= GSC_SCALED_HEIGHT(frame->crop.width); in gsc_hw_set_out_size() 260 cfg = GSC_SCALED_WIDTH(frame->crop.width); in gsc_hw_set_out_size() 261 cfg |= GSC_SCALED_HEIGHT(frame->crop.height); in gsc_hw_set_out_size()
|
/drivers/media/v4l2-core/ |
D | v4l2-subdev.c | 142 static int check_crop(struct v4l2_subdev *sd, struct v4l2_subdev_crop *crop) in check_crop() argument 144 if (crop->which != V4L2_SUBDEV_FORMAT_TRY && in check_crop() 145 crop->which != V4L2_SUBDEV_FORMAT_ACTIVE) in check_crop() 148 if (crop->pad >= sd->entity.num_pads) in check_crop() 278 struct v4l2_subdev_crop *crop = arg; in subdev_do_ioctl() local 281 rval = check_crop(sd, crop); in subdev_do_ioctl() 286 sel.which = crop->which; in subdev_do_ioctl() 287 sel.pad = crop->pad; in subdev_do_ioctl() 293 crop->rect = sel.r; in subdev_do_ioctl() 299 struct v4l2_subdev_crop *crop = arg; in subdev_do_ioctl() local [all …]
|
/drivers/media/i2c/ |
D | mt9m032.c | 163 struct v4l2_rect crop; member 196 struct v4l2_rect *crop = &sensor->crop; in mt9m032_update_timing() local 204 row_time = mt9m032_row_time(sensor, crop->width); in mt9m032_update_timing() 208 - crop->height; in mt9m032_update_timing() 214 div_u64((crop->height + MT9M032_VBLANK_MAX) * in mt9m032_update_timing() 219 - crop->height; in mt9m032_update_timing() 234 sensor->crop.width - 1); in mt9m032_update_geom_timing() 237 sensor->crop.height - 1); in mt9m032_update_geom_timing() 240 sensor->crop.left); in mt9m032_update_geom_timing() 243 sensor->crop.top); in mt9m032_update_geom_timing() [all …]
|
D | mt9t001.c | 129 struct v4l2_rect crop; member 268 return &mt9t001->crop; in __mt9t001_get_pad_crop() 281 struct v4l2_rect *crop = &mt9t001->crop; in mt9t001_s_stream() local 298 hratio = DIV_ROUND_CLOSEST(crop->width, format->width); in mt9t001_s_stream() 299 vratio = DIV_ROUND_CLOSEST(crop->height, format->height); in mt9t001_s_stream() 309 ret = mt9t001_write(client, MT9T001_COLUMN_START, crop->left); in mt9t001_s_stream() 313 ret = mt9t001_write(client, MT9T001_ROW_START, crop->top); in mt9t001_s_stream() 317 ret = mt9t001_write(client, MT9T001_WINDOW_WIDTH, crop->width - 1); in mt9t001_s_stream() 321 ret = mt9t001_write(client, MT9T001_WINDOW_HEIGHT, crop->height - 1); in mt9t001_s_stream() 791 struct v4l2_rect *crop; in mt9t001_open() local [all …]
|
D | mt9v032.c | 239 struct v4l2_rect crop; member 296 struct v4l2_rect *crop = &mt9v032->crop; in mt9v032_update_hblank() local 302 min_hblank = max_t(int, mt9v032->model->data->min_row_time - crop->width, in mt9v032_update_hblank() 398 return &mt9v032->crop; in __mt9v032_get_pad_crop() 410 struct v4l2_rect *crop = &mt9v032->crop; in mt9v032_s_stream() local 429 ret = regmap_write(map, MT9V032_COLUMN_START, crop->left); in mt9v032_s_stream() 433 ret = regmap_write(map, MT9V032_ROW_START, crop->top); in mt9v032_s_stream() 437 ret = regmap_write(map, MT9V032_WINDOW_WIDTH, crop->width); in mt9v032_s_stream() 441 ret = regmap_write(map, MT9V032_WINDOW_HEIGHT, crop->height); in mt9v032_s_stream() 820 struct v4l2_rect *crop; in mt9v032_open() local [all …]
|
D | mt9p031.c | 127 struct v4l2_rect crop; /* Sensor window */ member 389 const struct v4l2_rect *crop = &mt9p031->crop; in mt9p031_set_params() local 404 ret = mt9p031_write(client, MT9P031_COLUMN_START, crop->left); in mt9p031_set_params() 407 ret = mt9p031_write(client, MT9P031_ROW_START, crop->top); in mt9p031_set_params() 410 ret = mt9p031_write(client, MT9P031_WINDOW_WIDTH, crop->width - 1); in mt9p031_set_params() 413 ret = mt9p031_write(client, MT9P031_WINDOW_HEIGHT, crop->height - 1); in mt9p031_set_params() 420 xskip = DIV_ROUND_CLOSEST(crop->width, format->width); in mt9p031_set_params() 421 yskip = DIV_ROUND_CLOSEST(crop->height, format->height); in mt9p031_set_params() 555 return &mt9p031->crop; in __mt9p031_get_pad_crop() 973 struct v4l2_rect *crop; in mt9p031_open() local [all …]
|
D | s5k6aa.c | 1122 struct v4l2_rect *crop; in s5k6aa_set_fmt() local 1130 crop = v4l2_subdev_get_try_crop(sd, cfg, 0); in s5k6aa_set_fmt() 1136 crop = &s5k6aa->ccd_rect; in s5k6aa_set_fmt() 1152 crop->width = clamp_t(unsigned int, crop->width, mf->width, in s5k6aa_set_fmt() 1154 crop->height = clamp_t(unsigned int, crop->height, mf->height, in s5k6aa_set_fmt() 1156 crop->left = clamp_t(unsigned int, crop->left, 0, in s5k6aa_set_fmt() 1157 S5K6AA_WIN_WIDTH_MAX - crop->width); in s5k6aa_set_fmt() 1158 crop->top = clamp_t(unsigned int, crop->top, 0, in s5k6aa_set_fmt() 1159 S5K6AA_WIN_HEIGHT_MAX - crop->height); in s5k6aa_set_fmt() 1433 struct v4l2_rect *crop = v4l2_subdev_get_try_crop(sd, fh->pad, 0); in s5k6aa_open() local [all …]
|
/drivers/media/pci/bt8xx/ |
D | bttv-risc.c | 362 geo->crop = ((width>>8)&0x03) | ((geo->hdelay>>6)&0x0c) | in bttv_calc_geo_old() 386 const struct v4l2_rect * crop) in bttv_calc_geo() argument 392 if ((crop->left == tvnorm->cropcap.defrect.left in bttv_calc_geo() 393 && crop->top == tvnorm->cropcap.defrect.top in bttv_calc_geo() 394 && crop->width == tvnorm->cropcap.defrect.width in bttv_calc_geo() 395 && crop->height == tvnorm->cropcap.defrect.height in bttv_calc_geo() 405 c_width = min((unsigned int) crop->width, width * 16); in bttv_calc_geo() 406 c_height = min((unsigned int) crop->height, height * 16); in bttv_calc_geo() 411 geo->hdelay = ((crop->left * width + c_width) / c_width) & ~1; in bttv_calc_geo() 414 geo->vdelay = crop->top - tvnorm->cropcap.bounds.top + MIN_VDELAY; in bttv_calc_geo() [all …]
|
/drivers/media/platform/vivid/ |
D | vivid-vid-out.c | 440 struct v4l2_rect *crop = &dev->crop_out; in vivid_s_fmt_vid_out() local 477 rect_map_inside(crop, &r); in vivid_s_fmt_vid_out() 479 *crop = r; in vivid_s_fmt_vid_out() 498 crop->width / MAX_ZOOM, in vivid_s_fmt_vid_out() 499 factor * crop->height / MAX_ZOOM in vivid_s_fmt_vid_out() 503 crop->width * MAX_ZOOM, in vivid_s_fmt_vid_out() 504 factor * crop->height * MAX_ZOOM in vivid_s_fmt_vid_out() 512 rect_set_size_to(crop, &r); in vivid_s_fmt_vid_out() 517 rect_map_inside(crop, &r); in vivid_s_fmt_vid_out() 524 crop->top *= factor; in vivid_s_fmt_vid_out() [all …]
|
D | vivid-tpg.c | 102 tpg->crop.width = tpg->compose.width = w; in tpg_init() 103 tpg->crop.height = tpg->compose.height = h; in tpg_init() 389 void tpg_s_crop_compose(struct tpg_data *tpg, const struct v4l2_rect *crop, in tpg_s_crop_compose() argument 392 tpg->crop = *crop; in tpg_s_crop_compose() 395 tpg->crop.width - 1) / tpg->crop.width; in tpg_s_crop_compose() 416 tpg->crop.top = tpg->crop.left = 0; in tpg_reset_source() 417 tpg->crop.width = width; in tpg_reset_source() 418 tpg->crop.height = height; in tpg_reset_source() 1751 return tpg->crop.top + src_y * 2; in tpg_calc_frameline() 1753 return tpg->crop.top + src_y * 2 + 1; in tpg_calc_frameline() [all …]
|
/drivers/media/platform/s3c-camif/ |
D | camif-capture.c | 736 struct v4l2_rect *crop = &camif->camif_crop; in __camif_video_try_format() local 752 pix->width, pix->height, crop->width, crop->height, in __camif_video_try_format() 758 sc_hrmax = min(SCALER_MAX_RATIO, 1 << (ffs(crop->width) - 3)); in __camif_video_try_format() 759 sc_vrmax = min(SCALER_MAX_RATIO, 1 << (ffs(crop->height) - 1)); in __camif_video_try_format() 761 wmin = max_t(u32, pix_lim->min_out_width, crop->width / sc_hrmax); in __camif_video_try_format() 763 hmin = max_t(u32, 8, crop->height / sc_vrmax); in __camif_video_try_format() 1291 struct v4l2_rect *crop = &camif->camif_crop; in __camif_subdev_try_format() local 1292 v4l_bound_align_image(&mf->width, 8, crop->width, in __camif_subdev_try_format() 1294 &mf->height, 8, crop->height, in __camif_subdev_try_format() 1307 struct v4l2_rect *crop = &camif->camif_crop; in s3c_camif_subdev_set_fmt() local [all …]
|
D | camif-regs.c | 134 struct v4l2_rect *crop = &camif->camif_crop; in camif_hw_set_camera_crop() local 141 cfg |= (crop->left << 16) | crop->top; in camif_hw_set_camera_crop() 142 if (crop->left != 0 || crop->top != 0) in camif_hw_set_camera_crop() 147 hoff2 = mf->width - crop->width - crop->left; in camif_hw_set_camera_crop() 148 voff2 = mf->height - crop->height - crop->top; in camif_hw_set_camera_crop()
|
/drivers/media/platform/soc_camera/ |
D | soc_scale_crop.c | 43 struct v4l2_crop crop; in soc_camera_client_g_rect() local 47 crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; in soc_camera_client_g_rect() 49 ret = v4l2_subdev_call(sd, video, g_crop, &crop); in soc_camera_client_g_rect() 51 *rect = crop.c; in soc_camera_client_g_rect() 97 struct v4l2_crop *crop, struct v4l2_crop *cam_crop, in soc_camera_client_s_crop() argument 100 struct v4l2_rect *rect = &crop->c, *cam_rect = &cam_crop->c; in soc_camera_client_s_crop() 106 v4l2_subdev_call(sd, video, s_crop, crop); in soc_camera_client_s_crop()
|
/drivers/media/platform/sti/bdisp/ |
D | bdisp-hw.c | 337 src_w = ctx->src.crop.width; in bdisp_hw_get_hv_inc() 338 src_h = ctx->src.crop.height; in bdisp_hw_get_hv_inc() 339 dst_w = ctx->dst.crop.width; in bdisp_hw_get_hv_inc() 340 dst_h = ctx->dst.crop.height; in bdisp_hw_get_hv_inc() 470 struct v4l2_rect src_rect = src->crop; in bdisp_hw_build_node() 471 struct v4l2_rect dst_rect = dst->crop; in bdisp_hw_build_node() 473 s32 dst_width = dst->crop.width; in bdisp_hw_build_node() 486 dst_x_offset = (src_x_offset * dst_width) / ctx->src.crop.width; in bdisp_hw_build_node() 488 dst_rect.width = (src_rect.width * dst_width) / ctx->src.crop.width; in bdisp_hw_build_node() 733 if (src_x_offset >= ctx->src.crop.width) in bdisp_hw_build_all_nodes()
|
/drivers/media/platform/davinci/ |
D | vpfe_capture.c | 343 ccdc_dev->hw_ops.set_image_window(&vpfe_dev->crop); in vpfe_config_ccdc_image_format() 407 vpfe_dev->crop.top = 0; in vpfe_config_image_format() 408 vpfe_dev->crop.left = 0; in vpfe_config_image_format() 409 vpfe_dev->crop.width = vpfe_dev->std_info.active_pixels; in vpfe_config_image_format() 410 vpfe_dev->crop.height = vpfe_dev->std_info.active_lines; in vpfe_config_image_format() 411 pix->width = vpfe_dev->crop.width; in vpfe_config_image_format() 412 pix->height = vpfe_dev->crop.height; in vpfe_config_image_format() 1607 struct v4l2_cropcap *crop) in vpfe_cropcap() argument 1616 memset(crop, 0, sizeof(struct v4l2_cropcap)); in vpfe_cropcap() 1617 crop->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; in vpfe_cropcap() [all …]
|