Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4291187rwd; Tue, 30 May 2023 03:22:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6DExRSi2d5rAexxXX/BUJVL5VQG1WErnZoBq5YmCK8wJww2SigJMn28cYgZBLX35qC7DYJ X-Received: by 2002:a17:90b:17ca:b0:253:572f:79b2 with SMTP id me10-20020a17090b17ca00b00253572f79b2mr2037489pjb.36.1685442141526; Tue, 30 May 2023 03:22:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685442141; cv=none; d=google.com; s=arc-20160816; b=cIvBAv0plwUBdyjA6IpvGKkBNMWtttToLZD/0h7P5+RrRCIZcsX4sX31fjtYS8YcSh CAmaRI2UCu5S4Z/PD2yvo5fYKxTrBIwTQbQdLX0mtNkEaJ7YGYlUIGB5wxIENECJqIaB VfkwlNRSx6tb8DdjhAfaSS/K4X8p3Fl1aZcsFi7Zcf3JnIAeECzK9yMoeq31eEbRgp/L RICAzkgQiuq3nJVHTGuZcalKnZo/K3UcuqajWK+F0kmGyVIgKcSTapY8cuSR2Lilk24V pQxOLh8Er+MXHAgeWfds2Kyu+2qG1GRnmiQhJdSqglkOu/BcdOVvOhqthDsfIcLF6mSQ DFyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=hZ0BJZ8SmdZjdj+zn8FxFAZpMTTsRd9o+hpEFn6fp34=; b=CPnhrwHif0ndt5CtuagAt70TFtJK6I/BRegscj7FprJ/nWH3zYe4ZPBVT5V2BExpk4 UvbhVwHOJ4SPX/KENYLqWv+cAwZ1pIC57sTc/widb2wXXdfJiDAFV8OMWRpbRBRJigVF aWRiGrYCjn7LD3bzIfxyYxH8owBZr9ZL30TvPzVD/o9+sqR4d2UJXhBDJQ4ZCBPamWC+ A5vJ7ziD9BmyGd3XvZ+ogIJSBg4ABbf63pUQIg9tRxoTo3uHFMPyyDsVbhRLRYWwc8dk 4c0TlnmR2MvhTg1O0Sxjxb8foyBfRatBacK8NjW3BUb9ZgUtobpI8dXhGUDRMIRjoflC EHuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RBBWzQ8H; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g1-20020a17090a9b8100b0024df993792dsi1306278pjp.80.2023.05.30.03.22.07; Tue, 30 May 2023 03:22:21 -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; dkim=pass header.i=@chromium.org header.s=google header.b=RBBWzQ8H; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230233AbjE3KOE (ORCPT + 99 others); Tue, 30 May 2023 06:14:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229977AbjE3KOC (ORCPT ); Tue, 30 May 2023 06:14:02 -0400 Received: from mail-vk1-xa32.google.com (mail-vk1-xa32.google.com [IPv6:2607:f8b0:4864:20::a32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9376B12D for ; Tue, 30 May 2023 03:13:46 -0700 (PDT) Received: by mail-vk1-xa32.google.com with SMTP id 71dfb90a1353d-456de5aa485so1253540e0c.3 for ; Tue, 30 May 2023 03:13:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1685441626; x=1688033626; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hZ0BJZ8SmdZjdj+zn8FxFAZpMTTsRd9o+hpEFn6fp34=; b=RBBWzQ8HEW+9Ib3a8FhJhb7FYys7zwdEFNmdgcI7F5skhmV2LX9SyfMfN2P/VqSG4B XHHINCDVjtKyi6EFACg4gOn0kT9la/m1FLdlFjCItqtAC7lLcbtZg0M7ZXJE/s0fPYcE WnkkEu9TcEkazWD+Lx00lIhvQUkPQFzDILi20= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685441626; x=1688033626; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hZ0BJZ8SmdZjdj+zn8FxFAZpMTTsRd9o+hpEFn6fp34=; b=i9A2Yu6jd13Al/cJ/59Fa0+ejFFKLXaAMZ/nO14oCnJiinf49B2FngEIENbsfABotD P0tj66W/Q+HLaN2vkOYNL0+Jo09VsQZ5q/elLfm5Ygqd94oBRrgpygjzvkrRRubT6zwh NrGWupRGGp4MiB2stnzoZVQwNzPb69g9RzAnNrXKEddxNglt2eZA0B6vWTPdrR9W1PWY 5Sujv4oyP2hO+FYr3Bv0ddPH9uFpjpMuT+ZHhp+r1CvUk1YMfF7yHz1fqQS8VLI3A4EF eIDq6BoyCheajDyvhPQ1BEf9V6G0YmIBf8jEI8Q+x8d/ZCLpGzJfiMd1h81eruelswPf oRkw== X-Gm-Message-State: AC+VfDz8ajsFSEz4LYNdUNKVpFo8T1+mbAcmrV0GrEsBzmRVWhOvHtFv 59E+aDOF3MzYSZClTnw7BeY+g/SyNzF2SceB2TNOyQ== X-Received: by 2002:a1f:5fd2:0:b0:43f:8928:151c with SMTP id t201-20020a1f5fd2000000b0043f8928151cmr392643vkb.11.1685441625957; Tue, 30 May 2023 03:13:45 -0700 (PDT) MIME-Version: 1.0 References: <20230525021219.23638-1-yunfei.dong@mediatek.com> In-Reply-To: <20230525021219.23638-1-yunfei.dong@mediatek.com> From: Chen-Yu Tsai Date: Tue, 30 May 2023 18:13:34 +0800 Message-ID: Subject: Re: [PATCH v5,0/8] media: mediatek: vcodec: Add debugfs file for decode and encode To: Yunfei Dong Cc: Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , =?UTF-8?B?TsOtY29sYXMgRiAuIFIgLiBBIC4gUHJhZG8=?= , Nathan Hebert , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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 Thu, May 25, 2023 at 10:12=E2=80=AFAM Yunfei Dong wrote: > > Need to change kernel driver to open decode and encode debug log at curre= nt period, > it's very unreasonable. Adding debugfs common interface to support decode= and encode, > using echo command to control debug log level and getting useful informat= ion for each > instance. > > patch 1 add dbgfs common interface. > patch 2~5 support decode. > patch 6~7 support encode > patch 8 add help function I find the interface kind of weird. A lot of debugfs usage in other places just dumps out the current state. Here you are writing to it to ask it to do a snapshot, and then you read it later. This ends up requiring manual management of a buffer, instead of using seq_file, which is commonly used for virtual files. ChenYu > --- > changed with v4: > - rebase to the top of media stage header. > > changed with v3: > - add help function for patch 8 > - remove append '\0' and enlarge buffer size for patch 4 > > changed with v2: > - using pr_debug and dev_dbg instead of pr_info for patch 2. > - fix word fail: informatiaoin -> information for patch 3. > - used to print each instance format information for patch 5. > > changed with v1: > - add new patch 4 and 5. > - using cmd 'cat vdec' to show debug information instead of pr_info direc= tly. > --- > Yunfei Dong (8): > media: mediatek: vcodec: Add debugfs interface to get debug > information > media: mediatek: vcodec: Add debug params to control different log > level > media: mediatek: vcodec: Add a debugfs file to get different useful > information > media: mediatek: vcodec: Get each context resolution information > media: mediatek: vcodec: Get each instance format type > media: mediatek: vcodec: Change dbgfs interface to support encode > media: mediatek: vcodec: Add encode to support dbgfs > media: mediatek: vcodec: Add dbgfs help function > > .../media/platform/mediatek/vcodec/Makefile | 6 + > .../mediatek/vcodec/mtk_vcodec_dbgfs.c | 216 ++++++++++++++++++ > .../mediatek/vcodec/mtk_vcodec_dbgfs.h | 72 ++++++ > .../mediatek/vcodec/mtk_vcodec_dec_drv.c | 4 + > .../platform/mediatek/vcodec/mtk_vcodec_drv.h | 4 + > .../mediatek/vcodec/mtk_vcodec_enc_drv.c | 2 + > .../mediatek/vcodec/mtk_vcodec_util.c | 8 + > .../mediatek/vcodec/mtk_vcodec_util.h | 26 ++- > 8 files changed, 335 insertions(+), 3 deletions(-) > create mode 100644 drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbg= fs.c > create mode 100644 drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbg= fs.h > > -- > 2.25.1 >