Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2192366iof; Tue, 7 Jun 2022 22:44:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVZ3KWavqeH8akWSpO/grG7/fY97zFzV6ZxcO4BdaaEYRggyBgr3qlRLtYpzADYBoWNsxp X-Received: by 2002:a17:902:8309:b0:167:9a4c:cd58 with SMTP id bd9-20020a170902830900b001679a4ccd58mr4881697plb.166.1654667095075; Tue, 07 Jun 2022 22:44:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667095; cv=none; d=google.com; s=arc-20160816; b=K5oNcG4NRn/LPHAEU1vpYCT1VGEN5rfL6SOOu6+HA9k9/PGiC/n0xLUrcCnocfl85B oILOUgTuZ7U52COakh6PF/VeCabu/DVfbGJUZv8u84dSThAUwlQfqzZQWcODHA3aO56I i2sl/v7jlvyWUgm7g6SXIE/qnYwMlsgAL/sd232dz9XHfu5g1C2KZ9j6jvV6yogEy8ux vZrmYzNLxxtSlvR2DFpkiggL/Mih5eAtSh1VsjF9r4+Y7HutGkeNsk+EI8TBLByP+M0a 48oXePFD2r2MxW1CX+t4pMdsDjonMPNfQ9vSeCXrw8wHCscxNcEKeU11uCC7OIP1OC6c reVA== 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=irlLhzNsTtMkquQeXDZTqifgAXsUSXs7iSqk99CEAo0=; b=b31cH3MFrnZnqtlZ9WvC8KjSGk6xQ4LMH8Ixg0R3ejA9NgqLLTZilrRMDOJKcgwTHM 5Djx6SDYaws7ZiQlSL9UY1EBE/Phuy3EX3XIrx0fP0oQ05CxCmWpLrpmNR5rhd8rtI9z ADtHla/99e3LeEq8DORleDLzFBXOVbOUr5Rzdfib1BfFUElYyiRsqRw/cPJwx2h083bS aseFS8WIKCBAfPH1eRWwlQWQDJ0An0cpbXOEb4OI/Klv+1H5F1ZEmO9ENIqD881XCizi p4fDjONIkmfMmemL4rF9JhVdkiQAJOkCM0KHN2xIFlTNCgHzzR/3Rzcx/ElftbUvdiXR bljg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y3GAtwy4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q187-20020a632ac4000000b003fdd8b44d24si8769972pgq.279.2022.06.07.22.44.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:44:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y3GAtwy4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B55FD43627F; Tue, 7 Jun 2022 22:09:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1389075AbiFHAE6 (ORCPT + 99 others); Tue, 7 Jun 2022 20:04:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357201AbiFGVq5 (ORCPT ); Tue, 7 Jun 2022 17:46:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18A26237C8F; Tue, 7 Jun 2022 12:07:52 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 2585861768; Tue, 7 Jun 2022 19:07:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AD9EC385A5; Tue, 7 Jun 2022 19:07:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628871; bh=VW9StuK/MuTT44RE+bcIPvKLk3UTKI9aPZ2cW+nfRCw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y3GAtwy4pV+bhVp7pdzTgyU8gMy/HYCrEQjAADpenWKwnWrgrc8gdQljlSny4ErzR 14v1HkO3WwwmA1SEESMQzFoCQcDmEAFHOfdLjwjJekcpHykseAqt/Sx/YJZJzYJYL9 rMdf0/Gjjz3DEpQrQOPOJ4cuLjJIykYNUsTHpxto= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yunfei Dong , AngeloGioacchino Del Regno , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.18 459/879] media: mediatek: vcodec: Fix v4l2 compliance decoder cmd test fail Date: Tue, 7 Jun 2022 18:59:37 +0200 Message-Id: <20220607165016.196501276@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Yunfei Dong [ Upstream commit 08a83828825cbf3bc2c9f582a4cd4da9f40c77d6 ] Will return -EINVAL using standard framework api when test stateless decoder with cmd VIDIOC_(TRY)DECODER_CMD. Disable them to adjust v4l2 compliance test for user driver(GStreamer/Chrome) won't use decoder cmd. Fixes: 8cdc3794b2e3 ("media: mtk-vcodec: vdec: support stateless API") Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- .../media/platform/mediatek/vcodec/mtk_vcodec_dec.c | 13 +------------ .../platform/mediatek/vcodec/mtk_vcodec_dec_drv.c | 3 +++ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c index 130ecef2e766..c8ee5e2b4f69 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c @@ -47,14 +47,7 @@ static struct mtk_q_data *mtk_vdec_get_q_data(struct mtk_vcodec_ctx *ctx, static int vidioc_try_decoder_cmd(struct file *file, void *priv, struct v4l2_decoder_cmd *cmd) { - struct mtk_vcodec_ctx *ctx = fh_to_ctx(priv); - - /* Use M2M stateless helper if relevant */ - if (ctx->dev->vdec_pdata->uses_stateless_api) - return v4l2_m2m_ioctl_stateless_try_decoder_cmd(file, priv, - cmd); - else - return v4l2_m2m_ioctl_try_decoder_cmd(file, priv, cmd); + return v4l2_m2m_ioctl_try_decoder_cmd(file, priv, cmd); } @@ -69,10 +62,6 @@ static int vidioc_decoder_cmd(struct file *file, void *priv, if (ret) return ret; - /* Use M2M stateless helper if relevant */ - if (ctx->dev->vdec_pdata->uses_stateless_api) - return v4l2_m2m_ioctl_stateless_decoder_cmd(file, priv, cmd); - mtk_v4l2_debug(1, "decoder cmd=%u", cmd->cmd); dst_vq = v4l2_m2m_get_vq(ctx->m2m_ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c index 128edcf541e1..fe7b2f1739b1 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c @@ -400,6 +400,9 @@ static int mtk_vcodec_probe(struct platform_device *pdev) } if (dev->vdec_pdata->uses_stateless_api) { + v4l2_disable_ioctl(vfd_dec, VIDIOC_DECODER_CMD); + v4l2_disable_ioctl(vfd_dec, VIDIOC_TRY_DECODER_CMD); + dev->mdev_dec.dev = &pdev->dev; strscpy(dev->mdev_dec.model, MTK_VCODEC_DEC_NAME, sizeof(dev->mdev_dec.model)); -- 2.35.1