Lines Matching refs:cr
400 struct v4l2_cropcap *cr) in fimc_m2m_cropcap() argument
405 frame = ctx_get_frame(ctx, cr->type); in fimc_m2m_cropcap()
409 cr->bounds.left = 0; in fimc_m2m_cropcap()
410 cr->bounds.top = 0; in fimc_m2m_cropcap()
411 cr->bounds.width = frame->o_width; in fimc_m2m_cropcap()
412 cr->bounds.height = frame->o_height; in fimc_m2m_cropcap()
413 cr->defrect = cr->bounds; in fimc_m2m_cropcap()
418 static int fimc_m2m_g_crop(struct file *file, void *fh, struct v4l2_crop *cr) in fimc_m2m_g_crop() argument
423 frame = ctx_get_frame(ctx, cr->type); in fimc_m2m_g_crop()
427 cr->c.left = frame->offs_h; in fimc_m2m_g_crop()
428 cr->c.top = frame->offs_v; in fimc_m2m_g_crop()
429 cr->c.width = frame->width; in fimc_m2m_g_crop()
430 cr->c.height = frame->height; in fimc_m2m_g_crop()
435 static int fimc_m2m_try_crop(struct fimc_ctx *ctx, struct v4l2_crop *cr) in fimc_m2m_try_crop() argument
442 if (cr->c.top < 0 || cr->c.left < 0) { in fimc_m2m_try_crop()
447 if (cr->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) in fimc_m2m_try_crop()
449 else if (cr->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) in fimc_m2m_try_crop()
466 v4l_bound_align_image(&cr->c.width, min_size, f->o_width, in fimc_m2m_try_crop()
468 &cr->c.height, min_size, f->o_height, in fimc_m2m_try_crop()
472 if (cr->c.left + cr->c.width > f->o_width) in fimc_m2m_try_crop()
473 cr->c.left = f->o_width - cr->c.width; in fimc_m2m_try_crop()
474 if (cr->c.top + cr->c.height > f->o_height) in fimc_m2m_try_crop()
475 cr->c.top = f->o_height - cr->c.height; in fimc_m2m_try_crop()
477 cr->c.left = round_down(cr->c.left, min_size); in fimc_m2m_try_crop()
478 cr->c.top = round_down(cr->c.top, fimc->variant->hor_offs_align); in fimc_m2m_try_crop()
481 cr->c.left, cr->c.top, cr->c.width, cr->c.height, in fimc_m2m_try_crop()
491 struct v4l2_crop cr = *crop; in fimc_m2m_s_crop() local
495 ret = fimc_m2m_try_crop(ctx, &cr); in fimc_m2m_s_crop()
499 f = (cr.type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) ? in fimc_m2m_s_crop()
503 if (cr.type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { in fimc_m2m_s_crop()
504 ret = fimc_check_scaler_ratio(ctx, cr.c.width, in fimc_m2m_s_crop()
505 cr.c.height, ctx->d_frame.width, in fimc_m2m_s_crop()
509 ctx->s_frame.height, cr.c.width, in fimc_m2m_s_crop()
510 cr.c.height, ctx->rotation); in fimc_m2m_s_crop()
517 f->offs_h = cr.c.left; in fimc_m2m_s_crop()
518 f->offs_v = cr.c.top; in fimc_m2m_s_crop()
519 f->width = cr.c.width; in fimc_m2m_s_crop()
520 f->height = cr.c.height; in fimc_m2m_s_crop()