From patchwork Mon Feb 6 12:07:07 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: 53209 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2196357wrn; Mon, 6 Feb 2023 04:10:38 -0800 (PST) X-Google-Smtp-Source: AK7set+JmrMP75xxb3ix0frjKrhgxVODhgCTH7dsR3bIRlLMW67fiE0oYFIX97ZfzW6HAB4pHH0N X-Received: by 2002:a50:d695:0:b0:4aa:a561:b218 with SMTP id r21-20020a50d695000000b004aaa561b218mr7932448edi.6.1675685438694; Mon, 06 Feb 2023 04:10:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675685438; cv=none; d=google.com; s=arc-20160816; b=QeD6e4lH3Qp+2QSmu2PoAF474Cby+sjsPG7P4gMnybUqn5KpN5pYiHldV1xKE9vOro av7MgS4K7N9A8HLogqoBN8/14KBbUyYqA+9j23ZrCBR6F4pYTk2DPrW5UgWoBO81c29l cDNRT2RE6/Pz02Wh0b7n7aLql3XJRjYkuYL9fawI8f3FwOmlA5VGDRj1X2LnnRqsurex O05ZxUUENDbT0QgVSp/fM/Z+EX1I0xKevxOEbyo4pG65ma0e0giLsHrDkbLw5OAUEXcB thO8Riex0LlkbJxrxUP3fkWH649S1U6Xrs4IY6iNHhdMvaBhJDniNmOFAzhLnxQlOgbo BiVA== 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=MXRTixNIquofjMx+XucuSANp1cWxIQKs5+3REiMonWQ=; b=gRpC+0hBNEgW+vnP7LkntmW8h3LxUQQggqJ3i5dUjazHlT97ICAscPVyWrMtvye0EV emi/AtnIMtEG6LFDSvpoiskQH/uf4fDPXnn1G/FuaEJfe92hl+CkJm5SEXnbWSCcUHN4 /I4IkDFC6jV2aaRQx8f/yJTXQWZmiEl0v9cXi6IvEpXSLSBv7NWYIYyHIKqLIvC2lN4V 1uRhTh/6h4HmwB9Zac3BLO8Ca9pxyEutrLJ719gM4+fi+lHYQOU7HXvjzfkesio9KxhY NtYx/6FqtokENPCi6Jt6DK61QF+mgrjDnpG+AhomBvPobR0H72GZJPwaOoh2vmLeeG0B tV8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=cqDf1wsF; 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 r21-20020a056402035500b0049e1d359ae5si11539426edw.4.2023.02.06.04.10.15; Mon, 06 Feb 2023 04:10:38 -0800 (PST) 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=cqDf1wsF; 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 S230106AbjBFMHd (ORCPT + 99 others); Mon, 6 Feb 2023 07:07:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230062AbjBFMHX (ORCPT ); Mon, 6 Feb 2023 07:07:23 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BA9412F1D; Mon, 6 Feb 2023 04:07:22 -0800 (PST) X-UUID: cc3bb014a61611eda06fc9ecc4dadd91-20230206 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=MXRTixNIquofjMx+XucuSANp1cWxIQKs5+3REiMonWQ=; b=cqDf1wsFkdiGQb2ZxGipkNW00A9rb5UQ8gEsnWhyqCiGlENT5ANJL47VH9uW1jaPpP9qj5mIABakoaK464nsrTI2DweT1J10bykShUnMJAubCPcanVOx8Cg6EO/bsUOZVQx+OmNFGqLrJTMGAahmjFEi5+UITENrm1KmLm8vmpQ=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:62f43841-8f81-47b1-be06-7f7328295871,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:885ddb2,CLOUDID:9a647356-dd49-462e-a4be-2143a3ddc739,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,NGT X-UUID: cc3bb014a61611eda06fc9ecc4dadd91-20230206 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2116124942; Mon, 06 Feb 2023 20:07:16 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Mon, 6 Feb 2023 20:07:14 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Mon, 6 Feb 2023 20:07:14 +0800 From: Yunfei Dong To: Yunfei Dong , Chen-Yu Tsai , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Tiffany Lin CC: Mauro Carvalho Chehab , Matthias Brugger , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , , , , , , Subject: [PATCH 5/6] media: mediatek: vcodec: Change dbgfs interface to support encode Date: Mon, 6 Feb 2023 20:07:07 +0800 Message-ID: <20230206120708.19631-6-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230206120708.19631-1-yunfei.dong@mediatek.com> References: <20230206120708.19631-1-yunfei.dong@mediatek.com> MIME-Version: 1.0 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, SPF_PASS,UNPARSEABLE_RELAY 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757083534830620409?= X-GMAIL-MSGID: =?utf-8?q?1757083534830620409?= Extern dbgfs init interface to support encode and create encode dbgfs file. Signed-off-by: Yunfei Dong --- drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c | 7 +++++-- drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h | 4 ++-- .../media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c | 2 +- 3 files changed, 8 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 8a03f986a857..7d0021f34b3c 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c @@ -124,11 +124,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_decode) { struct dentry *vcodec_root; - vcodec_dev->dbgfs.vcodec_root = debugfs_create_dir("vcodec-dec", NULL); + if (is_decode) + vcodec_dev->dbgfs.vcodec_root = debugfs_create_dir("vcodec-dec", NULL); + else + vcodec_dev->dbgfs.vcodec_root = debugfs_create_dir("vcodec-enc", NULL); if (IS_ERR(vcodec_dev->dbgfs.vcodec_root)) pr_info("create dir err:%d\n", IS_ERR(vcodec_dev->dbgfs.vcodec_root)); diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h index 2d0b617e762e..6adfc4f417ef 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h @@ -26,7 +26,7 @@ struct mtk_vcodec_dbgfs { 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_decode); void mtk_vcodec_dbgfs_deinit(struct mtk_vcodec_dev *vcodec_dev); #else static inline void mtk_vcodec_dbgfs_create(struct mtk_vcodec_ctx *ctx) @@ -37,7 +37,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_decode) { } 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 8c2443a18f5e..9260273f26cf 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c @@ -433,7 +433,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, true); mtk_v4l2_debug(0, "decoder registered as /dev/video%d", vfd_dec->minor); return 0;