| /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/drivers/media/platform/st/stm32/stm32-dcmipp/ |
| H A D | dcmipp-byteproc.c | 273 struct v4l2_rect *crop, *compose; in dcmipp_byteproc_set_fmt() 280 crop = v4l2_subdev_state_get_crop(sd_state, 1); in dcmipp_byteproc_set_fmt() 285 fmt->format.width = crop->width; in dcmipp_byteproc_set_fmt() 286 fmt->format.height = crop->height; in dcmipp_byteproc_set_fmt() 289 crop->top = 0; in dcmipp_byteproc_set_fmt() 290 crop->left = 0; in dcmipp_byteproc_set_fmt() 291 crop->width = fmt->format.width; in dcmipp_byteproc_set_fmt() 292 crop->height = fmt->format.height; in dcmipp_byteproc_set_fmt() 293 *compose = *crop; in dcmipp_byteproc_set_fmt() 308 struct v4l2_rect *crop, *compos in dcmipp_byteproc_get_selection() 271 struct v4l2_rect *crop, *compose; dcmipp_byteproc_set_fmt() local 305 struct v4l2_rect *crop, *compose; dcmipp_byteproc_get_selection() local 359 struct v4l2_rect *crop, *compose; dcmipp_byteproc_set_selection() local 419 struct v4l2_rect *compose, *crop; dcmipp_byteproc_configure_scale_crop() local [all...] |
| /linux/drivers/media/i2c/ |
| H A D | mt9m114.c | 334 * Set the default to achieve full resolution (1296x976 analog crop 804 const struct v4l2_rect *crop; in mt9m114_configure_pa() local 810 crop = v4l2_subdev_state_get_crop(state, 0); in mt9m114_configure_pa() 817 hratio = crop->width / format->width; in mt9m114_configure_pa() 818 vratio = crop->height / format->height; in mt9m114_configure_pa() 821 * Pixel array crop and binning. The CAM_SENSOR_CFG_CPIPE_LAST_ROW in mt9m114_configure_pa() 827 crop->left, &ret); in mt9m114_configure_pa() 829 crop->top, &ret); in mt9m114_configure_pa() 831 crop->width + crop in mt9m114_configure_pa() 868 const struct v4l2_rect *crop; mt9m114_configure_ifp() local 1202 struct v4l2_rect *crop; mt9m114_pa_init_state() local 1262 struct v4l2_rect *crop; mt9m114_pa_set_fmt() local 1312 struct v4l2_rect *crop; mt9m114_pa_set_selection() local 1703 struct v4l2_rect *crop; mt9m114_ifp_init_state() local 1810 const struct v4l2_rect *crop; mt9m114_ifp_enum_framesizes() local 1851 struct v4l2_rect *crop; mt9m114_ifp_update_sel_and_src_fmt() local 1930 const struct v4l2_rect *crop; mt9m114_ifp_get_selection() local 1989 struct v4l2_rect *crop; mt9m114_ifp_set_selection() local [all...] |
| H A D | t4ka3.c | 90 /* Always 3279 (T4KA3_NATIVE_WIDTH - 1, window is used to crop */ 92 /* Always 2463 (T4KA3_NATIVE_HEIGHT - 1, window is used to crop */ 97 /* Window/crop start + size *after* binning */ 325 struct v4l2_rect *crop) in t4ka3_calc_mode() argument 334 if (width <= (crop->width / 2) && height <= (crop->height / 2)) in t4ka3_calc_mode() 343 sensor->mode.win_x = (crop->left + (crop->width - width) / 2) & ~1; in t4ka3_calc_mode() 344 sensor->mode.win_y = (crop->top + (crop in t4ka3_calc_mode() 371 struct v4l2_rect *crop = t4ka3_set_pad_format() local 659 struct v4l2_rect *crop; t4ka3_set_selection() local 715 struct v4l2_rect *crop; t4ka3_enum_frame_size() local 820 struct v4l2_rect *crop; t4ka3_init_controls() local [all...] |
| H A D | ov2680.c | 136 struct v4l2_rect crop; member 324 return &sensor->mode.crop; in __ov2680_get_pad_crop() 346 if (width <= (sensor->mode.crop.width / 2) && in ov2680_calc_mode() 347 height <= (sensor->mode.crop.height / 2)) { in ov2680_calc_mode() 355 sensor->mode.h_start = (sensor->mode.crop.left + in ov2680_calc_mode() 356 (sensor->mode.crop.width - width) / 2) & ~1; in ov2680_calc_mode() 357 sensor->mode.v_start = (sensor->mode.crop.top + in ov2680_calc_mode() 358 (sensor->mode.crop.height - height) / 2) & ~1; in ov2680_calc_mode() 648 const struct v4l2_rect *crop; in ov2680_set_fmt() 652 crop in ov2680_set_fmt() 647 const struct v4l2_rect *crop; ov2680_set_fmt() local 741 struct v4l2_rect *crop; ov2680_set_selection() local 806 struct v4l2_rect *crop; ov2680_enum_frame_size() local [all...] |
| H A D | mt9v032.c | 197 struct v4l2_rect crop; member 256 struct v4l2_rect *crop = &mt9v032->crop; in mt9v032_update_hblank() local 262 min_hblank = max_t(int, mt9v032->model->data->min_row_time - crop->width, in mt9v032_update_hblank() 383 return &mt9v032->crop; in __mt9v032_get_pad_crop() 394 struct v4l2_rect *crop = &mt9v032->crop; in mt9v032_s_stream() local 413 ret = regmap_write(map, MT9V032_COLUMN_START, crop->left); in mt9v032_s_stream() 417 ret = regmap_write(map, MT9V032_ROW_START, crop->top); in mt9v032_s_stream() 421 ret = regmap_write(map, MT9V032_WINDOW_WIDTH, crop in mt9v032_s_stream() 936 struct v4l2_rect *crop; mt9v032_open() local [all...] |
| H A D | mt9p031.c | 120 struct v4l2_rect crop; /* Sensor window */ member 401 const struct v4l2_rect *crop = &mt9p031->crop; in mt9p031_set_params() local 416 ret = mt9p031_write(client, MT9P031_COLUMN_START, crop->left); in mt9p031_set_params() 419 ret = mt9p031_write(client, MT9P031_ROW_START, crop->top); in mt9p031_set_params() 422 ret = mt9p031_write(client, MT9P031_WINDOW_WIDTH, crop->width - 1); in mt9p031_set_params() 425 ret = mt9p031_write(client, MT9P031_WINDOW_HEIGHT, crop->height - 1); in mt9p031_set_params() 432 xskip = DIV_ROUND_CLOSEST(crop->width, format->width); in mt9p031_set_params() 433 yskip = DIV_ROUND_CLOSEST(crop->height, format->height); in mt9p031_set_params() 565 return &mt9p031->crop; in __mt9p031_get_pad_crop() 700 struct v4l2_rect *crop; mt9p031_init_state() local [all...] |
| H A D | ov5640.c | 377 /* Analog crop rectangle. */ 379 /* Visible crop: from analog crop top-left corner. */ 380 struct v4l2_rect crop; member 707 .crop = { 725 .crop = { 752 .crop = { 770 .crop = { 797 .crop = { 815 .crop 1652 const struct v4l2_rect *crop; ov5640_set_timings() local 3766 struct v4l2_rect *crop = v4l2_subdev_state_get_crop(state, 0); ov5640_init_state() local [all...] |
| /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;
|
| /linux/drivers/media/platform/amlogic/meson-ge2d/ |
| H A D | ge2d.c | 64 struct v4l2_rect crop; member 222 FIELD_PREP(GE2D_START, ctx->in.crop.top) | in ge2d_hw_start() 223 FIELD_PREP(GE2D_END, ctx->in.crop.top + ctx->in.crop.height - 1)); in ge2d_hw_start() 225 FIELD_PREP(GE2D_START, ctx->in.crop.left) | in ge2d_hw_start() 226 FIELD_PREP(GE2D_END, ctx->in.crop.left + ctx->in.crop.width - 1)); in ge2d_hw_start() 228 FIELD_PREP(GE2D_START, ctx->out.crop.top) | in ge2d_hw_start() 229 FIELD_PREP(GE2D_END, ctx->out.crop.top + ctx->out.crop in ge2d_hw_start() [all...] |
| /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 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/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/platform/ti/omap3isp/ |
| H A D | ispccdc.c | 1119 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 in ccdc_configure() 1979 struct v4l2_rect *crop; ccdc_try_format() local 2085 ccdc_try_crop(struct isp_ccdc_device * ccdc,const struct v4l2_mbus_framefmt * sink,struct v4l2_rect * crop) ccdc_try_crop() argument 2354 struct v4l2_rect *crop; ccdc_set_format() local [all...] |
| /linux/drivers/media/test-drivers/vimc/ |
| H A D | vimc-scaler.c | 70 /* Get the crop bounds to clamp the crop rectangle correctly */ in vimc_scaler_get_crop_bound_sink() 185 * Propagate the sink pad format to the crop rectangle and the source in vimc_scaler_set_fmt() 190 struct v4l2_rect *crop; in vimc_scaler_set_fmt() 192 crop = v4l2_subdev_state_get_crop(sd_state, VIMC_SCALER_SINK); in vimc_scaler_set_fmt() 193 crop->width = fmt->width; in vimc_scaler_set_fmt() 194 crop->height = fmt->height; in vimc_scaler_set_fmt() 195 crop->top = 0; in vimc_scaler_set_fmt() 196 crop->left = 0; in vimc_scaler_set_fmt() 252 /* Only support setting the crop o in vimc_scaler_set_selection() 189 struct v4l2_rect *crop; vimc_scaler_set_fmt() local [all...] |
| /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 in bdisp_hw_build_all_nodes() [all...] |
| /linux/drivers/media/platform/imagination/ |
| H A D | e5010-jpeg-enc.c | 421 queue->crop.left = 0; in e5010_s_fmt() 422 queue->crop.top = 0; in e5010_s_fmt() 423 queue->crop.width = queue->width; in e5010_s_fmt() 424 queue->crop.height = queue->height; in e5010_s_fmt() 480 memcpy(&s->r, &queue->crop, sizeof(s->r)); in e5010_g_selection() 550 memcpy(&queue->crop, &s->r, sizeof(s->r)); in e5010_s_selection() 555 dprintk(ctx->e5010, 2, "ctx: 0x%p: crop rectangle: w: %d, h : %d, l : %d, t : %d\n", in e5010_s_selection() 556 ctx, queue->crop.width, queue->crop.height, queue->crop in e5010_s_selection() [all...] |