From patchwork Thu Mar 14 11:44:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunfei Dong X-Patchwork-Id: 13592354 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0D17FC54E68 for ; Thu, 14 Mar 2024 11:45:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=qfd1ADK2FxXCQSSQT1vjqtJGXE3kxNsxgpmBaKPcGaQ=; b=zZ92roTGFjkLde X47iL8FsoaragrohiFzdGP2lvwSl2jZZN7xk4iUWO7P+HZVqhrTQuxhzt7dz9Q6TuJ7VgRNjhaVvF fhGlhd96enCc7Dx/EVRollYzyed04m+Bf4aNv7mqnQ/z4Goiy0L4GKr+FhhlvqfTDgccdmChNO50a oBP29kK7q1XOamQkinsURPHBNLqRUopsyFzkTGcj+0Pm74gtTwiZz6vBvOBt9dABn7rUHECoWMqgn /wmN1Iu0WOj8k+XOPbUJ+Jd6n6NruBdys4VCH8ZT2o7fk/zUOnuU8XCwzXFa0DqTVaLAO58kCaxnd Nmt0mRYUgMjGVq07hc8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkjWE-0000000E753-4Bnv; Thu, 14 Mar 2024 11:45:07 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkjWB-0000000E732-2K0n; Thu, 14 Mar 2024 11:45:04 +0000 X-UUID: 47ff1448e1f811ee9aa9374d6d45775a-20240314 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=UxJYj8Ub0WqcViLUsXIUaPYc9DwJ148RUl4hICOZhNU=; b=n+gXxgNB4zKf+GXn/ZIyaQ8x6+cMsF1tKzhiMxRw3LY7QZyOF3/lkllOj0BZXbKmud6FGamawwgpM2Tll5TwDvO8bRUDDJyKcRfITW/zvwCqb9b/vSp2EvEF2KCfjJo7769llbiPjDKv90KoAXtJu4nKvlC70geV859jFVUmncY=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:6c0088b7-7637-4875-8b23-6bfb72e6bff3,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:6f543d0,CLOUDID:9c09e5ff-c16b-4159-a099-3b9d0558e447,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1, SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 47ff1448e1f811ee9aa9374d6d45775a-20240314 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1887039978; Thu, 14 Mar 2024 04:44:57 -0700 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 14 Mar 2024 19:44:54 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 14 Mar 2024 19:44:53 +0800 From: Yunfei Dong To: =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert , Sebastian Fricke CC: Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , Yunfei Dong , , , , , , Subject: [PATCH v2,0/4] media: mediatek: vcodec: fix ctrl request complete fail Date: Thu, 14 Mar 2024 19:44:48 +0800 Message-ID: <20240314114452.17532-1-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240314_044503_623536_9F242D2B X-CRM114-Status: UNSURE ( 8.27 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Moving v4l2_ctrl_request_complete to before of function v4l2_m2m_buf_done to make sure the status of request correctly. Replace v4l2_m2m_next_src_buf with v4l2_m2m_src_buf_remove to make sure the src buffer won't be removed for some unknown reason leading to buffer done error. Patch 1 setting request complete before buffer done Patch 3 flush decoder before remove all source buffer Patch 2 change flush decode from capture to output when stream off Patch 4 replace v4l2_m2m_next_src_buf with v4l2_m2m_src_buf_remove --- compared with v1: - add patch 2/3/4 to fix timing issue. --- Yunfei Dong (4): media: mediatek: vcodec: setting request complete before buffer done media: mediatek: vcodec: change flush decode from capture to output when stream off media: mediatek: vcodec: flush decoder before remove all source buffer media: mediatek: vcodec: replace v4l2_m2m_next_src_buf with v4l2_m2m_src_buf_remove .../mediatek/vcodec/decoder/mtk_vcodec_dec.c | 52 +++++++++---------- .../vcodec/decoder/mtk_vcodec_dec_drv.h | 3 +- .../vcodec/decoder/mtk_vcodec_dec_stateless.c | 28 +++++++--- .../vcodec/decoder/vdec/vdec_av1_req_lat_if.c | 28 +++++----- .../decoder/vdec/vdec_h264_req_multi_if.c | 3 +- .../decoder/vdec/vdec_hevc_req_multi_if.c | 3 +- .../vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 37 ++++++------- .../mediatek/vcodec/decoder/vdec_msg_queue.h | 2 + 8 files changed, 84 insertions(+), 72 deletions(-)