summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorHans Verkuil2019-01-31 14:21:44 +0100
committerMauro Carvalho Chehab2019-02-07 17:51:08 +0100
commit69a9005789ad18806490bd8dc70dd6458319cd28 (patch)
treeb5281474af252e62344f91d62b1ddd09379f12de /drivers/media/platform
parentmedia: vim2m: fill in bus_info in media_device_info (diff)
downloadkernel-qcow2-linux-69a9005789ad18806490bd8dc70dd6458319cd28.tar.gz
kernel-qcow2-linux-69a9005789ad18806490bd8dc70dd6458319cd28.tar.xz
kernel-qcow2-linux-69a9005789ad18806490bd8dc70dd6458319cd28.zip
media: vicodec: support SOURCE_CHANGE event for decoders only
The SOURCE_CHANGE event is decoder specific, so don't allow it for encoders. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r--drivers/media/platform/vicodec/vicodec-core.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/platform/vicodec/vicodec-core.c b/drivers/media/platform/vicodec/vicodec-core.c
index b5a9dee94c91..212da185e4f2 100644
--- a/drivers/media/platform/vicodec/vicodec-core.c
+++ b/drivers/media/platform/vicodec/vicodec-core.c
@@ -1118,9 +1118,14 @@ static int vicodec_enum_framesizes(struct file *file, void *fh,
static int vicodec_subscribe_event(struct v4l2_fh *fh,
const struct v4l2_event_subscription *sub)
{
+ struct vicodec_ctx *ctx = container_of(fh, struct vicodec_ctx, fh);
+
switch (sub->type) {
- case V4L2_EVENT_EOS:
case V4L2_EVENT_SOURCE_CHANGE:
+ if (ctx->is_enc)
+ return -EINVAL;
+ /* fall through */
+ case V4L2_EVENT_EOS:
return v4l2_event_subscribe(fh, sub, 0, NULL);
default:
return v4l2_ctrl_subscribe_event(fh, sub);