Home
last modified time | relevance | path

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

12345

/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/media/platform/st/stm32/stm32-dcmipp/
H A Ddcmipp-byteproc.c271 struct v4l2_rect *crop, *compose; in dcmipp_byteproc_set_fmt() local
278 crop = v4l2_subdev_state_get_crop(sd_state, 1); in dcmipp_byteproc_set_fmt()
283 fmt->format.width = crop->width; in dcmipp_byteproc_set_fmt()
284 fmt->format.height = crop->height; in dcmipp_byteproc_set_fmt()
287 crop->top = 0; in dcmipp_byteproc_set_fmt()
288 crop->left = 0; in dcmipp_byteproc_set_fmt()
289 crop->width = fmt->format.width; in dcmipp_byteproc_set_fmt()
290 crop->height = fmt->format.height; in dcmipp_byteproc_set_fmt()
291 *compose = *crop; in dcmipp_byteproc_set_fmt()
305 struct v4l2_rect *crop, *compose; in dcmipp_byteproc_get_selection() local
[all …]
/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.rst16 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 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
H A Dselection-api-examples.rst70 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/renesas/vsp1/
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()
H A Dvsp1_uif.c197 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/amlogic/meson-ge2d/
H A Dge2d.c64 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.height - 1)); in ge2d_hw_start()
231 FIELD_PREP(GE2D_START, ctx->out.crop.left) | in ge2d_hw_start()
232 FIELD_PREP(GE2D_END, ctx->out.crop.left + ctx->out.crop.width - 1)); in ge2d_hw_start()
234 FIELD_PREP(GE2D_START, ctx->out.crop.top) | in ge2d_hw_start()
[all …]
/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/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/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 …]
H A Dgsc-regs.c127 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 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/qcom/iris/
H A Diris_venc.c63 inst->crop.left = 0; in iris_venc_inst_init()
64 inst->crop.top = 0; in iris_venc_inst_init()
65 inst->crop.width = DEFAULT_WIDTH; in iris_venc_inst_init()
66 inst->crop.height = DEFAULT_HEIGHT; in iris_venc_inst_init()
317 if (f->fmt.pix_mp.width != inst->crop.width || in iris_venc_s_fmt_input()
318 f->fmt.pix_mp.height != inst->crop.height) { in iris_venc_s_fmt_input()
319 inst->crop.top = 0; in iris_venc_s_fmt_input()
320 inst->crop.left = 0; in iris_venc_s_fmt_input()
321 inst->crop.width = fmt->fmt.pix_mp.width; in iris_venc_s_fmt_input()
322 inst->crop.height = fmt->fmt.pix_mp.height; in iris_venc_s_fmt_input()
[all …]
/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()
/linux/drivers/media/platform/ti/omap3isp/
H A Dispccdc.c1119 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()
1959 return &ccdc->crop; in __ccdc_get_crop()
[all …]
/linux/drivers/media/platform/amphion/
H A Dvenc.c239 venc->params.crop.left = 0; in venc_s_fmt()
240 venc->params.crop.top = 0; in venc_s_fmt()
241 venc->params.crop.width = cur_fmt->width; in venc_s_fmt()
242 venc->params.crop.height = cur_fmt->height; in venc_s_fmt()
344 s->r = venc->params.crop; in venc_g_selection()
361 rect = &venc->params.crop; in venc_valid_crop()
396 venc->params.crop.left = ALIGN(s->r.left, res->step_width); in venc_s_selection()
397 venc->params.crop.top = ALIGN(s->r.top, res->step_height); in venc_s_selection()
398 venc->params.crop.width = ALIGN(s->r.width, res->step_width); in venc_s_selection()
399 venc->params.crop.height = ALIGN(s->r.height, res->step_height); in venc_s_selection()
[all …]
/linux/drivers/media/platform/st/sti/bdisp/
H A Dbdisp-hw.c632 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/test-drivers/vimc/
H A Dvimc-scaler.c189 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/imagination/
H A De5010-jpeg-enc.c421 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()
556 ctx, queue->crop.width, queue->crop.height, queue->crop.left, queue->crop.top); in e5010_s_selection()
687 queue->crop.left = 0; in e5010_jpeg_set_default_params()
688 queue->crop.top = 0; in e5010_jpeg_set_default_params()
689 queue->crop.width = queue->width; in e5010_jpeg_set_default_params()
[all …]

12345