Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp820796rdb; Wed, 6 Dec 2023 00:18:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IG9S5j4IfBkzfcLt/Gw8tvF9W/UqtbzZg3hbSlgO3RZ6K27BWOTo+nA8wmTaBiP/RBePZdE X-Received: by 2002:a05:6a20:a303:b0:18f:97c:5b74 with SMTP id x3-20020a056a20a30300b0018f097c5b74mr160046pzk.66.1701850692983; Wed, 06 Dec 2023 00:18:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701850692; cv=none; d=google.com; s=arc-20160816; b=g0reKzBvJ69fFoUkocFOVqiiPwXW6JypDiLBbPA8G5JRv5W6GYwTiq/ieXMgIuRvwC Yo+tFndAfADayjfcubBUEvDJ/2ZqaKMAudJg/3B2GHtnVtnUiFyfM0M0XMXLcl0NLH06 t5Bu7XZhPJnOB8/iBkY6p13nuSZPVPLB3I3rfUmOfV0j17W1CjTqWDGxNZmGWNDgsKd8 E5aAlpSfU602DpjGPavMRUbKLz6MZbM1fTKtUYn9Q7YHwGCpFHAPQSusB4c9UWzd7rw+ on+EyGXTMnBW6gb40x8nzCZwv3cIS8GswfUEXjcKprndIxiWYZxHdYulvZ4ekid8xx7P 8Z3Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tDdbTuWdtMHx44dMsP7Vdfz0hNjFshKJXaC0iWiaF9M=; fh=wcqrfUTA4c9nkJHA4kqbuH5WL/x/W2/AFDhttE+DJkw=; b=sE+b6+/AIZlZ3bp6qa2SzMxKe9QH8n89e+gXPGfQ3N593LlHFFN0dr4AF72OLa1QGm K/A5vHa0aoCXDaAwLYso8KmljrDtJ//cKpxDYYdyTnryUPloX3SwzWhDP8grcBLIAey1 z8K5SG/f9HNELEUGpQE9HOUmdG0pn4wNWuLTi3wjxEndZ5XgrKxxRPED3AkDO+9HcgKS 3y7v/WPFunGC5sB4xRrW2kfSewHtGJidsY5DaLaq/eLb77YYieznFFlYVGqDCOYhzS/A 80abT5ne04MKVGiaFyCXouY06BX4Rkb4imnrU+PWgT6qqnVKxJ9zA+acq6tW3hZRT828 0grQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=tyj2qJQd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id r17-20020a17090aa09100b002858ed80acfsi13200148pjp.131.2023.12.06.00.18.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 00:18:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=tyj2qJQd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 2756A80BD3BF; Wed, 6 Dec 2023 00:18:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377213AbjLFIRY (ORCPT + 99 others); Wed, 6 Dec 2023 03:17:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377310AbjLFIQq (ORCPT ); Wed, 6 Dec 2023 03:16:46 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B57FD1990; Wed, 6 Dec 2023 00:16:15 -0800 (PST) X-UUID: b4e4b522940f11ee8051498923ad61e6-20231206 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:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=tDdbTuWdtMHx44dMsP7Vdfz0hNjFshKJXaC0iWiaF9M=; b=tyj2qJQdi8MEareVbbF8tB1RL1cHU/t1DOrgY9onyug4AZw8cEIgn5mwoT/uxeY4llRmTwdnxbrQvTU0oM3fxRiJlknDv4xAurL3qOr8hTbTdi8jNebCPxc2W0Ec/XvZm9WZLOQQ3dy/hfpJwqRXk667ZxvNl4Dc4ILBFqFv+OU=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.34,REQID:06d802e5-77fa-4ca3-b3d8-dee0f8a9cbd8,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:abefa75,CLOUDID:862d59fd-4a48-46e2-b946-12f04f20af8c,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File: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: b4e4b522940f11ee8051498923ad61e6-20231206 Received: from mtkmbs14n1.mediatek.inc [(172.21.101.75)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1021699209; Wed, 06 Dec 2023 16:16:07 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 6 Dec 2023 16:16:03 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Wed, 6 Dec 2023 16:16:02 +0800 From: Yunfei Dong To: Jeffrey Kardatzke , =?UTF-8?q?N=C3=ADcolas=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert CC: Chen-Yu Tsai , Yong Wu , "Hsin-Yi Wang" , Fritz Koenig , "Daniel Vetter" , Steve Cho , Yunfei Dong , Sumit Semwal , "Brian Starkey" , John Stultz , "T . J . Mercier" , =?UTF-8?q?Christian=20K=C3=B6nig?= , Matthias Brugger , , , , , , , Subject: [PATCH v3,18/21] media: medkatek: vcodec: remove parse nal_info in kernel Date: Wed, 6 Dec 2023 16:15:35 +0800 Message-ID: <20231206081538.17056-19-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231206081538.17056-1-yunfei.dong@mediatek.com> References: <20231206081538.17056-1-yunfei.dong@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--3.507800-8.000000 X-TMASE-MatchedRID: Gu65HUftg+NNlZ1zEcyAYwPZZctd3P4B7f6JAS2hKPjANHjiWWI+7XVX 4shSYpPIKuucQMr5Le3XJhQ9fMGheSV6fVT+kLJ6UiOWIqwRnLOcgz9a61Hb4bj4Vle8ifDUo8W MkQWv6iUoTQl7wNH8PuTCMddcL/gjymsk/wUE4hqhz7yVilwuBQOAJexy8+Wp/nZOtPmUF/1ovg 09TtYtBSp22WX6RI5lGNQKzv3BgiUTc8wc7CUnBzkrv3sDJUzElJhz6PZ4B/2lp9Vz/lePmPNho 9kAt8htLJl1Svx/Hh8xu7K+8aG0gLDxBQ/q2QPNQwymtxuJ6y0= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--3.507800-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 3DC9A3FF2E1A4E342371F41195989FBF334E4B7A26F69BBACF6DD6DB3EEFCECA2000:8 X-MTK: N X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 06 Dec 2023 00:18:04 -0800 (PST) The hardware can parse syntax to get nal_info, needn't to use cpu. Signed-off-by: Yunfei Dong --- .../vcodec/decoder/vdec/vdec_h264_req_multi_if.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c index a1a68487131c..2dfb3043493e 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c @@ -645,11 +645,10 @@ static int vdec_h264_slice_lat_decode(void *h_vdec, struct mtk_vcodec_mem *bs, struct vdec_h264_slice_inst *inst = h_vdec; struct vdec_vpu_inst *vpu = &inst->vpu; struct mtk_video_dec_buf *src_buf_info; - int nal_start_idx, err, timeout = 0; + int err, timeout = 0; unsigned int data[2]; struct vdec_lat_buf *lat_buf; struct vdec_h264_slice_share_info *share_info; - unsigned char *buf; if (vdec_msg_queue_init(&inst->ctx->msg_queue, inst->ctx, vdec_h264_slice_core_decode, @@ -673,14 +672,6 @@ static int vdec_h264_slice_lat_decode(void *h_vdec, struct mtk_vcodec_mem *bs, share_info = lat_buf->private_data; src_buf_info = container_of(bs, struct mtk_video_dec_buf, bs_buffer); - buf = (unsigned char *)bs->va; - nal_start_idx = mtk_vdec_h264_find_start_code(buf, bs->size); - if (nal_start_idx < 0) { - err = -EINVAL; - goto err_free_fb_out; - } - - inst->vsi->dec.nal_info = buf[nal_start_idx]; lat_buf->src_buf_req = src_buf_info->m2m_buf.vb.vb2_buf.req_obj.req; v4l2_m2m_buf_copy_metadata(&src_buf_info->m2m_buf.vb, &lat_buf->ts_info, true); @@ -689,7 +680,7 @@ static int vdec_h264_slice_lat_decode(void *h_vdec, struct mtk_vcodec_mem *bs, goto err_free_fb_out; if (!inst->ctx->is_secure_playback) - vdec_h264_insert_startcode(inst->ctx->dev, buf, &bs->size, + vdec_h264_insert_startcode(inst->ctx->dev, bs->va, &bs->size, &share_info->h264_slice_params.pps); *res_chg = inst->resolution_changed; -- 2.18.0