summaryrefslogtreecommitdiff
path: root/drivers/media/platform/mediatek
diff options
context:
space:
mode:
authorChen-Yu Tsai <wenst@chromium.org>2022-06-20 07:33:49 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-06-27 09:16:29 +0100
commite13ca460e20ed42fe57a3845b0bb9a82f81f05cd (patch)
tree864c68c834578809d9884733909281e3ee9270d4 /drivers/media/platform/mediatek
parent978bbc392c51e0ece959978daa0ad7fb4dd7f932 (diff)
media: mediatek: vcodec: Skip SOURCE_CHANGE & EOS events for stateless
The stateless decoder API does not specify the usage of SOURCE_CHANGE and EOF events. These events are used by stateful decoders to signal changes in the bitstream. They do not make sense for stateless decoders. Do not handle subscription for these two types of events for stateless decoder instances. This fixes the last v4l2-compliance error: Control ioctls: fail: v4l2-test-controls.cpp(946): have_source_change || have_eos test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL Fixes: 8cdc3794b2e3 ("media: mtk-vcodec: vdec: support stateless API") Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/platform/mediatek')
-rw-r--r--drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
index fe4b78c8eaef..5d6fdf18c3a6 100644
--- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
+++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
@@ -255,6 +255,11 @@ static int vidioc_vdec_querycap(struct file *file, void *priv,
static int vidioc_vdec_subscribe_evt(struct v4l2_fh *fh,
const struct v4l2_event_subscription *sub)
{
+ struct mtk_vcodec_ctx *ctx = fh_to_ctx(fh);
+
+ if (ctx->dev->vdec_pdata->uses_stateless_api)
+ return v4l2_ctrl_subscribe_event(fh, sub);
+
switch (sub->type) {
case V4L2_EVENT_EOS:
return v4l2_event_subscribe(fh, sub, 2, NULL);