Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp247411lqo; Thu, 16 May 2024 05:25:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWq7Jv9t50rKIjaHhcmB2P0rph9DE9yqc4t7cy//wDZJDxvfgbnKC5DXAjZQby3bOEG5zZxvrw/41dnLXVttb28Zj38V3a8v8DHoQUbqQ== X-Google-Smtp-Source: AGHT+IFWoaErEG3IXTw95/Tnt8pHp/YgvMGSMm1ZRcYwL93Hf+7klV85FWWM0WH/uTJHWv802gnL X-Received: by 2002:a17:906:4899:b0:a5a:5634:a83a with SMTP id a640c23a62f3a-a5a5634a8abmr927170066b.17.1715862340028; Thu, 16 May 2024 05:25:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715862340; cv=pass; d=google.com; s=arc-20160816; b=KJNsjC4oK8RxsO6esFBxCqzRdEO9xM98jEujuAuiVwgdaK977SDfdqU+sVvnltrxOv EXR/vREdeeX98QIIS0tYWRD98uzl664ermmJ8GiZJjvSq6+3TttqjEx74llocgaxKqRT ehaRB4esOcZugQTECjAohYiOM9g1tBRO1bAYws+R4w6/YDrQz1XGmu/fBVfnYWbqTprF JwlM7s+LPbhoEN3aFNZO+qU1P3DLbHK+ry7BtyvcBotPXaUXjhGCS1j4DLosyDC8K+EE miR1tN2PrUxw0l5HPkk6Prdf/E2gSFv63dac6MmZgniQTTcl/rKpsQ48b5EBpJKr4OhK Do3A== 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=YaA5AfEkaFSFo7Fcp+V8pfeDGuc8Kr7U3fYUDWyvnQY=; fh=biKe3ab6vu9B2YV/BY0rSGdgJ9M/b05dGcvzyA7ivrs=; b=wlSimIjsaqgbgd2cQXhbHLy34uIvtprHjsci4yXoBehYjr43zkxfvQgDkIH7mPZpSh HAwizGS3QEdXmM3Xs3rjQwmf2Sxm6xgyj0VohghYQrFraUOhxqZkvvrnBnnuo+9Tcb7g 1P+PElOjbh/0xWWF2AIho0YB4NfgnaJaiE8HAmFlyCvxmircBx3T5yIXXwVY+V8VSTMG o2YBCbAOkMl3CnTZd08HI8fs+WdgO3I65fVTAUEQPZTE8YLVKj6SHa3i2yj4EpfsF/Ly jSYBqLJG2dUxugqjxytVDt+FdCw34ro7oaArgHzTMhrPOIc+a5GG4R8ri46EwXwla8bs Ia/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=pJy7fPfs; 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-181010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181010-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17ba2e7asi897061066b.516.2024.05.16.05.25.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 05:25:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=pJy7fPfs; 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-181010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181010-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 930231F231E5 for ; Thu, 16 May 2024 12:25:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3D724153512; Thu, 16 May 2024 12:21:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="pJy7fPfs" 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 8D0F715253B; Thu, 16 May 2024 12:21:38 +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=1715862100; cv=none; b=J7iH/1+6bRcHrJLXaIdbCTt6RFlpRO1HYMuknuFpCnG7OKRQAyv+hXaKSgBQU7SaFKIJu64LrvrX3JOlQqIwVr11t3Yd2XlFJkfl502L97Nnal3kmiv2CVY5Kg2WDerlKeuIH3cNzzAWUS6PwIK+/NA8Pe7TcsAEKgFD7G615uw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715862100; c=relaxed/simple; bh=1EDY+4Nhtu/0mMAOr64V+Xh4nX3DrtFzIvtogzwg3HI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OqiRZwk1T37d3C5fme1ibnyxaTWczXymDbT7djTp/3NkoXuGXoUohLZb9q1kbeGw68yEt3soHx0HlkgKei+EyxdO5UeicA8cNINv15osPUS/yUkKNJ5fZWKACt1kkAwf/0/bCeeNin3XBIoTxABMbXXsBa2kUiPbe9rnHz/6Dsg= 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=pJy7fPfs; 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 X-UUID: d5dda114137e11efb92737409a0e9459-20240516 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=YaA5AfEkaFSFo7Fcp+V8pfeDGuc8Kr7U3fYUDWyvnQY=; b=pJy7fPfsLGVwhibjbm1Zf5wBgSfoq3OBANGCWAhz0AbLy2xz181lB4iJjYd3hnuj4nQTN9wqHeLdZROi/m6w6+V0eKzFWjf64rBZAXVcyBR9+hA1QjWoigyR53mYlfZ2wKZoisCdxyW8/8qGPMntalUBmCxvfHUvMZzgsU6J1+4=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.38,REQID:b3342e30-46a1-4c6c-af76-8680f123b287,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:82c5f88,CLOUDID:48a82cfc-ed05-4274-9204-014369d201e8,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: d5dda114137e11efb92737409a0e9459-20240516 Received: from mtkmbs09n2.mediatek.inc [(172.21.101.94)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 730525448; Thu, 16 May 2024 20:21:34 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs13n1.mediatek.inc (172.21.101.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 16 May 2024 20:21:33 +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; Thu, 16 May 2024 20:21:32 +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 v6,18/24] media: mediatek: vcodec: remove parse nal_info in kernel Date: Thu, 16 May 2024 20:20:56 +0800 Message-ID: <20240516122102.16379-19-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240516122102.16379-1-yunfei.dong@mediatek.com> References: <20240516122102.16379-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-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.25.1