/Linux-v4.19/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 | 325 struct v4l2_rect *crop = &vout->crop; in omap_vout_calculate_vrfb_offset() local 357 ctop = (pix->height - crop->height) - crop->top; in omap_vout_calculate_vrfb_offset() 358 cleft = (pix->width - crop->width) - crop->left; in omap_vout_calculate_vrfb_offset() 370 temp_ps * cleft + crop->top * temp_ps; in omap_vout_calculate_vrfb_offset() 373 cleft + crop->top * temp_ps + (line_length * in omap_vout_calculate_vrfb_offset() 374 ((crop->width / (vr_ps)) - 1) * ps); in omap_vout_calculate_vrfb_offset() 389 (crop->height - 1) * ps); in omap_vout_calculate_vrfb_offset() 398 temp_ps * crop->left + ctop * ps; in omap_vout_calculate_vrfb_offset() 401 temp_ps * crop->left + ctop * ps + in omap_vout_calculate_vrfb_offset() 402 (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,
|
/Linux-v4.19/drivers/media/platform/sti/delta/ |
D | delta-debug.c | 25 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-v4.19/drivers/staging/media/imx/ |
D | imx-media-csi.c | 84 struct v4l2_rect crop; member 667 struct v4l2_rect crop; in csi_setup() local 685 crop = priv->crop; in csi_setup() 693 crop.width *= incc->cycles; in csi_setup() 696 ipu_csi_set_window(priv->csi, &crop); in csi_setup() 699 priv->crop.width == 2 * priv->compose.width, in csi_setup() 700 priv->crop.height == 2 * priv->compose.height); in csi_setup() 1117 return &priv->crop; in __csi_get_crop() 1132 struct v4l2_rect *crop, in csi_try_crop() argument 1137 crop->width = min_t(__u32, infmt->width, crop->width); in csi_try_crop() [all …]
|
/Linux-v4.19/drivers/media/platform/vsp1/ |
D | vsp1_rpf.c | 250 struct v4l2_rect crop; in rpf_configure_partition() local 260 crop = *vsp1_rwpf_get_crop(rpf, rpf->entity.config); in rpf_configure_partition() 273 crop.width = pipe->partition->rpf.width; in rpf_configure_partition() 274 crop.left += pipe->partition->rpf.left; in rpf_configure_partition() 278 crop.height = round_down(crop.height / 2, fmtinfo->vsub); in rpf_configure_partition() 279 crop.top = round_down(crop.top / 2, fmtinfo->vsub); in rpf_configure_partition() 283 (crop.width << VI6_RPF_SRC_BSIZE_BHSIZE_SHIFT) | in rpf_configure_partition() 284 (crop.height << VI6_RPF_SRC_BSIZE_BVSIZE_SHIFT)); in rpf_configure_partition() 286 (crop.width << VI6_RPF_SRC_ESIZE_EHSIZE_SHIFT) | in rpf_configure_partition() 287 (crop.height << VI6_RPF_SRC_ESIZE_EVSIZE_SHIFT)); in rpf_configure_partition() [all …]
|
D | vsp1_hgt.c | 134 struct v4l2_rect *crop; in hgt_configure_stream() local 141 crop = vsp1_entity_get_pad_selection(entity, entity->config, in hgt_configure_stream() 150 (crop->left << VI6_HGT_OFFSET_HOFFSET_SHIFT) | in hgt_configure_stream() 151 (crop->top << VI6_HGT_OFFSET_VOFFSET_SHIFT)); in hgt_configure_stream() 153 (crop->width << VI6_HGT_SIZE_HSIZE_SHIFT) | in hgt_configure_stream() 154 (crop->height << VI6_HGT_SIZE_VSIZE_SHIFT)); in hgt_configure_stream() 166 hratio = crop->width * 2 / compose->width / 3; in hgt_configure_stream() 167 vratio = crop->height * 2 / compose->height / 3; in hgt_configure_stream()
|
D | vsp1_rwpf.c | 105 struct v4l2_rect *crop; in vsp1_rwpf_set_format() local 108 crop = vsp1_rwpf_get_crop(rwpf, config); in vsp1_rwpf_set_format() 109 crop->left = 0; in vsp1_rwpf_set_format() 110 crop->top = 0; in vsp1_rwpf_set_format() 111 crop->width = fmt->format.width; in vsp1_rwpf_set_format() 112 crop->height = fmt->format.height; in vsp1_rwpf_set_format() 185 struct v4l2_rect *crop; in vsp1_rwpf_set_selection() local 228 crop = vsp1_rwpf_get_crop(rwpf, config); in vsp1_rwpf_set_selection() 229 *crop = sel->r; in vsp1_rwpf_set_selection() 234 format->width = crop->width; in vsp1_rwpf_set_selection() [all …]
|
D | vsp1_hgo.c | 138 struct v4l2_rect *crop; in hgo_configure_stream() local 142 crop = vsp1_entity_get_pad_selection(entity, entity->config, in hgo_configure_stream() 151 (crop->left << VI6_HGO_OFFSET_HOFFSET_SHIFT) | in hgo_configure_stream() 152 (crop->top << VI6_HGO_OFFSET_VOFFSET_SHIFT)); in hgo_configure_stream() 154 (crop->width << VI6_HGO_SIZE_HSIZE_SHIFT) | in hgo_configure_stream() 155 (crop->height << VI6_HGO_SIZE_VSIZE_SHIFT)); in hgo_configure_stream() 163 hratio = crop->width * 2 / compose->width / 3; in hgo_configure_stream() 164 vratio = crop->height * 2 / compose->height / 3; in hgo_configure_stream()
|
D | vsp1_histo.c | 206 struct v4l2_rect *crop; in histo_get_selection() local 223 crop = vsp1_entity_get_pad_selection(&histo->entity, config, in histo_get_selection() 228 sel->r.width = crop->width; in histo_get_selection() 229 sel->r.height = crop->height; in histo_get_selection() 295 struct v4l2_rect *crop; in histo_set_compose() local 306 crop = vsp1_entity_get_pad_selection(&histo->entity, config, sel->pad, in histo_set_compose() 323 sel->r.width = clamp(sel->r.width, crop->width / 4, crop->width); in histo_set_compose() 324 ratio = 1 << (crop->width * 2 / sel->r.width / 3); in histo_set_compose() 325 sel->r.width = crop->width / ratio; in histo_set_compose() 328 sel->r.height = clamp(sel->r.height, crop->height / 4, crop->height); in histo_set_compose() [all …]
|
/Linux-v4.19/Documentation/media/uapi/v4l/ |
D | crop.rst | 15 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 …]
|
D | vidioc-subdev-g-crop.rst | 12 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 69 Drivers must not return an error solely because the requested crop 108 The crop rectangle can't be changed because the pad is currently
|
/Linux-v4.19/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 …]
|
/Linux-v4.19/drivers/media/platform/mtk-mdp/ |
D | mtk_mdp_regs.c | 82 config->crop_x = frame->crop.left; in mtk_mdp_hw_set_in_size() 83 config->crop_y = frame->crop.top; in mtk_mdp_hw_set_in_size() 86 config->crop_w = frame->crop.width; in mtk_mdp_hw_set_in_size() 87 config->crop_h = frame->crop.height; in mtk_mdp_hw_set_in_size() 117 config->crop_x = frame->crop.left; in mtk_mdp_hw_set_out_size() 118 config->crop_y = frame->crop.top; in mtk_mdp_hw_set_out_size() 119 config->crop_w = frame->crop.width; in mtk_mdp_hw_set_out_size() 120 config->crop_h = frame->crop.height; in mtk_mdp_hw_set_out_size()
|
/Linux-v4.19/drivers/media/v4l2-core/ |
D | v4l2-subdev.c | 141 static int check_crop(struct v4l2_subdev *sd, struct v4l2_subdev_crop *crop) in check_crop() argument 143 if (crop->which != V4L2_SUBDEV_FORMAT_TRY && in check_crop() 144 crop->which != V4L2_SUBDEV_FORMAT_ACTIVE) in check_crop() 147 if (crop->pad >= sd->entity.num_pads) in check_crop() 318 struct v4l2_subdev_crop *crop = arg; in subdev_do_ioctl() local 321 rval = check_crop(sd, crop); in subdev_do_ioctl() 325 memset(crop->reserved, 0, sizeof(crop->reserved)); in subdev_do_ioctl() 327 sel.which = crop->which; in subdev_do_ioctl() 328 sel.pad = crop->pad; in subdev_do_ioctl() 334 crop->rect = sel.r; in subdev_do_ioctl() [all …]
|
/Linux-v4.19/drivers/media/platform/exynos-gsc/ |
D | gsc-core.c | 259 frame->crop.width = width; in gsc_set_frame_size() 260 frame->crop.height = height; in gsc_set_frame_size() 261 frame->crop.left = 0; in gsc_set_frame_size() 262 frame->crop.top = 0; in gsc_set_frame_size() 317 remainder = s_frame->crop.width % (*wratio * walign); in gsc_check_src_scale_info() 319 s_frame->crop.width -= remainder; in gsc_check_src_scale_info() 320 gsc_cal_prescaler_ratio(var, s_frame->crop.width, tx, wratio); in gsc_check_src_scale_info() 322 s_frame->crop.width + remainder, s_frame->crop.width); in gsc_check_src_scale_info() 325 remainder = s_frame->crop.height % (*hratio * halign); in gsc_check_src_scale_info() 327 s_frame->crop.height -= remainder; in gsc_check_src_scale_info() [all …]
|
/Linux-v4.19/drivers/media/i2c/ |
D | mt9m032.c | 158 struct v4l2_rect crop; member 191 struct v4l2_rect *crop = &sensor->crop; in mt9m032_update_timing() local 199 row_time = mt9m032_row_time(sensor, crop->width); in mt9m032_update_timing() 203 - crop->height; in mt9m032_update_timing() 209 div_u64((crop->height + MT9M032_VBLANK_MAX) * in mt9m032_update_timing() 214 - crop->height; in mt9m032_update_timing() 229 sensor->crop.width - 1); in mt9m032_update_geom_timing() 232 sensor->crop.height - 1); in mt9m032_update_geom_timing() 235 sensor->crop.left); in mt9m032_update_geom_timing() 238 sensor->crop.top); in mt9m032_update_geom_timing() [all …]
|
D | mt9t001.c | 129 struct v4l2_rect crop; member 279 return &mt9t001->crop; in __mt9t001_get_pad_crop() 292 struct v4l2_rect *crop = &mt9t001->crop; in mt9t001_s_stream() local 309 hratio = DIV_ROUND_CLOSEST(crop->width, format->width); in mt9t001_s_stream() 310 vratio = DIV_ROUND_CLOSEST(crop->height, format->height); in mt9t001_s_stream() 320 ret = mt9t001_write(client, MT9T001_COLUMN_START, crop->left); in mt9t001_s_stream() 324 ret = mt9t001_write(client, MT9T001_ROW_START, crop->top); in mt9t001_s_stream() 328 ret = mt9t001_write(client, MT9T001_WINDOW_WIDTH, crop->width - 1); in mt9t001_s_stream() 332 ret = mt9t001_write(client, MT9T001_WINDOW_HEIGHT, crop->height - 1); in mt9t001_s_stream() 802 struct v4l2_rect *crop; in mt9t001_open() local [all …]
|
D | mt9p031.c | 125 struct v4l2_rect crop; /* Sensor window */ member 387 const struct v4l2_rect *crop = &mt9p031->crop; in mt9p031_set_params() local 402 ret = mt9p031_write(client, MT9P031_COLUMN_START, crop->left); in mt9p031_set_params() 405 ret = mt9p031_write(client, MT9P031_ROW_START, crop->top); in mt9p031_set_params() 408 ret = mt9p031_write(client, MT9P031_WINDOW_WIDTH, crop->width - 1); in mt9p031_set_params() 411 ret = mt9p031_write(client, MT9P031_WINDOW_HEIGHT, crop->height - 1); in mt9p031_set_params() 418 xskip = DIV_ROUND_CLOSEST(crop->width, format->width); in mt9p031_set_params() 419 yskip = DIV_ROUND_CLOSEST(crop->height, format->height); in mt9p031_set_params() 529 return &mt9p031->crop; in __mt9p031_get_pad_crop() 947 struct v4l2_rect *crop; in mt9p031_open() local [all …]
|
D | mt9v032.c | 192 struct v4l2_rect crop; member 251 struct v4l2_rect *crop = &mt9v032->crop; in mt9v032_update_hblank() local 257 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() 920 struct v4l2_rect *crop; in mt9v032_open() local [all …]
|
/Linux-v4.19/drivers/media/platform/rcar-vin/ |
D | rcar-v4l2.c | 160 vin->crop = vin->source; in rvin_reset_format() 168 struct v4l2_rect *crop, struct v4l2_rect *compose) in rvin_try_format() argument 202 if (crop) { in rvin_try_format() 203 crop->top = 0; in rvin_try_format() 204 crop->left = 0; in rvin_try_format() 205 crop->width = pix->width; in rvin_try_format() 206 crop->height = pix->height; in rvin_try_format() 213 crop->height *= 2; in rvin_try_format() 261 struct v4l2_rect crop, compose; in rvin_s_fmt_vid_cap() local 268 &crop, &compose); in rvin_s_fmt_vid_cap() [all …]
|
D | rcar-dma.c | 533 if (vin->crop.height != vin->compose.height) in rvin_crop_scale_comp_gen2() 534 ys = (4096 * vin->crop.height) / vin->compose.height; in rvin_crop_scale_comp_gen2() 538 if (vin->crop.width != vin->compose.width) in rvin_crop_scale_comp_gen2() 539 xs = (4096 * vin->crop.width) / vin->compose.width; in rvin_crop_scale_comp_gen2() 570 vin->crop.width, vin->crop.height, vin->crop.left, in rvin_crop_scale_comp_gen2() 571 vin->crop.top, ys, xs, vin->format.width, vin->format.height, in rvin_crop_scale_comp_gen2() 578 rvin_write(vin, vin->crop.left, VNSPPRC_REG); in rvin_crop_scale_comp() 579 rvin_write(vin, vin->crop.left + vin->crop.width - 1, VNEPPRC_REG); in rvin_crop_scale_comp() 585 rvin_write(vin, vin->crop.top / 2, VNSLPRC_REG); in rvin_crop_scale_comp() 586 rvin_write(vin, (vin->crop.top + vin->crop.height) / 2 - 1, in rvin_crop_scale_comp() [all …]
|
/Linux-v4.19/drivers/media/pci/bt8xx/ |
D | bttv-risc.c | 364 geo->crop = ((width>>8)&0x03) | ((geo->hdelay>>6)&0x0c) | in bttv_calc_geo_old() 388 const struct v4l2_rect * crop) in bttv_calc_geo() argument 394 if ((crop->left == tvnorm->cropcap.defrect.left in bttv_calc_geo() 395 && crop->top == tvnorm->cropcap.defrect.top in bttv_calc_geo() 396 && crop->width == tvnorm->cropcap.defrect.width in bttv_calc_geo() 397 && crop->height == tvnorm->cropcap.defrect.height in bttv_calc_geo() 407 c_width = min((unsigned int) crop->width, width * 16); in bttv_calc_geo() 408 c_height = min((unsigned int) crop->height, height * 16); in bttv_calc_geo() 413 geo->hdelay = ((crop->left * width + c_width) / c_width) & ~1; in bttv_calc_geo() 416 geo->vdelay = crop->top - tvnorm->cropcap.bounds.top + MIN_VDELAY; in bttv_calc_geo() [all …]
|
/Linux-v4.19/Documentation/media/v4l-drivers/ |
D | sh_mobile_ceu_camera.rst | 74 2. Calculate "effective" input crop (sensor subwindow) - CEU crop scaled back at 99 8. Calculate new CEU crop - apply sensor scales to previously calculated 100 "effective" crop: 105 9. Use CEU cropping to crop to the new window: 130 to 2 : 2', target crop 5 : 5', current output format 6' - 6. 140 6. Calculate and apply host crop: 6 - 7 = (5 - 2) * (6' - 6) / (5' - 5)
|
/Linux-v4.19/drivers/media/platform/vivid/ |
D | vivid-vid-out.c | 430 struct v4l2_rect *crop = &dev->crop_out; in vivid_s_fmt_vid_out() local 467 v4l2_rect_map_inside(crop, &r); in vivid_s_fmt_vid_out() 469 *crop = r; in vivid_s_fmt_vid_out() 488 crop->width / MAX_ZOOM, in vivid_s_fmt_vid_out() 489 factor * crop->height / MAX_ZOOM in vivid_s_fmt_vid_out() 493 crop->width * MAX_ZOOM, in vivid_s_fmt_vid_out() 494 factor * crop->height * MAX_ZOOM in vivid_s_fmt_vid_out() 502 v4l2_rect_set_size_to(crop, &r); in vivid_s_fmt_vid_out() 507 v4l2_rect_map_inside(crop, &r); in vivid_s_fmt_vid_out() 514 crop->top *= factor; in vivid_s_fmt_vid_out() [all …]
|