Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp4257279rwo; Tue, 25 Jul 2023 03:20:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlG5DNW4uYMrvbC6jsH1hcsLh2hR1LHwMp6oiWPF67bnCs9swfuD9sGeLqOl38YdPpIzC/T4 X-Received: by 2002:a05:6a00:3911:b0:681:142f:e8e3 with SMTP id fh17-20020a056a00391100b00681142fe8e3mr13678236pfb.14.1690280416862; Tue, 25 Jul 2023 03:20:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690280416; cv=none; d=google.com; s=arc-20160816; b=FyV+cmSSWDr9o3L5ovqSJpjQkFxllBnuXk5AcKxxz4ozvbbUIS3xm/pKV/FsDm9vRY 8Pemm5gdnY8yLs6c8s1092P0XO0ehv3Q5I3VsQcIP+0NJ9og5qpjRe48TxN1g7qe/wia rxlv9lWPfVVG73mUVbhnS/9ViYMkZD/3sVk2vIANdL13S3VRb5+9cpfiGw/H6D38CrRE MiDDspTuDgKbWdt+1TS1GlMLr9HTUJgez55HN08RsfcjurU6yno1G21L7MG8/2r0Qqd7 dEZrerfDAZGOubZU5RLTBCa9wHBg9BSBsQp7aHIGYxQgjIq9XmGihih7/VDiSAamtAbk FTXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=MsvSIGmmmwYIGUJNstXA/HbwqeFbbYONBIDrb2ff1OA=; fh=ZPGckBoHTw1E5mgBda3QQAZzcJyAi8jdlIpQzrNbV94=; b=omvods41fKqkF0kLK6KRELiFN4R7QjfUS/lt7e1GpJZjMgLX8W7TfA3gRo0YzoYv5L TA2xrOmmgi+HQxqeu2uCk6jCDzAw6x14SwU50Wo9PhDXOivssqYrSMv402BQys8jW17E 60MDvBE37h7TTBKfYPLgZ+jVwq+/3hUdx63aH1l7UaEXy8OpYNGLGulPmfhOxLE0F6fu qZ0liA/99p97nbj91i6yqhMPFDh+oIQr4ETZn6c1eQ81RExFWnwzmUv7vGP572R1SNrt qhC7B5ZdanHBXEUB9tEWsBdADL8zC8KL3pdtLa2kvAqsIKKRBaDbIgTwSDyJ3VsC6mhW x8bg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s22-20020a056a00195600b0067a39a4c12bsi11330485pfk.81.2023.07.25.03.20.04; Tue, 25 Jul 2023 03:20:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233607AbjGYJ7M (ORCPT + 99 others); Tue, 25 Jul 2023 05:59:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233491AbjGYJ6z (ORCPT ); Tue, 25 Jul 2023 05:58:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42A461FDB; Tue, 25 Jul 2023 02:58:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8DFAB615E6; Tue, 25 Jul 2023 09:58:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F016AC433C7; Tue, 25 Jul 2023 09:58:37 +0000 (UTC) Message-ID: <231e9976-93fe-b8b1-29d9-6c799a8e6a3a@xs4all.nl> Date: Tue, 25 Jul 2023 11:58:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v7,0/11] media: mediatek: vcodec: separate encoder and decoder Content-Language: en-US To: Yunfei Dong , =?UTF-8?Q?N=c3=adcolas_F_=2e_R_=2e_A_=2e_Prado?= , Nicolas Dufresne , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert Cc: Chen-Yu Tsai , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Project_Global_Chrome_Upstream_Group@mediatek.com References: <20230722074230.30558-1-yunfei.dong@mediatek.com> From: Hans Verkuil In-Reply-To: <20230722074230.30558-1-yunfei.dong@mediatek.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/07/2023 09:42, Yunfei Dong wrote: > From: Yunfei Dong > > With the driver more and more complex, encoder and decoder need to add more parameter > in shared struct 'mtk_vcodec_ctx' and 'mtk_vcodec_dev'. Encoder use about 40% and > decoder use 60% parameter. Need to allocate extra unused memory when encoder and decoder > working. > > Separate encoder and decoder in different folder and use independent data struct. > > patch 1 remove unused parameter. > patch 2~3 align fw and interrupt related interface. > patch 4~6 remove the dependency of debug log > patch 7~8 separate mtk_vcodec_ctx and mtk_vcodec_dev > patch 9 fix unreasonable parameter > patch 10 removed unused header files > patch 11 separate encoder and decoder in different folder > --- > Changed from v6: > - rebase to: https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=fo-v6.6g. > Changed from v5: > - fix some words error for patch 3/6/11. > - rename mtk_vcodec_comm_drv.h to mtk_vcodec_cmn_drv.h for patch 7. > Changed from v4: > - add one parameter to record register base for reg_base for patch 3. > - add debug string for non ctx log for patch 6. > - change the comment of struct mtk_vcodec_dec_ctx and struct mtk_vcodec_enc_ctx for patch 7. > - prefer to use struct mtk_vcodec_dec_dev an current period, will re-construct in the future for patch 8. > Changed from v3: > - re-write commit message for patch 3. > Changed from v2: > - This patch main changed: > 1: add different macro mtk_dec_debug and mtk_enc_debug calling common > macro mtk_vcodec_debug in order to use dev_dbg instead of pr_debug. > 2: add different macro mtk_v4l2_venc_dbg and mtk_v4l2_vdec_dbg calling common > macro in order to use dev_dbg instead of pr_debug. > Changed from v1: > - Change pr_dbg to dev_dbg for mtk_v4l2_level and mtk_vcodec_dbg for patch 4. > - Change pr_err to dev_err for mtk_v4l2_err and mtk_vcodec_err for patch 5. > - Fix unreasonable parameter for patch 8. > --- > Yunfei Dong (11): > media: mediatek: vcodec: remove unused parameter > media: mediatek: vcodec: align fw interface > media: mediatek: vcodec: Removing struct 'mtk_vcodec_ctx/dev' for > shared interface > media: mediatek: vcodec: Removing useless debug log > media: mediatek: vcodec: remove the dependency of vcodec debug log > media: mediatek: vcodec: replace pr_* with dev_* for v4l2 debug > message > media: mediatek: vcodec: separate struct 'mtk_vcodec_ctx' > media: mediatek: vcodec: separate struct mtk_vcodec_dev > media: mediatek: vcodec: fix unreasonable parameter definition and > style > media: mediatek: vcodec: remove unused include header > media: mediatek: vcodec: separate decoder and encoder Besides the missing argument in patch 6/11 I also get this compiler warning: drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c: In function 'vpu_enc_ipi_handler': drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c:64:31: warning: 'vpu' may be used uninitialized [-Wmaybe-uninitialized] 64 | struct venc_vpu_inst *vpu; | ^~~ and this smatch error: drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c:138 mtk_vcodec_get_reg_bases() error: buffer overflow 'mtk_dec_reg_names' 11 <= 11 However, I believe that was introduced by Nicolas' patch series. I'll try to pinpoint the precise patch. Regards, Hans