diff options
Diffstat (limited to 'drivers/media/platform/s5p-fimc/fimc-m2m.c')
| -rw-r--r-- | drivers/media/platform/s5p-fimc/fimc-m2m.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/media/platform/s5p-fimc/fimc-m2m.c b/drivers/media/platform/s5p-fimc/fimc-m2m.c index 6b71d953fd15..4500e44f6857 100644 --- a/drivers/media/platform/s5p-fimc/fimc-m2m.c +++ b/drivers/media/platform/s5p-fimc/fimc-m2m.c | |||
| @@ -551,30 +551,31 @@ static int fimc_m2m_try_crop(struct fimc_ctx *ctx, struct v4l2_crop *cr) | |||
| 551 | return 0; | 551 | return 0; |
| 552 | } | 552 | } |
| 553 | 553 | ||
| 554 | static int fimc_m2m_s_crop(struct file *file, void *fh, const struct v4l2_crop *cr) | 554 | static int fimc_m2m_s_crop(struct file *file, void *fh, const struct v4l2_crop *crop) |
| 555 | { | 555 | { |
| 556 | struct fimc_ctx *ctx = fh_to_ctx(fh); | 556 | struct fimc_ctx *ctx = fh_to_ctx(fh); |
| 557 | struct fimc_dev *fimc = ctx->fimc_dev; | 557 | struct fimc_dev *fimc = ctx->fimc_dev; |
| 558 | struct v4l2_crop cr = *crop; | ||
| 558 | struct fimc_frame *f; | 559 | struct fimc_frame *f; |
| 559 | int ret; | 560 | int ret; |
| 560 | 561 | ||
| 561 | ret = fimc_m2m_try_crop(ctx, cr); | 562 | ret = fimc_m2m_try_crop(ctx, &cr); |
| 562 | if (ret) | 563 | if (ret) |
| 563 | return ret; | 564 | return ret; |
| 564 | 565 | ||
| 565 | f = (cr->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) ? | 566 | f = (cr.type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) ? |
| 566 | &ctx->s_frame : &ctx->d_frame; | 567 | &ctx->s_frame : &ctx->d_frame; |
| 567 | 568 | ||
| 568 | /* Check to see if scaling ratio is within supported range */ | 569 | /* Check to see if scaling ratio is within supported range */ |
| 569 | if (fimc_ctx_state_is_set(FIMC_DST_FMT | FIMC_SRC_FMT, ctx)) { | 570 | if (fimc_ctx_state_is_set(FIMC_DST_FMT | FIMC_SRC_FMT, ctx)) { |
| 570 | if (cr->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { | 571 | if (cr.type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { |
| 571 | ret = fimc_check_scaler_ratio(ctx, cr->c.width, | 572 | ret = fimc_check_scaler_ratio(ctx, cr.c.width, |
| 572 | cr->c.height, ctx->d_frame.width, | 573 | cr.c.height, ctx->d_frame.width, |
| 573 | ctx->d_frame.height, ctx->rotation); | 574 | ctx->d_frame.height, ctx->rotation); |
| 574 | } else { | 575 | } else { |
| 575 | ret = fimc_check_scaler_ratio(ctx, ctx->s_frame.width, | 576 | ret = fimc_check_scaler_ratio(ctx, ctx->s_frame.width, |
| 576 | ctx->s_frame.height, cr->c.width, | 577 | ctx->s_frame.height, cr.c.width, |
| 577 | cr->c.height, ctx->rotation); | 578 | cr.c.height, ctx->rotation); |
| 578 | } | 579 | } |
| 579 | if (ret) { | 580 | if (ret) { |
| 580 | v4l2_err(&fimc->m2m.vfd, "Out of scaler range\n"); | 581 | v4l2_err(&fimc->m2m.vfd, "Out of scaler range\n"); |
| @@ -582,10 +583,10 @@ static int fimc_m2m_s_crop(struct file *file, void *fh, const struct v4l2_crop * | |||
| 582 | } | 583 | } |
| 583 | } | 584 | } |
| 584 | 585 | ||
| 585 | f->offs_h = cr->c.left; | 586 | f->offs_h = cr.c.left; |
| 586 | f->offs_v = cr->c.top; | 587 | f->offs_v = cr.c.top; |
| 587 | f->width = cr->c.width; | 588 | f->width = cr.c.width; |
| 588 | f->height = cr->c.height; | 589 | f->height = cr.c.height; |
| 589 | 590 | ||
| 590 | fimc_ctx_state_set(FIMC_PARAMS, ctx); | 591 | fimc_ctx_state_set(FIMC_PARAMS, ctx); |
| 591 | 592 | ||
