From patchwork Tue Apr 4 08:10:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?WXVuZmVpIERvbmcgKOiRo+S6kemjnik=?= X-Patchwork-Id: 7680 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2856167vqo; Tue, 4 Apr 2023 01:12:38 -0700 (PDT) X-Google-Smtp-Source: AKy350Y2GGmnupXYf1BzyNjgf0VhqI94kHa77MI5YqD0TzT/spFI3g6e+mpn3/CzCJHDJrZrX8a3 X-Received: by 2002:a17:906:e44:b0:932:290d:12e4 with SMTP id q4-20020a1709060e4400b00932290d12e4mr1371209eji.25.1680595958508; Tue, 04 Apr 2023 01:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680595958; cv=none; d=google.com; s=arc-20160816; b=UPgpjwe4obYbP3eRrRMOElDjBXIWD7QyXBSRhDr52tS5thbvNVsTC28kQc42TIQMro ue5aug3jvzdwJjDkZi/3YAQs1UZThl+O8IM13nBnZKrFnVV6FPmnb2tlnKMAEPQqm5FG qcCv/8xAAUIseOZT10hbqgidw4A1hvGgM79uEQMu35fwpdDS/ceW/4LlRPANYwaDkDxr z8mgrhdPYSyafXD/vif/sVnofExrZSHf0O3oBokxRCBP/T/dOJBe+2hZrKPeFXaU1+hU nFhyYjaQFEM9kKLGOrk5UIrO0H69mbVm5/cXzmF78pMgdFnlkvkxoeC+OUIYyCHTLuel iCAg== 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=Mn5TQ4GC1j4Q+gyyX94Y4Gogj2cY2+pp64zDevcfeXI=; b=kg5Yb5ZZkrtXPWqZfjCIZQSD+ninLz+Pe+MEszH0gb7WBPQD7P1d1W55viHE73enA8 sBXelccwIS8Cxzd3eRhRR4jtfw/LivET9J6I+d5XFueq1mg5AgxTKfmlaaPHtk18pI0o T2Cm5n1CnBOdK0tnBMa00A0Q4B6xQmKADxHL7XR1kyqrbF4FIhJ9A8NyTAg78iGnNoK6 YTXy1DA6wB0sI1ekQMCWN2G9rI6W/mzmCQYcH7sB/BpejUP4wn44nBr/nlyuWS6VnyBp chHoqWdio0Ox5DGSwDOjcvDe+qucw2VY3A+70Xejqpt0ncZbmyUWyYv50BrPBLQKG8s6 YzBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=kB1c9yCf; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q15-20020a170906388f00b009477b197ba4si458164ejd.321.2023.04.04.01.12.15; Tue, 04 Apr 2023 01:12:38 -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=kB1c9yCf; 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 S234049AbjDDILV (ORCPT + 99 others); Tue, 4 Apr 2023 04:11:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230169AbjDDILT (ORCPT ); Tue, 4 Apr 2023 04:11:19 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 618931BE2; Tue, 4 Apr 2023 01:11:12 -0700 (PDT) X-UUID: 3ebad14ed2c011edb6b9f13eb10bd0fe-20230404 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=Mn5TQ4GC1j4Q+gyyX94Y4Gogj2cY2+pp64zDevcfeXI=; b=kB1c9yCfTuOzCnW3gB1977tGIdq1f9WF0AxTksr82YeJsaF89IXM0Kf4RqxdTcKhDI1DNXPi9M8LmNu/Ps378N3XXjZIz1oIQ3UV3JUBmRnwWoFaBhC0TyAEe8EdmUV3Q4c0jYLMsiH0ULdPLeeezDpk+VUqSmt/qLnhb50GCAs=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:d5cb6333-97fc-47ad-9653-b772a4a7bb62,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.22,REQID:d5cb6333-97fc-47ad-9653-b772a4a7bb62,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:120426c,CLOUDID:c070c4f7-ddba-41c3-91d9-10eeade8eac7,B ulkID:230404161106F0S52OW1,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: 3ebad14ed2c011edb6b9f13eb10bd0fe-20230404 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 176784093; Tue, 04 Apr 2023 16:11:04 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Tue, 4 Apr 2023 16:11:03 +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.25 via Frontend Transport; Tue, 4 Apr 2023 16:11:02 +0800 From: Yunfei Dong To: Yunfei Dong , 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?= CC: Matthias Brugger , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , , , , , , Subject: [PATCH v4,0/8] media: mediatek: vcodec: Add debugfs file for decode and encode Date: Tue, 4 Apr 2023 16:10:54 +0800 Message-ID: <20230404081102.30713-1-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SPF_TEMPERROR,UNPARSEABLE_RELAY 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762232587585945467?= X-GMAIL-MSGID: =?utf-8?q?1762232587585945467?= 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 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