Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2409050rwl; Sun, 26 Mar 2023 22:54:15 -0700 (PDT) X-Google-Smtp-Source: AKy350Ys/o4qCSaGv0o2jyp6wUz/qo5L3tVub4KhFykvAe0OtLgvYfgy+6lvFgQhwMML598lHncP X-Received: by 2002:a17:902:7c11:b0:1a0:566c:aaf8 with SMTP id x17-20020a1709027c1100b001a0566caaf8mr8979513pll.27.1679896455460; Sun, 26 Mar 2023 22:54:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679896455; cv=none; d=google.com; s=arc-20160816; b=eHbQFEDv2RxmIQuhK0nPDQuP/zDOfmPX4Ab1VgFWxat8k0wmur5Nsw/sTGRxFOI//k iaWXUOlyOj4fwv5xB1ITUp40Gc2SQsqVb3+9RzvvOfuGPG/fftVskPa8P6C+wGnA28Zu M+Z1/kvZgE31cIuKlrr5GvPhC4GB8fVRXjwmoylilV1y14tguZE6DL43lJvwC+kEY8tu wljDwa8vzd+FnTnSkPf5kVynuS6muQQ7NoZZcxDHHtVvz59C20LN1kDMpsgNfufJgxqD pKhpiyfi4NkxWrQ3cOKfUwEVO7wmtC9fww7xHYOmEyaBjA4sq0culdKmZNiiDqxQ6KW8 bCFA== 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=Euq4PBlvcHMpGhj/9zgc5wuCxxsRvkDTzLUdB9pnetI=; b=YP4oKCx7Iw1t0dYt2RdhktY5quYaCEwaS5i9ZSJ08uSRPcLdRsTIQXevYqk6H6wkwT XlG/6p64DwsFst11tXh5xoxwr3utpYGA/RAfSU3pjtbXTMIT+l0wOJ4JjhfCE098Rk2K vdcp6/xBoVcRrspO0jTpl4c7LToelxwi2tsAewaS4VPDQW+Qy56N73gesZDn9l571gTv stnDCuewHwyMiCKqnzUIhUan8HpVbs/SeN8sxqRCNcqtX9mtgyDbzxKYwStSPu6a5waE kr8gqzK1TcMKcjI5yYWMNO2glISkilL1H6eiHeHKOP2mnQ9Gd21FpiAgeAlvj+bn0S7R lpdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=FFJbj7xk; 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 u2-20020a170902e5c200b001a1bbc5bea5si22530628plf.537.2023.03.26.22.54.01; Sun, 26 Mar 2023 22:54:15 -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=FFJbj7xk; 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 S232011AbjC0Fxn (ORCPT + 99 others); Mon, 27 Mar 2023 01:53:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230020AbjC0Fxl (ORCPT ); Mon, 27 Mar 2023 01:53:41 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A215A40FB; Sun, 26 Mar 2023 22:53:35 -0700 (PDT) X-UUID: b3077204cc6311eda9a90f0bb45854f4-20230327 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=Euq4PBlvcHMpGhj/9zgc5wuCxxsRvkDTzLUdB9pnetI=; b=FFJbj7xk05wBV8/O6hp7IuXweFNICEouvzQ3oiIZoqGaZoojYeO4APlpEm9a7xE3cOgzc1p7sOoqxMMAUugygE3SR449XnE1EfWS1ksyS23eaBT/ohc3/ACg7s3I0+caQ0758siHJ+OPEcenSfqziBfzCtQ86ZRthSoXzw0BD18=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:b01db998-7d7a-4fac-a893-608d25a33eb7,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:b01db998-7d7a-4fac-a893-608d25a33eb7,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:ab4203f7-ddba-41c3-91d9-10eeade8eac7,B ulkID:2303271353315J7EH7G9,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: b3077204cc6311eda9a90f0bb45854f4-20230327 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 22917222; Mon, 27 Mar 2023 13:53:29 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) 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.25; Mon, 27 Mar 2023 13:53:28 +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.25 via Frontend Transport; Mon, 27 Mar 2023 13:53:27 +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=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= CC: Matthias Brugger , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , , , , , , Subject: [PATCH v3,0/7] media: mediatek: vcodec: Add debugfs file for decode and encode Date: Mon, 27 Mar 2023 13:53:08 +0800 Message-ID: <20230327055315.13936-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=-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 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 --- 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 (7): 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/platform/mediatek/vcodec/Makefile | 6 + .../mediatek/vcodec/mtk_vcodec_dbgfs.c | 196 ++++++++++++++++++ .../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, 315 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.18.0