Commit 7e47c384 authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab

media: coda: fail S_SELECTION for read-only targets

v4l2-compliance complains if S_SELECTION returns 0 for read-only targets.
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarHans Verkuil <hansverk@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent cf13135c
...@@ -939,9 +939,10 @@ static int coda_s_selection(struct file *file, void *fh, ...@@ -939,9 +939,10 @@ static int coda_s_selection(struct file *file, void *fh,
struct coda_ctx *ctx = fh_to_ctx(fh); struct coda_ctx *ctx = fh_to_ctx(fh);
struct coda_q_data *q_data; struct coda_q_data *q_data;
switch (s->target) {
case V4L2_SEL_TGT_CROP:
if (ctx->inst_type == CODA_INST_ENCODER && if (ctx->inst_type == CODA_INST_ENCODER &&
s->type == V4L2_BUF_TYPE_VIDEO_OUTPUT && s->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
s->target == V4L2_SEL_TGT_CROP) {
q_data = get_q_data(ctx, s->type); q_data = get_q_data(ctx, s->type);
if (!q_data) if (!q_data)
return -EINVAL; return -EINVAL;
...@@ -963,8 +964,14 @@ static int coda_s_selection(struct file *file, void *fh, ...@@ -963,8 +964,14 @@ static int coda_s_selection(struct file *file, void *fh,
return 0; return 0;
} }
/* else fall through */
case V4L2_SEL_TGT_NATIVE_SIZE:
case V4L2_SEL_TGT_COMPOSE:
return coda_g_selection(file, fh, s); return coda_g_selection(file, fh, s);
default:
/* v4l2-compliance expects this to fail for read-only targets */
return -EINVAL;
}
} }
static int coda_try_encoder_cmd(struct file *file, void *fh, static int coda_try_encoder_cmd(struct file *file, void *fh,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment