| /linux/drivers/media/platform/ti/omap/ |
| H A 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() 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 D | omap_vout_vrfb.c | 322 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 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,
|
| /linux/Documentation/userspace-api/media/drivers/ |
| H A D | ccs.rst | 24 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 D | crop.rst | 16 equivalent in the SELECTION API. See :ref:`selection-vs-crop` for a 65 .. kernel-figure:: crop.svg 66 :alt: crop.svg 171 struct v4l2_crop crop; 181 memset (&crop, 0, sizeof (crop)); 182 crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 183 crop.c = cropcap.defrect; 187 if (-1 == ioctl (fd, VIDIOC_S_CROP, &crop) 230 struct v4l2_crop crop; 240 memset (&crop, 0, sizeof (crop)); [all …]
|
| H A D | vidioc-subdev-g-crop.rst | 13 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
|
| H A D | selection-api-examples.rst | 70 struct v4l2_selection crop = { 79 ret = ioctl(fd, VIDIOC_G_SELECTION, &crop); 84 hscale = (double)compose.r.width / crop.r.width; 85 vscale = (double)compose.r.height / crop.r.height;
|
| H A D | v4l2-selection-targets.rst | 47 - Bounds of the crop rectangle. All valid crop rectangles fit inside 48 the crop bounds rectangle.
|
| /linux/drivers/media/platform/ti/omap3isp/ |
| H A D | ispresizer.c | 141 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 …]
|
| H A D | isppreview.c | 1066 unsigned int sph = prev->crop.left; in preview_config_input_size() 1067 unsigned int eph = prev->crop.left + prev->crop.width - 1; in preview_config_input_size() 1068 unsigned int slv = prev->crop.top; in preview_config_input_size() 1069 unsigned int elv = prev->crop.top + prev->crop.height - 1; in preview_config_input_size() 1700 return &prev->crop; in __preview_get_crop() 1740 struct v4l2_rect *crop; in preview_try_format() local 1795 crop = __preview_get_crop(prev, sd_state, which); in preview_try_format() 1796 fmt->width = crop->width; in preview_try_format() 1797 fmt->height = crop->height; in preview_try_format() 1820 struct v4l2_rect *crop) in preview_try_crop() argument [all …]
|
| /linux/drivers/media/platform/renesas/vsp1/ |
| H A D | vsp1_hgt.c | 136 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 D | vsp1_hgo.c | 140 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()
|
| H A D | vsp1_uif.c | 197 const struct v4l2_rect *crop; in uif_configure_stream() local 204 crop = v4l2_subdev_state_get_crop(state, UIF_PAD_SINK); in uif_configure_stream() 206 left = crop->left; in uif_configure_stream() 207 width = crop->width; in uif_configure_stream() 216 vsp1_uif_write(uif, dlb, VI6_UIF_DISCOM_DOCMSPYR, crop->top); in uif_configure_stream() 218 vsp1_uif_write(uif, dlb, VI6_UIF_DISCOM_DOCMSZYR, crop->height); in uif_configure_stream()
|
| /linux/drivers/media/platform/mediatek/mdp/ |
| H A D | mtk_mdp_regs.c | 74 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/Documentation/driver-api/media/drivers/ |
| H A D | sh_mobile_ceu_camera.rst | 76 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 D | bttv-risc.c | 263 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/samsung/exynos-gsc/ |
| H A 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 …]
|
| H A D | gsc-regs.c | 127 cfg = GSC_SRCIMG_OFFSET_X(frame->crop.left); in gsc_hw_set_in_size() 128 cfg |= GSC_SRCIMG_OFFSET_Y(frame->crop.top); in gsc_hw_set_in_size() 137 cfg = GSC_CROPPED_WIDTH(frame->crop.width); in gsc_hw_set_in_size() 138 cfg |= GSC_CROPPED_HEIGHT(frame->crop.height); in gsc_hw_set_in_size() 241 cfg = GSC_DSTIMG_OFFSET_X(frame->crop.left); in gsc_hw_set_out_size() 242 cfg |= GSC_DSTIMG_OFFSET_Y(frame->crop.top); in gsc_hw_set_out_size() 253 cfg = GSC_SCALED_WIDTH(frame->crop.height); in gsc_hw_set_out_size() 254 cfg |= GSC_SCALED_HEIGHT(frame->crop.width); in gsc_hw_set_out_size() 256 cfg = GSC_SCALED_WIDTH(frame->crop.width); in gsc_hw_set_out_size() 257 cfg |= GSC_SCALED_HEIGHT(frame->crop.height); in gsc_hw_set_out_size()
|
| /linux/drivers/staging/media/starfive/camss/ |
| H A D | stf-isp-hw-ops.c | 346 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/rockchip/rkisp1/ |
| H A D | rkisp1-common.c | 162 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()
|
| /linux/drivers/media/test-drivers/vimc/ |
| H A D | vimc-scaler.c | 189 struct v4l2_rect *crop; in vimc_scaler_set_fmt() local 191 crop = v4l2_subdev_state_get_crop(sd_state, VIMC_SCALER_SINK); in vimc_scaler_set_fmt() 192 crop->width = fmt->width; in vimc_scaler_set_fmt() 193 crop->height = fmt->height; in vimc_scaler_set_fmt() 194 crop->top = 0; in vimc_scaler_set_fmt() 195 crop->left = 0; in vimc_scaler_set_fmt()
|
| /linux/drivers/media/platform/st/sti/bdisp/ |
| H A D | bdisp-hw.c | 632 src_w = ctx->src.crop.width; in bdisp_hw_get_hv_inc() 633 src_h = ctx->src.crop.height; in bdisp_hw_get_hv_inc() 634 dst_w = ctx->dst.crop.width; in bdisp_hw_get_hv_inc() 635 dst_h = ctx->dst.crop.height; in bdisp_hw_get_hv_inc() 765 struct v4l2_rect src_rect = src->crop; in bdisp_hw_build_node() 766 struct v4l2_rect dst_rect = dst->crop; in bdisp_hw_build_node() 768 s32 dst_width = dst->crop.width; in bdisp_hw_build_node() 781 dst_x_offset = (src_x_offset * dst_width) / ctx->src.crop.width; in bdisp_hw_build_node() 783 dst_rect.width = (src_rect.width * dst_width) / ctx->src.crop.width; in bdisp_hw_build_node() 1028 if (src_x_offset >= ctx->src.crop.width) in bdisp_hw_build_all_nodes()
|
| /linux/drivers/media/i2c/ |
| H A D | alvium-csi2.c | 1749 struct v4l2_rect *crop; in alvium_set_mode() local 1752 crop = v4l2_subdev_state_get_crop(state, 0); in alvium_set_mode() 1761 crop->left = clamp((u32)max(0, crop->left), alvium->min_offx, in alvium_set_mode() 1763 crop->top = clamp((u32)max(0, crop->top), alvium->min_offy, in alvium_set_mode() 1774 ret = alvium_set_img_offx(alvium, crop->left); in alvium_set_mode() 1778 ret = alvium_set_img_offy(alvium, crop->top); in alvium_set_mode() 1871 .left = mode->crop.left, in alvium_init_state() 1872 .top = mode->crop.top, in alvium_init_state() 1873 .width = mode->crop.width, in alvium_init_state() 1874 .height = mode->crop.height, in alvium_init_state() [all …]
|
| /linux/drivers/media/platform/samsung/s3c-camif/ |
| H A D | camif-regs.c | 131 struct v4l2_rect *crop = &camif->camif_crop; in camif_hw_set_camera_crop() local 138 cfg |= (crop->left << 16) | crop->top; in camif_hw_set_camera_crop() 139 if (crop->left != 0 || crop->top != 0) in camif_hw_set_camera_crop() 144 hoff2 = mf->width - crop->width - crop->left; in camif_hw_set_camera_crop() 145 voff2 = mf->height - crop->height - crop->top; in camif_hw_set_camera_crop()
|
| /linux/drivers/media/test-drivers/vivid/ |
| H A D | vivid-vid-cap.c | 670 struct v4l2_rect *crop = &dev->crop_cap; in vivid_s_fmt_vid_cap() local 713 v4l2_rect_set_min_size(crop, &min_r); in vivid_s_fmt_vid_cap() 714 v4l2_rect_set_max_size(crop, &max_r); in vivid_s_fmt_vid_cap() 715 v4l2_rect_map_inside(crop, &dev->crop_bounds_cap); in vivid_s_fmt_vid_cap() 728 v4l2_rect_set_min_size(crop, &min_r); in vivid_s_fmt_vid_cap() 729 v4l2_rect_set_max_size(crop, &max_r); in vivid_s_fmt_vid_cap() 730 v4l2_rect_map_inside(crop, &dev->crop_bounds_cap); in vivid_s_fmt_vid_cap() 734 v4l2_rect_set_size_to(crop, &r); in vivid_s_fmt_vid_cap() 735 v4l2_rect_map_inside(crop, &dev->crop_bounds_cap); in vivid_s_fmt_vid_cap() 736 r = *crop; in vivid_s_fmt_vid_cap() [all …]
|