Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4447439rwd; Tue, 30 May 2023 05:42:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+xaO/cdgOx2mjCJUM8qtkSwTrqhw2e63uZfcqmn+cPrCXi62yrS7ZFzbXqYReLjTKn/CT X-Received: by 2002:a17:902:ba95:b0:1af:cabb:87b6 with SMTP id k21-20020a170902ba9500b001afcabb87b6mr2318060pls.19.1685450549427; Tue, 30 May 2023 05:42:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685450549; cv=none; d=google.com; s=arc-20160816; b=J/HWWB9aYpyZi4UXMp4xI/BNrlMEjIit5SLdlKlvrpcA7dKMAfifhyfG1oOprcCi5O lxsfqQ401rc7QylAKv7CU3p7S1G81Exj7doHpST1mbENbaxS6pmUiIzpFwXOglIPVAoQ /ykbPZryRdodaMvyDtHaRnAxMMf7jIW5x9uvOz2XXCguRvfvSoHsUuTx2EFlJ/hEtRqU vyDzrWsp3tfR7/kPU72BhmdTwQBaRrOnEGiHxzCy2gDWSoXOLBsyXVe0uO91fEDOZtPI 3y18RKWGmzrqTWsBT0nPd6Ru1mNCvyMExepk3rwlLVX142PxT0bm1+ELGudz55AKJJ7V Xi5w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XailHCYysa6qQLDGVWUI3JnAxFq1jbhW7ENozFCyBFs=; b=a8KDtv6tjPKVZ+FZ1O2THyjLDo4l+fR0wzcZGcsOMz8BCjhb7A/32a7Q/uoRVXgnhN I9ufxo/Ef/CsxlS0rU8IhUILoHP1D15a3UEXBtrebrYW+P+xoTCrLrGiUvZkt1ACEdVl Y1ztZKdjdUocc+UEDx8haGC+EOmU7uv+srmt5sY+XGF22PFv+4sg8lK8YJkESdxKK+Cn tQ7li1+9tiYvD1zuA5aDAawW5x5WhH98LR+iJpykYsx/6NqlqVvmn1wRp4k4PMY/Tbir vLVjXqfWSxbUMHkK/KWZiy/y94UoRwPYGtzpQZYvhbkt6uG+yrSBbZSJUl51Fj2ooYQt ZZBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="Xa/ue+b3"; 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 q15-20020a170902dacf00b001a1deff6062si764182plx.281.2023.05.30.05.42.15; Tue, 30 May 2023 05:42:29 -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="Xa/ue+b3"; 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 S231340AbjE3MaK (ORCPT + 99 others); Tue, 30 May 2023 08:30:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231543AbjE3M3x (ORCPT ); Tue, 30 May 2023 08:29:53 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E97D198; Tue, 30 May 2023 05:29:38 -0700 (PDT) X-UUID: 98698a90fee511ed9cb5633481061a41-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:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=XailHCYysa6qQLDGVWUI3JnAxFq1jbhW7ENozFCyBFs=; b=Xa/ue+b3paAyRL90/KuCGYVp9DJdEcGz5/9KImPEbYiWS+queNr2XWweS8cR6wEplEEgzMnCUfTjK6CCauk8O2iq/Q8zwvo00jC+QtS1dMaZGoGk6aNq3R5/79npAUWgCts8i1ky4sJzgthSKAIHajNCBVx45YBBUaP1+ZvoJnY=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.25,REQID:b3624726-6cba-4e36-998e-c9d7c9b31c96,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:d5b0ae3,CLOUDID:b3d2766d-2f20-4998-991c-3b78627e4938,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: 98698a90fee511ed9cb5633481061a41-20230530 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1066671767; Tue, 30 May 2023 20:29:17 +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.26; Tue, 30 May 2023 20:29:16 +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:15 +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 v6,6/8] media: mediatek: vcodec: Change dbgfs interface to support encode Date: Tue, 30 May 2023 20:29:06 +0800 Message-ID: <20230530122908.19267-7-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230530122908.19267-1-yunfei.dong@mediatek.com> References: <20230530122908.19267-1-yunfei.dong@mediatek.com> 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,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,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 Extend dbgfs init interface to support encode and create encode dbgfs file. Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno --- .../media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c | 9 +++++++-- .../media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h | 4 ++-- .../media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c index 09ca5dc2c22a..688884db651e 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c @@ -157,11 +157,14 @@ void mtk_vcodec_dbgfs_remove(struct mtk_vcodec_dev *vcodec_dev, int ctx_id) } EXPORT_SYMBOL_GPL(mtk_vcodec_dbgfs_remove); -void mtk_vcodec_dbgfs_init(struct mtk_vcodec_dev *vcodec_dev) +void mtk_vcodec_dbgfs_init(struct mtk_vcodec_dev *vcodec_dev, bool is_encode) { struct dentry *vcodec_root; - vcodec_dev->dbgfs.vcodec_root = debugfs_create_dir("vcodec-dec", NULL); + if (is_encode) + vcodec_dev->dbgfs.vcodec_root = debugfs_create_dir("vcodec-enc", NULL); + else + vcodec_dev->dbgfs.vcodec_root = debugfs_create_dir("vcodec-dec", NULL); if (IS_ERR(vcodec_dev->dbgfs.vcodec_root)) dev_err(&vcodec_dev->plat_dev->dev, "create vcodec dir err:%d\n", IS_ERR(vcodec_dev->dbgfs.vcodec_root)); @@ -171,6 +174,8 @@ void mtk_vcodec_dbgfs_init(struct mtk_vcodec_dev *vcodec_dev) debugfs_create_x32("mtk_vcodec_dbg", 0644, vcodec_root, &mtk_vcodec_dbg); vcodec_dev->dbgfs.inst_count = 0; + if (is_encode) + return; INIT_LIST_HEAD(&vcodec_dev->dbgfs.dbgfs_head); debugfs_create_file("vdec", 0200, vcodec_root, vcodec_dev, &vdec_fops); diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h index 6fcb20cfcd91..241ff8197e73 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h @@ -52,7 +52,7 @@ struct mtk_vcodec_dbgfs { #if defined(CONFIG_DEBUG_FS) void mtk_vcodec_dbgfs_create(struct mtk_vcodec_ctx *ctx); void mtk_vcodec_dbgfs_remove(struct mtk_vcodec_dev *vcodec_dev, int ctx_id); -void mtk_vcodec_dbgfs_init(struct mtk_vcodec_dev *vcodec_dev); +void mtk_vcodec_dbgfs_init(struct mtk_vcodec_dev *vcodec_dev, bool is_encode); void mtk_vcodec_dbgfs_deinit(struct mtk_vcodec_dev *vcodec_dev); #else static inline void mtk_vcodec_dbgfs_create(struct mtk_vcodec_ctx *ctx) @@ -63,7 +63,7 @@ static inline void mtk_vcodec_dbgfs_remove(struct mtk_vcodec_dev *vcodec_dev, in { } -static inline void mtk_vcodec_dbgfs_init(struct mtk_vcodec_dev *vcodec_dev) +static inline void mtk_vcodec_dbgfs_init(struct mtk_vcodec_dev *vcodec_dev, bool is_encode) { } diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c index b25943ac3909..d41f2121b94f 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c @@ -424,7 +424,7 @@ static int mtk_vcodec_probe(struct platform_device *pdev) mtk_v4l2_debug(0, "media registered as /dev/media%d", vfd_dec->minor); } - mtk_vcodec_dbgfs_init(dev); + mtk_vcodec_dbgfs_init(dev, false); mtk_v4l2_debug(0, "decoder registered as /dev/video%d", vfd_dec->minor); return 0; -- 2.18.0