From patchwork Sat Oct 12 06:43:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunfei Dong X-Patchwork-Id: 13833824 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D0E684D0F; Sat, 12 Oct 2024 06:43:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.244.123.138 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728715421; cv=none; b=LyNHOHcU109JVsxcujnisphWp5k5z4LQYyknbVEOCiGoOyyWKMfqNxZXc6mJ8Qh1g07JD04SnUA6A8QWlzjRSi54COkuZ92o09pKiZExqBvXIzBod4AfOA/VKqwzNTKhzZhAgD51uA99M0jBUvd/inA436G51n9RwxbOUs5CMpQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728715421; c=relaxed/simple; bh=D0AEIAvqajUXkWVwjse+kfk1GeBwVnRdX506OM+zogE=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=eEKKR/6uuZuqNTjSzYE8+V8Lke9hMud479FsfrIk6S27XwHkh8r9TL7y5uQmtKuynHlRCBWVTqdUngYjhLOtos/XxInV16eADp64FQheJdNyNhc0p/86sKDh53zumN8zyvEpsHK5EWoGRLpKQVMzZ//qXSTLROX2k8ex1SBuSfU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=Ry61VV25; arc=none smtp.client-ip=60.244.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="Ry61VV25" X-UUID: 4cce8b48886511ef88ecadb115cee93b-20241012 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=ls0VtFBNoRYrXjEA96syqeyMSuduHaRi2ujetynALLQ=; b=Ry61VV258qJhJ+OXlKsL47WV7Wre5NjI8nKUaG3E1wKe2gfOgLj+uhsh1rfJUy+u0MM9ubdPRYl5pvF8pWQFk2BD3qcPVxJ8A1NWvh2my1YK2yQVUk1EXBhXIc6bIz1m43uT7P0qcFOiURohX19Nud3UQMFiGowifpi51PuaLnk=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.41,REQID:490d33e5-964e-401c-b50d-d64a21fe7ea7,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:6dc6a47,CLOUDID:66302065-444a-4b47-a99a-591ade3b04b2,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,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,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULN X-UUID: 4cce8b48886511ef88ecadb115cee93b-20241012 Received: from mtkmbs09n1.mediatek.inc [(172.21.101.35)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1992675129; Sat, 12 Oct 2024 14:43:33 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Sat, 12 Oct 2024 14:43:32 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Sat, 12 Oct 2024 14:43:31 +0800 From: Yunfei Dong To: =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= , Sebastian Fricke , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert , Daniel Almeida CC: Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , Yunfei Dong , , , , , , Subject: [PATCH v5 0/5] media: mediatek: vcodec: fix v4l2_ctrl_request_complete fail Date: Sat, 12 Oct 2024 14:43:24 +0800 Message-ID: <20241012064333.27269-1-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.46.0 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MTK: N User space attach the syntaxes and bit-stream buffer to a same media request for stateless decode, and the syntax controls are the only v4l2 control request. The request will be marked to complete status when the buffer is set to done, then request object will be cleaned form media request. When v4l2_ctrl_request_complete() is later called, the control request detect that there is no controls in the request object. It then creates an empty control request object, but attaching an object to a completed request is not allowed. --- compared with v4: - re-write the commit message for cover-letter - change patch 2/3/4/5 commit message compared with v3: - fix flush decoder issue when userspace stream off capture queue firstly - fluster test result same with v3 compared with v2: - add patch 5/6/7 to fix decode again issue - add fluster test result with mt8195 platform(same with no changed): 1> ./fluster.py run -d GStreamer-VP8-V4L2SL-Gst1.0 -j1 -t 90 VP8-TEST-VECTORS 59/61 2> ./fluster.py run -d GStreamer-VP9-V4L2SL-Gst1.0 -j1 -t 90 VP9-TEST-VECTORS 276/305 3> ./fluster.py run -d GStreamer-AV1-V4L2SL-Gst1.0 -j1 -t 90 AV1-TEST-VECTORS 237/239 4> ./fluster.py run -d GStreamer-H.264-V4L2SL-Gst1.0 -j1 -t 90 JVT-AVC_V1 95/135 5> ./fluster.py run -d GStreamer-H.265-V4L2SL-Gst1.0 -j1 -t 90 JCT-VC-HEVC_V1 142/147 compared with v1: - add patch 2/3/4 to fix timing issue. --- Yunfei Dong (5): media: mediatek: vcodec: setting request complete before buffer done media: mediatek: vcodec: change flush decode order when stream off media: mediatek: vcodec: Get SRC buffer from bitstream instead of M2M media: mediatek: vcodec: store current vb2 buffer to decode again media: mediatek: vcodec: remove media request checking .../mediatek/vcodec/decoder/mtk_vcodec_dec.c | 44 ++++++++--------- .../vcodec/decoder/mtk_vcodec_dec_drv.h | 4 +- .../vcodec/decoder/mtk_vcodec_dec_stateless.c | 49 ++++++++++++++----- .../vcodec/decoder/vdec/vdec_av1_req_lat_if.c | 18 ++++--- .../decoder/vdec/vdec_h264_req_multi_if.c | 4 +- .../decoder/vdec/vdec_hevc_req_multi_if.c | 4 +- .../vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 19 ++++--- .../mediatek/vcodec/decoder/vdec_msg_queue.h | 4 +- 8 files changed, 86 insertions(+), 60 deletions(-)