Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5823826rwl; Wed, 22 Mar 2023 02:53:52 -0700 (PDT) X-Google-Smtp-Source: AK7set+PsRdgjHXkuXTBpLEGUVlst8WhQylQMG6KGLgO4/GeCUj57ztoliHF49DFVfYRU08t8gOt X-Received: by 2002:a17:906:8147:b0:933:be1:8f4f with SMTP id z7-20020a170906814700b009330be18f4fmr6013378ejw.9.1679478832022; Wed, 22 Mar 2023 02:53:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679478832; cv=none; d=google.com; s=arc-20160816; b=TCjQ9rDidZDtX0QdrKdXc1J6GK6ofw6shYBU6IzSoSq7+ObqkTJNwcFMDGQJlnOZjO DTen6vPmZU6Rz5Hr3wKPYcBCG0RdFmg/6FFjY0vHrJGEL9Q3CM91uCuGJlWXJ5FD+4fM pY1pGC4tpPko37CQFFnnkJXMhTMC01G7tXVMAQpRV1J3CB6mnftolZQ3UymDdHKA3Z4d zBtHJEvVDVfHWgVWlHu5aXqGJHSoRheMprqTGkZO9d1oE5qcsZ43SkfSB6wFdYh6qDbj YRcv0Uu93pvBMW/y/7LfV4XszVuGWeCFIGzisyDbPOdaFLW4eGeQiJcIcQ8RQXudMQK/ KaYg== 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=NN+Q3q0BxDoQb6X55VzHKi6+M4es95yNcRRxFvvxYg8=; b=lrJFgRDSk4rWwWuIxcj00ofRF4tGL4/mKTtlP5ST6O8qqWobnH8TDaCEFOHSZmou8a mI4+0hfQrVQSnVic2tvjiJIxppuSzcHF8i20TZgvd3hymG31bRYOVUW1p2fjYSGbGRu9 yBbUnVDhf295Hwqqw5G950Hp8+MGx5Us81fdrmsHD2yQf/Ceh55kwW5qxTvJawTWvPE3 oGidnLeR+J4/A0IqdFdYStPnwe4KWOTrbCnlcdX7Xe0VkZzILdzocFNQhpE2OMveK1vU 0sAcT/VW29zPo2XWKDIaluq8iXyalQAPnocfjC0m3M276aBb1eC5u8xt1kKSGYfPsxfS GcCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=pO+WauDQ; 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 p22-20020a1709060e9600b009333192e440si12233816ejf.288.2023.03.22.02.53.27; Wed, 22 Mar 2023 02:53:52 -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=pO+WauDQ; 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 S231244AbjCVJq7 (ORCPT + 99 others); Wed, 22 Mar 2023 05:46:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231204AbjCVJqm (ORCPT ); Wed, 22 Mar 2023 05:46:42 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CFAE5F6F3; Wed, 22 Mar 2023 02:46:35 -0700 (PDT) X-UUID: 6a18813ac89611eda9a90f0bb45854f4-20230322 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=NN+Q3q0BxDoQb6X55VzHKi6+M4es95yNcRRxFvvxYg8=; b=pO+WauDQei2FV8u+dh8hKSi3E40mjmWRP31PVTPpiu8lVPZ+pI+AzaM0D8828Hfw4OhIKdFwemibOmGx45WfyT2uUVBOqUwRC8683a0/nLaGetX0HQYpM4TGXdWZNfiLFb4RS1lib60uNzjUXA9ufYjOO2BfKDEf1bxatq0zVr0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:12639469-a69b-4ffc-9389-32b83b311199,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:120426c,CLOUDID:d2822429-564d-42d9-9875-7c868ee415ec,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-CID-BAS: 0,NGT,0,_ X-UUID: 6a18813ac89611eda9a90f0bb45854f4-20230322 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1590059525; Wed, 22 Mar 2023 17:46:26 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs13n1.mediatek.inc (172.21.101.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Wed, 22 Mar 2023 17:46:25 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 22 Mar 2023 17:46:25 +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 v2,6/7] media: mediatek: vcodec: Change dbgfs interface to support encode Date: Wed, 22 Mar 2023 17:46:16 +0800 Message-ID: <20230322094617.19410-7-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230322094617.19410-1-yunfei.dong@mediatek.com> References: <20230322094617.19410-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=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED 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 Extend dbgfs init interface to support encode and create encode dbgfs file. Signed-off-by: Yunfei Dong --- .../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 1b1b4301a83d..4f6d0a4af651 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c @@ -160,11 +160,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)); @@ -174,6 +177,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 9e586889717b..f4d6afff64f3 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h @@ -51,7 +51,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) @@ -62,7 +62,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 8c2443a18f5e..bba7b932f4fa 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, false); mtk_v4l2_debug(0, "decoder registered as /dev/video%d", vfd_dec->minor); return 0; -- 2.18.0