[media] s5p-fimc: fix compiler warning
drivers/media/platform/s5p-fimc/fimc-m2m.c:561:2: warning: passing argument 2 of 'fimc_m2m_try_crop' discards 'const' qualifier from pointer target type [enabled by default] drivers/media/platform/s5p-fimc/fimc-m2m.c:502:12: note: expected 'struct v4l2_crop *' but argument is of type 'const struct v4l2_crop *' This is fall-out from this commit: commit 4f996594ceaf6c3f9bc42b40c40b0f7f87b79c86 Author: Hans Verkuil <hans.verkuil@cisco.com> [media] v4l2: make vidioc_s_crop const Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
21ec9c97e4
commit
24c54f7757
@ -551,30 +551,31 @@ static int fimc_m2m_try_crop(struct fimc_ctx *ctx, struct v4l2_crop *cr)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int fimc_m2m_s_crop(struct file *file, void *fh, const struct v4l2_crop *cr)
|
static int fimc_m2m_s_crop(struct file *file, void *fh, const struct v4l2_crop *crop)
|
||||||
{
|
{
|
||||||
struct fimc_ctx *ctx = fh_to_ctx(fh);
|
struct fimc_ctx *ctx = fh_to_ctx(fh);
|
||||||
struct fimc_dev *fimc = ctx->fimc_dev;
|
struct fimc_dev *fimc = ctx->fimc_dev;
|
||||||
|
struct v4l2_crop cr = *crop;
|
||||||
struct fimc_frame *f;
|
struct fimc_frame *f;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = fimc_m2m_try_crop(ctx, cr);
|
ret = fimc_m2m_try_crop(ctx, &cr);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
f = (cr->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) ?
|
f = (cr.type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) ?
|
||||||
&ctx->s_frame : &ctx->d_frame;
|
&ctx->s_frame : &ctx->d_frame;
|
||||||
|
|
||||||
/* Check to see if scaling ratio is within supported range */
|
/* Check to see if scaling ratio is within supported range */
|
||||||
if (fimc_ctx_state_is_set(FIMC_DST_FMT | FIMC_SRC_FMT, ctx)) {
|
if (fimc_ctx_state_is_set(FIMC_DST_FMT | FIMC_SRC_FMT, ctx)) {
|
||||||
if (cr->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
|
if (cr.type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
|
||||||
ret = fimc_check_scaler_ratio(ctx, cr->c.width,
|
ret = fimc_check_scaler_ratio(ctx, cr.c.width,
|
||||||
cr->c.height, ctx->d_frame.width,
|
cr.c.height, ctx->d_frame.width,
|
||||||
ctx->d_frame.height, ctx->rotation);
|
ctx->d_frame.height, ctx->rotation);
|
||||||
} else {
|
} else {
|
||||||
ret = fimc_check_scaler_ratio(ctx, ctx->s_frame.width,
|
ret = fimc_check_scaler_ratio(ctx, ctx->s_frame.width,
|
||||||
ctx->s_frame.height, cr->c.width,
|
ctx->s_frame.height, cr.c.width,
|
||||||
cr->c.height, ctx->rotation);
|
cr.c.height, ctx->rotation);
|
||||||
}
|
}
|
||||||
if (ret) {
|
if (ret) {
|
||||||
v4l2_err(&fimc->m2m.vfd, "Out of scaler range\n");
|
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 *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
f->offs_h = cr->c.left;
|
f->offs_h = cr.c.left;
|
||||||
f->offs_v = cr->c.top;
|
f->offs_v = cr.c.top;
|
||||||
f->width = cr->c.width;
|
f->width = cr.c.width;
|
||||||
f->height = cr->c.height;
|
f->height = cr.c.height;
|
||||||
|
|
||||||
fimc_ctx_state_set(FIMC_PARAMS, ctx);
|
fimc_ctx_state_set(FIMC_PARAMS, ctx);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user