Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3080141rwb; Mon, 15 Aug 2022 17:38:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR6VSqigAny2LuIgUI3jcWF18lEthrbj9g+wjOUV7rQOhVoft4RCm3HzJYokXGtdGKXqFNiO X-Received: by 2002:a05:6402:4312:b0:43d:b9c0:65ee with SMTP id m18-20020a056402431200b0043db9c065eemr16707520edc.205.1660610282746; Mon, 15 Aug 2022 17:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610282; cv=none; d=google.com; s=arc-20160816; b=sPMHQvdD1UMpEcJiyi0bntNUy8VPqRL/zpUbw5Y9hsxG/zXangyG0olAqHcFGHHs5b lL3CC1kXKFHOZXKrPjK9gqjrxFP98c425VKs+E2MLRdsOz9okNpxAUJCu1kjjMdA6rCE Rdy3SIabSPrZceGeXBG6gRAT2jLvpx7haPuv+juXmQ6HKziFjoCA0iCg8/Bb9JlQ3zcz uhthV/xYOvMn08einsUsy3XHqm7B3mM5MF3mXtWUSgWqh4FK8D/hM33/HRtoxKS85COI p+ZK+db+tRLvpRUjwKJ/3M/IeGYtA8FnDSsVSWIXpkaR/biOqDnOlawdeNeNdBQQbeMF mJ1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3FKVpW2hb4eQBHkMVdov01h42D1SqotqnJkq7U7djV8=; b=XjafvF7sD3qv5WGoQphH84tNB03PR82qzmREuV+VSmzZA+d6VoZXamzEHWt7Qm6nrT 4fyHFMp+83Y42A5OPe6gYR62KZoxXWBtA16x/bwnaxm5xtsxwOGDiVrLF49oL5HTKlTl 6elsGMoViEP0pdoARrl+Xnqr/ODSyAVC+7aABIrlb/Bi+2PuJTbCqQtUEbXFwmCd+LZF GKvUoiEZfNm0TZsUdPaS/RZ5Lj4QljeOI0aZD6PDh5eXG7FPsXfSmF0qu1xakbPD33RM pKF1mQZDEqjwXavVpVzgncQW1NxdaOEpiVUhzn5bDD3CPMjEsEWpwEZwpp2untHfW8JI ZLIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JUF5I2QA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b13-20020a056402350d00b0043e4a260ad8si10185836edd.563.2022.08.15.17.37.37; Mon, 15 Aug 2022 17:38:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JUF5I2QA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344013AbiHOVDo (ORCPT + 99 others); Mon, 15 Aug 2022 17:03:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347080AbiHOVB0 (ORCPT ); Mon, 15 Aug 2022 17:01:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2D685073B; Mon, 15 Aug 2022 12:13:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1BED6B81106; Mon, 15 Aug 2022 19:13:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59649C433C1; Mon, 15 Aug 2022 19:13:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590811; bh=ob2e2Kwau3IU/jEWM2h5uCr90WUDCFbA04Mb9fnpwOU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JUF5I2QA06r9TLqAJmHa0IgMtrjaWLUBJdmdiVmm1ad0WO1Z6rtx9l8BQhsR3H54V TkdtZy6Zvod0sA0GbXW2npryQGdSMPZijtstEm+f+pM5rJYO2KiDL9T8j1pzlj0fyD GqkW5Z4vjwzLbSbBmfbjnu3Yg31AjiCKuzLrB1/g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chen-Yu Tsai , Nicolas Dufresne , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.18 0379/1095] media: mediatek: vcodec: Skip SOURCE_CHANGE & EOS events for stateless Date: Mon, 15 Aug 2022 19:56:18 +0200 Message-Id: <20220815180445.369175964@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chen-Yu Tsai [ Upstream commit e13ca460e20ed42fe57a3845b0bb9a82f81f05cd ] 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 Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c index 4bb8a2751271..54489f64533e 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c @@ -194,6 +194,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); -- 2.35.1