Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp977449rwb; Fri, 28 Jul 2023 02:53:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlEnvC4Cy6FMIbSVprcODSdKJjigMInHv+rS7YTN1Iad20VcwO+8I8qHvWXQxi4KhhKpzTMZ X-Received: by 2002:a05:6a00:21cc:b0:686:be77:4326 with SMTP id t12-20020a056a0021cc00b00686be774326mr1651194pfj.34.1690538008241; Fri, 28 Jul 2023 02:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690538008; cv=none; d=google.com; s=arc-20160816; b=rcUCVuFNfTF/kpxKs2/qtI5FppKorIy+nw7m3jAZWaagmlbDCP0O7Cde0YqDXVJtnu VtxJddI5pX68UIJ5IZXWKIcp6uHFpsMq4vZc9lvVWT9zr+FE/1ZoIBocrrQOIEMOLsU9 WwfVyVKyO0X81Ed+q6k8Ovb27SUpgZPgWoJfU8ZHvuE58eFqR3eJ8qT1FGrw1+xqlNR+ 6aiUqoM3VgtTRH3EKEdAnm+X1h88s6xaE4lAVH9JRz8+3HOyReCXq5fEArwRwQ5LT4/X dIu++h/WmIOV40j/Jv3oIwQI2BjtrnctgfhGL4pB2Bl1TFe+Ov4T2jFn0x3HES5oIAiY dZ1A== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id; bh=BeZuXmpiEmno0bow7QoHwmir1t7SQOeK0Dqbujq52ps=; fh=e4xLp0+/5MsmSzjBk70qjeAc8Z113rjpIao8XrWfdzw=; b=Bz3vu/dzItBD6Ot4PIRwDDn9AcZdoXQidfSh1RS2itbQ6CzM6peceXqHC8bpbbti3E hm7oIiuarg4CFn67mj6r0OEU2Meru5mMVHiEUzw8brCt+1OFhiMLQzog3YI0G10Rjh2b lVA3232hujc5D0KfyBWau6er8tKjIZoJJAZ8fPZWVMbjJJXX/BihkSxlRGpQGsV5GjTB Pt1HPxDBGV6lX+sKUEd5N9s93uNTguQ+5epRW2Vfkc0sZKWBo3rtLchc+sdG3snCv4bA TFP/YbHiGOYvOJ1bsb6qqcpFV+azadPKqkPRkQalsQw4s4EVrKUMoSbBB9tZZ/LcGwNU Bcng== 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 z4-20020aa78884000000b00679cdcafec1si2980119pfe.109.2023.07.28.02.53.16; Fri, 28 Jul 2023 02:53:28 -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 S235604AbjG1J3C (ORCPT + 99 others); Fri, 28 Jul 2023 05:29:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235598AbjG1J22 (ORCPT ); Fri, 28 Jul 2023 05:28:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3470E5B90; Fri, 28 Jul 2023 02:25:55 -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 B26DD620A2; Fri, 28 Jul 2023 09:25:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98F40C433C7; Fri, 28 Jul 2023 09:25:49 +0000 (UTC) Message-ID: <2d9eeb0e-71b3-157c-b947-6dd5485f46e3@xs4all.nl> Date: Fri, 28 Jul 2023 11:25:47 +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 From: Hans Verkuil 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> <231e9976-93fe-b8b1-29d9-6c799a8e6a3a@xs4all.nl> In-Reply-To: <231e9976-93fe-b8b1-29d9-6c799a8e6a3a@xs4all.nl> 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 25/07/2023 11:58, Hans Verkuil wrote: > 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. That smatch error is now found and fixed in the staging tree. Can you post a v8 fixing the other issues? Thanks! Regards, Hans > > Regards, > > Hans