Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp327332rwd; Wed, 24 May 2023 19:14:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5LYsFxMU/yIPmg2uyyJ42p1MaoQSwqq2JScMPebz1KXoVLb3WI9VH+leasCLPcUS7wnEZ8 X-Received: by 2002:a17:903:2283:b0:1a6:a405:f714 with SMTP id b3-20020a170903228300b001a6a405f714mr24689676plh.63.1684980843991; Wed, 24 May 2023 19:14:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684980843; cv=none; d=google.com; s=arc-20160816; b=sSZ5n2xO614tJKq3F6EvEttgZSMl8uEbRbWS0OEtoxAbzZ7VBFleOgssZXtrNogumP RP/qxGbV+K48/hNx68xpMNnR/rxE3jcI/6wEVtf9zBoEAycDTG/I9HI4i4Rvkc8bxy+i e9cvi6WbUhNjmzMWAxnNwdvYumjqzitn7ZNrB5jQ49nXpXDs4pDwpLCfIQ1a+JMg9LwL oQeE/nl/97QxbxSaPKQ/mYNoGJwaKe57iEesQC4xItOBHH25li7QWg9Ag411ofSNhP3z cpaCbclzzlE8rPtr+yRCg18Fm2gtoxbV0HiK0+97iU6m8ctjjU9DZFGDWm//YQvT7Se1 2uSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=zOBf7epstLxMnK/zLdFYIIeJOPfmRcocUYEv4ffyRWU=; b=rRodOQ+slQhRULyfZs/YFzT1FyDuGOtsqasGseEWN/kUTdai0lKs3Kq4JAAVQKO54F wY0DMoO8+2R9urG/uol3Z0l+lyvoA/9Zyr/gxn9Hh1vujQlhaJfodjb/OuLInMEBiamT RtLKdy8GyKjdTPjMdkCsvM7Z/j93TgGc2VUuHXUtTNKjK8arRhL5gMaFZSQn6hrpG/zZ d3UJQtui67SPMOD7z2Ew5TVvjYZpDcwc3v4C6Mphz56aiR2EZyd3o7V4HQaGIRA+Zegh BMMfXzy/7DqSIV5dTYqfypDq7kFa7+3HAU3QM3DzREacKWANHUOZ2F3uf1WDCNj3+PiO ojUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=i+CyGllN; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k12-20020a170902c40c00b001ab1d1a6802si396085plk.1.2023.05.24.19.13.49; Wed, 24 May 2023 19:14:03 -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=@mediatek.com header.s=dk header.b=i+CyGllN; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231905AbjEYCMg (ORCPT + 99 others); Wed, 24 May 2023 22:12:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229661AbjEYCMf (ORCPT ); Wed, 24 May 2023 22:12:35 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF6E2D3; Wed, 24 May 2023 19:12:27 -0700 (PDT) X-UUID: 9564020afaa111edb20a276fd37b9834-20230525 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=zOBf7epstLxMnK/zLdFYIIeJOPfmRcocUYEv4ffyRWU=; b=i+CyGllNMOUS8ZxFeueW3uIP+E3ZrU7GmkIxQucPlzLSvgbrjHdSncGN1f88ZB+Dp1TKHaUZy1GBFCgz50T02hCtzC+jZb4jZZsEpsNQuMIqlp1iAmUXu37+1ned0jz6ALBjw8SayRZOdrNcCJP7gL3fQSdI0OctSdVakHz4NsY=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.25,REQID:d5856d64-7e94-4ff9-acd5-e0763674cdd8,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:d5856d64-7e94-4ff9-acd5-e0763674cdd8,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:cb31ec6c-2f20-4998-991c-3b78627e4938,B ulkID:230525101222U58R0ZFE,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: 9564020afaa111edb20a276fd37b9834-20230525 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 697199958; Thu, 25 May 2023 10:12:22 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 25 May 2023 10:12:20 +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, 25 May 2023 10:12:19 +0800 From: Yunfei Dong To: Chen-Yu Tsai , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , =?UTF-8?q?N=C3=ADcolas=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= , Nathan Hebert CC: Yunfei Dong , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , , , , , , Subject: [PATCH v5,0/8] media: mediatek: vcodec: Add debugfs file for decode and encode Date: Thu, 25 May 2023 10:12:11 +0800 Message-ID: <20230525021219.23638-1-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR,UNPARSEABLE_RELAY,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 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 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 | 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_dbgfs.c create mode 100644 drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h -- 2.25.1