From patchwork Tue May 30 12:29:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunfei Dong X-Patchwork-Id: 13259921 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BF1CC7EE31 for ; Tue, 30 May 2023 12:30:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231318AbjE3MaA (ORCPT ); Tue, 30 May 2023 08:30:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231523AbjE3M3w (ORCPT ); Tue, 30 May 2023 08:29:52 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8038192; Tue, 30 May 2023 05:29:36 -0700 (PDT) X-UUID: 94710030fee511ed9cb5633481061a41-20230530 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:Message-ID:Date:Subject:CC:To:From; bh=6MexTFJPIhFcXk+M9FUQIl39BvBF+X1bEAEY6AM+FDM=; b=bDBM4Jbkim5+R3mOhjjq6soHvbXK5PKcCQIOl1fQZfJjCx+Plsqf0nSlNH+CsQbAyBEykz2Uu1i6YmAMiEOnHsGWi84ovpSiR9m8fI8ZFhYdOUofifcFntwHIe/i4OfY//DMXn8Z3Pxx2pHE3mdinrE67JSO6YnnZEiybJQDLhk=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.25,REQID:462bc962-5c95-49a3-a68d-e17ddc768ce6,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:70 X-CID-INFO: VERSION:1.1.25,REQID:462bc962-5c95-49a3-a68d-e17ddc768ce6,IP:0,URL :0,TC:0,Content:-25,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTI ON:quarantine,TS:70 X-CID-META: VersionHash:d5b0ae3,CLOUDID:e8f4d13c-de1e-4348-bc35-c96f92f1dcbb,B ulkID:230530202912XRM6BDJW,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-UUID: 94710030fee511ed9cb5633481061a41-20230530 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1704989955; Tue, 30 May 2023 20:29:10 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 30 May 2023 20:29:10 +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; Tue, 30 May 2023 20:29:09 +0800 From: Yunfei Dong To: Chen-Yu Tsai , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , =?utf-8?q?N=C3=ADcolas?= =?utf-8?q?_F_=2E_R_=2E_A_=2E_Prado?= , Nathan Hebert CC: Yunfei Dong , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , , , , , , Subject: [PATCH v6,0/8] media: mediatek: vcodec: Add debugfs file for decode and encode Date: Tue, 30 May 2023 20:29:00 +0800 Message-ID: <20230530122908.19267-1-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Need to change kernel driver to open decode and encode debug log at current 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 information for each instance. patch 1 add dbgfs common interface. patch 2~5 support decode. patch 6~7 support encode patch 8 add help function --- changed with v5: - support "echo > vdec" to get help function. 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 directly. --- 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 | 215 ++++++++++++++++++ .../mediatek/vcodec/mtk_vcodec_dbgfs.h | 74 ++++++ .../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, 336 insertions(+), 3 deletions(-) create mode 100644 drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c create mode 100644 drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h