Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp20780lql; Fri, 12 Apr 2024 02:14:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWmfkUJVvg+KIFNwamgtVt+9SYZ59AAfDqYHdcsS2vYmg+YfU8vDh4tTkdU5Xlp2Tpzk2nGFI7z5403ixDPHQo7cYTcLiR8XSJpueDR8w== X-Google-Smtp-Source: AGHT+IFODRDeBqOwe4biKq3xSx0qWhDDyd/dEDtR14Tu9e6WxqLTNk9CYSu3Km4dsoS6spBXgeOj X-Received: by 2002:a81:4e09:0:b0:615:4700:94cb with SMTP id c9-20020a814e09000000b00615470094cbmr2094778ywb.1.1712913246685; Fri, 12 Apr 2024 02:14:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712913246; cv=pass; d=google.com; s=arc-20160816; b=iKStuIWYgg/25DwdbFyeAJROAzND8aAYKXBwBbViKmydb0fLUIepcHL/DNOf/tPAgJ Q1XQRJuLBlEG0nJ/uzX4C3Oq15S+gRLTolu4LnyZbPdg6aUNNdg/DfYBPQZb6r4T8ekV rfkYXv2QGIo1xwQ4hdK2v3OZbVkOVu4ayz6wFPcAsw+CfxTWlYJPX6jip4NPLzZzb12e 1svZlM8Rt4VPVTECFZinxaY54HxiECPnJdcq5tHwPMau5YJAYWA28lm8Pn59/4jAScnU vSMPt9R4u+6rMy1nw5PFIaT85+3a8B93dvgYbobSbpBWQNq0E4cqcqsUPrPdQztjsYiX iBPg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=OKPXM/JgMcLVdMjRyu3K8t7ijNs+Rf3jj3bo8pD6Yls=; fh=+3keNzaSOvsaq+BXFM2IqKmKMiZV6QsxTCb//k4Cpek=; b=Knj5Ve7FqxDE9H4V9qPkGdce0ZR4lYqBKXGK/5U21ga+kOyZWzyaB73LtDSWES8jwH W8VnLON+xTYRCTAcq7iuVO4paNOzokrNYJjTnJWWDETEFnG56uTksifMkXAeRHhVvjAy vJxt9I9Xodabfgxstmd9H0guLtK2PPVjY0kDBXsgRJCraYwym56sgKsLHFP4ZsGK6ZEQ rHDNQ1JCVSmThVVbM0qcGXMwewqtcI8V7xM+n5tltSPu/1wYq0BEzzc3CEFtvATC8ECA 8DPAd1E4+Gl0ymIPR73hU0BtLdNxrYoynjy3Vz8T6FLpIXqQzixi8ehKgMqMq9eAQrYp +0EQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=VJfltCvm; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-142358-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142358-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id m19-20020a05620a291300b0078eccc7338asi900275qkp.784.2024.04.12.02.14.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 02:14:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142358-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=VJfltCvm; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-142358-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142358-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 57A8A1C21F0A for ; Fri, 12 Apr 2024 09:14:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE8515D46C; Fri, 12 Apr 2024 09:09:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="VJfltCvm" Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) (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 DE4395C5F3; Fri, 12 Apr 2024 09:09:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.61.82.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712912970; cv=none; b=O+1ZGbz6rRAOX4yFVtABicZ8EcF9wc6DvmSu/7Ar2kKf4UJaFKM1xnCvW/5vrF/2KDS4C2DGTiO6MBbi2i9NL0I2c9av0TkdBHin/RkKq3zQeqm4Hc5IdrZ0nHcwpPvAqryWrj+xYltpUvhDQXFMF2pMqUxTNi9cPt7o1gqefvs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712912970; c=relaxed/simple; bh=YvpW0ViPbm7qGYVouUMWNawMv/fSpLorz+fX13c/f2E=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Tz9Co2m2l95RIquDLMCFqNTowejKxpNrss8cW8CtEnBKl4og1iKoYi+8eztWMVU2kwrcSvp+BLTeenG1LNJiT2m5M2WQEP7528aOM/FyzbExr1U0MqN9coAQv3wJlxWhFDsMM1ginGbtEfoAq+7RarS2YuGJFUD2HZK3eE8rkI0= 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=VJfltCvm; arc=none smtp.client-ip=210.61.82.184 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 X-UUID: 5addff00f8ac11ee935d6952f98a51a9-20240412 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=OKPXM/JgMcLVdMjRyu3K8t7ijNs+Rf3jj3bo8pD6Yls=; b=VJfltCvmRQxbFnc+JKQx9MYrFMm2Q5Rt+6dFARXXga/Kio0DB/4wadXBbQ10/MClOJnuC502ibY49BtWny2ElbQC18UDuIbvlI3hubbO8jxuBIhefVrCEtoR2a3qNnIVrxjmCTNiS164NKDB8HiaMZN9sCK/hfDFz4hzytcfsLE=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:e5f2d0b0-b48d-4094-9e14-ba724df5fd27,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:6f543d0,CLOUDID:36f19882-4f93-4875-95e7-8c66ea833d57,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: 5addff00f8ac11ee935d6952f98a51a9-20240412 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1333276655; Fri, 12 Apr 2024 17:09:23 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by MTKMBS14N2.mediatek.inc (172.21.101.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 12 Apr 2024 17:09:21 +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; Fri, 12 Apr 2024 17:09:20 +0800 From: Yunfei Dong To: Jeffrey Kardatzke , =?UTF-8?q?N=C3=ADcolas=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= , Nathan Hebert , "Nicolas Dufresne" , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Sebastian Fricke , Tomasz Figa , "Mauro Carvalho Chehab" , Marek Szyprowski 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 v5,18/23] media: mediatek: vcodec: remove parse nal_info in kernel Date: Fri, 12 Apr 2024 17:08:46 +0800 Message-ID: <20240412090851.24999-19-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240412090851.24999-1-yunfei.dong@mediatek.com> References: <20240412090851.24999-1-yunfei.dong@mediatek.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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: 59Hu41dzmXRNlZ1zEcyAYwPZZctd3P4B7f6JAS2hKPjANHjiWWI+7XVX 4shSYpPIKuucQMr5Le3XJhQ9fMGheSV6fVT+kLJ6UiOWIqwRnLOcgz9a61Hb4bj4Vle8ifDUo8W MkQWv6iUoTQl7wNH8PuTCMddcL/gjro1URZJFbJsWP1l9c1C6v/MlDxEY3sdCe/hJ6i/+M2ep3/ Z9DWZw4HsZZVbRteBCZXGDIVmSFvNcVbo3DrWFK6RH3BORLaJUaHc58rl1xBFtUY6LqdlQnFr3v nlc+D6eVZObrZkNVZRlRd/nfa56MV7IEEqsePYG 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: BBBEF77162127FDF2B42C273AC6FEA14214509B59F33864575126E8152C40BC82000:8 X-MTK: N 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 40836673f7fe..f27d326f00ba 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