Home
last modified time | relevance | path

Searched refs:crop (Results 1 – 25 of 131) sorted by relevance

123456

/linux/drivers/media/platform/ti/omap/
H A Domap_voutlib.c44 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()
115 int omap_vout_new_window(struct v4l2_rect *crop, in omap_vout_new_window() argument
133 if ((crop->height/win->w.height) >= 2) in omap_vout_new_window()
134 crop->height = win->w.height * 2; in omap_vout_new_window()
[all …]
H A Domap_vout_vrfb.c322 struct v4l2_rect *crop = &vout->crop; in omap_vout_calculate_vrfb_offset() local
354 ctop = (pix->height - crop->height) - crop->top; in omap_vout_calculate_vrfb_offset()
355 cleft = (pix->width - crop->width) - crop->left; in omap_vout_calculate_vrfb_offset()
367 temp_ps * cleft + crop->top * temp_ps; in omap_vout_calculate_vrfb_offset()
370 cleft + crop->top * temp_ps + (line_length * in omap_vout_calculate_vrfb_offset()
371 ((crop->width / (vr_ps)) - 1) * ps); in omap_vout_calculate_vrfb_offset()
386 (crop->height - 1) * ps); in omap_vout_calculate_vrfb_offset()
395 temp_ps * crop->left + ctop * ps; in omap_vout_calculate_vrfb_offset()
398 temp_ps * crop->left + ctop * ps + in omap_vout_calculate_vrfb_offset()
399 (line_length * ((crop->width / vr_ps) - 1) * in omap_vout_calculate_vrfb_offset()
[all …]
H A Domap_voutlib.h16 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,
/linux/drivers/staging/media/atomisp/pci/
H A Datomisp_subdev.c229 return &isp_sd->fmt[pad].crop; in atomisp_subdev_get_rect()
254 struct v4l2_rect *crop[ATOMISP_SUBDEV_PADS_NUM], in isp_get_fmt_rect()
261 crop[i] = atomisp_subdev_get_rect(sd, sd_state, which, i, in isp_get_fmt_rect()
307 struct v4l2_rect *crop[ATOMISP_SUBDEV_PADS_NUM], in atomisp_subdev_set_selection() local
314 isp_get_fmt_rect(sd, sd_state, which, ffmt, crop, comp); in atomisp_subdev_set_selection()
331 crop[pad]->width = ffmt[pad]->width; in atomisp_subdev_set_selection()
332 crop[pad]->height = ffmt[pad]->height; in atomisp_subdev_set_selection()
335 && crop[pad]->width && crop[pad]->height) { in atomisp_subdev_set_selection()
336 crop[pad]->width -= isp_sd->sink_pad_padding_w; in atomisp_subdev_set_selection()
337 crop[pad]->height -= isp_sd->sink_pad_padding_h; in atomisp_subdev_set_selection()
[all …]
/linux/drivers/media/platform/st/sti/delta/
H A Ddelta-debug.c25 s->crop.width, s->crop.height, in delta_streaminfo_str()
26 s->crop.left, s->crop.top, in delta_streaminfo_str()
46 f->crop.width, f->crop.height, in delta_frameinfo_str()
47 f->crop.left, f->crop.top, in delta_frameinfo_str()
/linux/Documentation/userspace-api/media/drivers/
H A Dccs.rst24 as analogue crop functionality present in many compliant devices. The analogue
25 crop is configured using the ``V4L2_SEL_TGT_CROP`` on the source pad (0) of the
36 Additionally, if a device has no scaler or digital crop functionality, the
37 source pad (1) exposes another digital crop selection rectangle that can only
38 crop at the end of the lines and frames.
43 The scaler sub-device represents the digital crop and scaling functionality of
45 configure the digital crop on the sink pad (0) when digital crop is supported.
50 another digital crop selection rectangle that can only crop at the end of the
53 Digital and analogue crop
56 Digital crop functionality is referred to as cropping that effectively works by
[all …]
/linux/Documentation/userspace-api/media/v4l/
H A Dcrop.rst15 equivalent in the SELECTION API. See :ref:`selection-vs-crop` for a
64 .. kernel-figure:: crop.svg
65 :alt: crop.svg
170 struct v4l2_crop crop;
180 memset (&crop, 0, sizeof (crop));
181 crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
182 crop.c = cropcap.defrect;
186 if (-1 == ioctl (fd, VIDIOC_S_CROP, &crop)
229 struct v4l2_crop crop;
239 memset (&crop, 0, sizeof (crop));
[all …]
H A Dvidioc-subdev-g-crop.rst13 VIDIOC_SUBDEV_G_CROP - VIDIOC_SUBDEV_S_CROP - Get or set the crop rectangle on a subdev pad
44 To retrieve the current crop rectangle applications set the ``pad``
53 To change the current crop rectangle applications set both the ``pad``
56 structure. The driver verifies the requested crop rectangle, adjusts it
63 to ``V4L2_SUBDEV_FORMAT_TRY``. When set, 'try' crop rectangles are not
65 crop rectangles and stored in the sub-device file handle. Two
74 Drivers must not return an error solely because the requested crop
114 The crop rectangle can't be changed because the pad is currently
/linux/drivers/media/platform/ti/omap3isp/
H A Dispresizer.c141 return &res->crop.request; in __resizer_get_crop()
507 clock = div_u64((u64)limit * res->crop.active.height, ofmt->height); in omap3isp_resizer_max_rate()
509 *max_rate = div_u64((u64)clock * res->crop.active.width, ofmt->width); in omap3isp_resizer_max_rate()
588 requests_per_frame = DIV_ROUND_UP(res->crop.active.width * 2, 256) in resizer_adjust_bandwidth()
589 * res->crop.active.height; in resizer_adjust_bandwidth()
926 res->crop_offset = (res->crop.active.top * input->width + in resizer_set_crop_params()
927 res->crop.active.left) * 2; in resizer_set_crop_params()
946 resizer_set_start(res, res->crop.active.left * 2, in resizer_set_crop_params()
947 res->crop.active.top); in resizer_set_crop_params()
954 resizer_set_input_size(res, res->crop.active.width, in resizer_set_crop_params()
[all …]
/linux/drivers/media/platform/renesas/vsp1/
H A Dvsp1_rpf.c291 struct v4l2_rect crop = partition->rpf[rpf->entity.index]; in rpf_configure_partition() local
303 crop.height = round_down(crop.height / 2, fmtinfo->vsub); in rpf_configure_partition()
304 crop.top = round_down(crop.top / 2, fmtinfo->vsub); in rpf_configure_partition()
308 (crop.width << VI6_RPF_SRC_BSIZE_BHSIZE_SHIFT) | in rpf_configure_partition()
309 (crop.height << VI6_RPF_SRC_BSIZE_BVSIZE_SHIFT)); in rpf_configure_partition()
311 (crop.width << VI6_RPF_SRC_ESIZE_EHSIZE_SHIFT) | in rpf_configure_partition()
312 (crop.height << VI6_RPF_SRC_ESIZE_EVSIZE_SHIFT)); in rpf_configure_partition()
314 mem.addr[0] += crop.top * format->plane_fmt[0].bytesperline in rpf_configure_partition()
315 + crop.left * fmtinfo->bpp[0] / 8; in rpf_configure_partition()
321 offset = crop.top / fmtinfo->vsub * bpl in rpf_configure_partition()
[all …]
H A Dvsp1_rwpf.c99 struct v4l2_rect *crop; in vsp1_rwpf_set_format() local
102 crop = v4l2_subdev_state_get_crop(state, RWPF_PAD_SINK); in vsp1_rwpf_set_format()
103 crop->left = 0; in vsp1_rwpf_set_format()
104 crop->top = 0; in vsp1_rwpf_set_format()
105 crop->width = fmt->format.width; in vsp1_rwpf_set_format()
106 crop->height = fmt->format.height; in vsp1_rwpf_set_format()
177 struct v4l2_rect *crop; in vsp1_rwpf_set_selection() local
219 crop = v4l2_subdev_state_get_crop(state, RWPF_PAD_SINK); in vsp1_rwpf_set_selection()
220 *crop = sel->r; in vsp1_rwpf_set_selection()
224 format->width = crop->width; in vsp1_rwpf_set_selection()
[all …]
H A Dvsp1_hgt.c136 struct v4l2_rect *crop; in hgt_configure_stream() local
143 crop = v4l2_subdev_state_get_crop(state, HISTO_PAD_SINK); in hgt_configure_stream()
149 (crop->left << VI6_HGT_OFFSET_HOFFSET_SHIFT) | in hgt_configure_stream()
150 (crop->top << VI6_HGT_OFFSET_VOFFSET_SHIFT)); in hgt_configure_stream()
152 (crop->width << VI6_HGT_SIZE_HSIZE_SHIFT) | in hgt_configure_stream()
153 (crop->height << VI6_HGT_SIZE_VSIZE_SHIFT)); in hgt_configure_stream()
165 hratio = crop->width * 2 / compose->width / 3; in hgt_configure_stream()
166 vratio = crop->height * 2 / compose->height / 3; in hgt_configure_stream()
H A Dvsp1_hgo.c140 struct v4l2_rect *crop; in hgo_configure_stream() local
144 crop = v4l2_subdev_state_get_crop(state, HISTO_PAD_SINK); in hgo_configure_stream()
150 (crop->left << VI6_HGO_OFFSET_HOFFSET_SHIFT) | in hgo_configure_stream()
151 (crop->top << VI6_HGO_OFFSET_VOFFSET_SHIFT)); in hgo_configure_stream()
153 (crop->width << VI6_HGO_SIZE_HSIZE_SHIFT) | in hgo_configure_stream()
154 (crop->height << VI6_HGO_SIZE_VSIZE_SHIFT)); in hgo_configure_stream()
162 hratio = crop->width * 2 / compose->width / 3; in hgo_configure_stream()
163 vratio = crop->height * 2 / compose->height / 3; in hgo_configure_stream()
/linux/drivers/staging/media/starfive/camss/
H A Dstf-isp.c63 struct v4l2_rect *crop; in isp_set_stream() local
67 crop = v4l2_subdev_state_get_crop(sd_state, STF_ISP_PAD_SRC); in isp_set_stream()
72 stf_isp_settings(isp_dev, crop, fmt->code); in isp_set_stream()
182 struct v4l2_rect *crop) in isp_try_crop() argument
194 v4l2_rect_set_min_size(crop, &stf_frame_min_crop); in isp_try_crop()
195 v4l2_rect_map_inside(crop, &bounds); in isp_try_crop()
247 struct v4l2_subdev_selection crop = { 0 }; in isp_set_selection() local
257 crop.which = sel->which; in isp_set_selection()
258 crop.pad = STF_ISP_PAD_SRC; in isp_set_selection()
259 crop.target = V4L2_SEL_TGT_CROP; in isp_set_selection()
[all …]
H A Dstf-isp-hw-ops.c346 struct v4l2_rect *crop) in stf_isp_config_crop() argument
351 val = VSTART_CAP(crop->top) | HSTART_CAP(crop->left); in stf_isp_config_crop()
354 val = VEND_CAP(crop->height + crop->top - 1) | in stf_isp_config_crop()
355 HEND_CAP(crop->width + crop->left - 1); in stf_isp_config_crop()
358 val = H_ACT_CAP(crop->height) | W_ACT_CAP(crop->width); in stf_isp_config_crop()
361 val = ALIGN(crop->width * bpp / 8, STFCAMSS_FRAME_WIDTH_ALIGN_8); in stf_isp_config_crop()
409 struct v4l2_rect *crop, u32 mcode) in stf_isp_settings() argument
413 stf_isp_config_crop(stfcamss, crop); in stf_isp_settings()
/linux/drivers/media/platform/mediatek/mdp/
H A Dmtk_mdp_regs.c74 config->crop_x = frame->crop.left; in mtk_mdp_hw_set_in_size()
75 config->crop_y = frame->crop.top; in mtk_mdp_hw_set_in_size()
78 config->crop_w = frame->crop.width; in mtk_mdp_hw_set_in_size()
79 config->crop_h = frame->crop.height; in mtk_mdp_hw_set_in_size()
109 config->crop_x = frame->crop.left; in mtk_mdp_hw_set_out_size()
110 config->crop_y = frame->crop.top; in mtk_mdp_hw_set_out_size()
111 config->crop_w = frame->crop.width; in mtk_mdp_hw_set_out_size()
112 config->crop_h = frame->crop.height; in mtk_mdp_hw_set_out_size()
/linux/drivers/media/i2c/
H A Dmt9m114.c1159 struct v4l2_rect *crop; in mt9m114_pa_init_state() local
1161 crop = v4l2_subdev_state_get_crop(state, 0); in mt9m114_pa_init_state()
1163 crop->left = 0; in mt9m114_pa_init_state()
1164 crop->top = 0; in mt9m114_pa_init_state()
1165 crop->width = MT9M114_PIXEL_ARRAY_WIDTH; in mt9m114_pa_init_state()
1166 crop->height = MT9M114_PIXEL_ARRAY_HEIGHT; in mt9m114_pa_init_state()
1219 struct v4l2_rect *crop; in mt9m114_pa_set_fmt() local
1223 crop = v4l2_subdev_state_get_crop(state, fmt->pad); in mt9m114_pa_set_fmt()
1227 hscale = DIV_ROUND_CLOSEST(crop->width, fmt->format.width ? : 1); in mt9m114_pa_set_fmt()
1228 vscale = DIV_ROUND_CLOSEST(crop->height, fmt->format.height ? : 1); in mt9m114_pa_set_fmt()
[all …]
H A Dov2680.c137 struct v4l2_rect crop; member
325 return &sensor->mode.crop; in __ov2680_get_pad_crop()
347 if (width <= (sensor->mode.crop.width / 2) && in ov2680_calc_mode()
348 height <= (sensor->mode.crop.height / 2)) { in ov2680_calc_mode()
356 sensor->mode.h_start = (sensor->mode.crop.left + in ov2680_calc_mode()
357 (sensor->mode.crop.width - width) / 2) & ~1; in ov2680_calc_mode()
358 sensor->mode.v_start = (sensor->mode.crop.top + in ov2680_calc_mode()
359 (sensor->mode.crop.height - height) / 2) & ~1; in ov2680_calc_mode()
648 const struct v4l2_rect *crop; in ov2680_set_fmt() local
652 crop = __ov2680_get_pad_crop(sensor, sd_state, format->pad, in ov2680_set_fmt()
[all …]
H A Dmt9v032.c190 struct v4l2_rect crop; member
249 struct v4l2_rect *crop = &mt9v032->crop; in mt9v032_update_hblank() local
255 min_hblank = max_t(int, mt9v032->model->data->min_row_time - crop->width, in mt9v032_update_hblank()
376 return &mt9v032->crop; in __mt9v032_get_pad_crop()
387 struct v4l2_rect *crop = &mt9v032->crop; in mt9v032_s_stream() local
406 ret = regmap_write(map, MT9V032_COLUMN_START, crop->left); in mt9v032_s_stream()
410 ret = regmap_write(map, MT9V032_ROW_START, crop->top); in mt9v032_s_stream()
414 ret = regmap_write(map, MT9V032_WINDOW_WIDTH, crop->width); in mt9v032_s_stream()
418 ret = regmap_write(map, MT9V032_WINDOW_HEIGHT, crop->height); in mt9v032_s_stream()
930 struct v4l2_rect *crop; in mt9v032_open() local
[all …]
/linux/Documentation/driver-api/media/drivers/
H A Dsh_mobile_ceu_camera.rst76 2. Calculate "effective" input crop (sensor subwindow) - CEU crop scaled back at
101 8. Calculate new CEU crop - apply sensor scales to previously calculated
102 "effective" crop:
107 9. Use CEU cropping to crop to the new window:
119 The :ref:`V4L2 crop API <crop-scale>` says:
132 to 2 : 2', target crop 5 : 5', current output format 6' - 6.
142 6. Calculate and apply host crop: 6 - 7 = (5 - 2) * (6' - 6) / (5' - 5)
/linux/drivers/media/pci/bt8xx/
H A Dbttv-risc.c263 geo->crop = ((width>>8)&0x03) | ((geo->hdelay>>6)&0x0c) | in bttv_calc_geo_old()
287 const struct v4l2_rect * crop) in bttv_calc_geo() argument
293 if ((crop->left == tvnorm->cropcap.defrect.left in bttv_calc_geo()
294 && crop->top == tvnorm->cropcap.defrect.top in bttv_calc_geo()
295 && crop->width == tvnorm->cropcap.defrect.width in bttv_calc_geo()
296 && crop->height == tvnorm->cropcap.defrect.height in bttv_calc_geo()
306 c_width = min((unsigned int) crop->width, width * 16); in bttv_calc_geo()
307 c_height = min((unsigned int) crop->height, height * 16); in bttv_calc_geo()
312 geo->hdelay = ((crop->left * width + c_width) / c_width) & ~1; in bttv_calc_geo()
315 geo->vdelay = crop->top - tvnorm->cropcap.bounds.top + MIN_VDELAY; in bttv_calc_geo()
[all …]
/linux/drivers/media/platform/mediatek/mdp3/
H A Dmtk-mdp3-regs.c283 int mdp_check_scaling_ratio(const struct v4l2_rect *crop, in mdp_check_scaling_ratio() argument
289 crop_w = crop->width; in mdp_check_scaling_ratio()
290 crop_h = crop->height; in mdp_check_scaling_ratio()
319 r1 = frame->crop.c.width * frame->crop.c.height; in mdp_check_pp_enable()
436 static void mdp_set_src_crop(struct img_crop *c, struct mdp_crop *crop) in mdp_set_src_crop() argument
438 c->left = crop->c.left in mdp_set_src_crop()
439 + mdp_to_fixed(&c->left_subpix, &crop->left_subpix); in mdp_set_src_crop()
440 c->top = crop->c.top in mdp_set_src_crop()
441 + mdp_to_fixed(&c->top_subpix, &crop->top_subpix); in mdp_set_src_crop()
442 c->width = crop->c.width in mdp_set_src_crop()
[all …]
/linux/drivers/media/platform/samsung/exynos-gsc/
H A Dgsc-core.c233 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 …]
/linux/drivers/media/pci/intel/ipu6/
H A Dipu6-isys-subdev.c146 struct v4l2_rect *crop; in ipu6_isys_subdev_set_fmt() local
198 crop = v4l2_subdev_state_get_crop(state, other_pad, other_stream); in ipu6_isys_subdev_set_fmt()
200 crop->left = 0; in ipu6_isys_subdev_set_fmt()
201 crop->top = 0; in ipu6_isys_subdev_set_fmt()
202 crop->width = fmt->width; in ipu6_isys_subdev_set_fmt()
203 crop->height = fmt->height; in ipu6_isys_subdev_set_fmt()
265 struct v4l2_rect *crop) in ipu6_isys_get_stream_pad_crop() argument
270 if (!sd || !crop) in ipu6_isys_get_stream_pad_crop()
276 *crop = *rect; in ipu6_isys_get_stream_pad_crop()
/linux/drivers/media/platform/rockchip/rkisp1/
H A Drkisp1-common.c162 void rkisp1_sd_adjust_crop_rect(struct v4l2_rect *crop, in rkisp1_sd_adjust_crop_rect() argument
165 v4l2_rect_set_min_size(crop, &rkisp1_sd_min_crop); in rkisp1_sd_adjust_crop_rect()
166 v4l2_rect_map_inside(crop, bounds); in rkisp1_sd_adjust_crop_rect()
169 void rkisp1_sd_adjust_crop(struct v4l2_rect *crop, in rkisp1_sd_adjust_crop() argument
179 rkisp1_sd_adjust_crop_rect(crop, &crop_bounds); in rkisp1_sd_adjust_crop()

123456