From patchwork Mon Mar 20 10:28:37 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: 72080 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1134186wrt; Mon, 20 Mar 2023 03:30:37 -0700 (PDT) X-Google-Smtp-Source: AK7set8zBfziUUYP1vh5koKFYCVQw1bnRikHZEu+bQfdkm5Myxkto6g97HjLOEB+dbEhB5Dq1m+i X-Received: by 2002:a17:902:c411:b0:1a0:7422:939a with SMTP id k17-20020a170902c41100b001a07422939amr24444503plk.4.1679308237343; Mon, 20 Mar 2023 03:30:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679308237; cv=none; d=google.com; s=arc-20160816; b=A3hGphpUP2RxL39eVNxBjeF8zMSlaJ/5ZQ1lpXPvjGrJAE0m98u/hyeuRhrvsVEj83 lwSEPxnzyY9UmKamu037ihyGrU6miu6MbEO4FBWbRLl2hSmvESjTZDjhgk0K+u8ZmmLG Kt2QlErznPaL5rxCLOmQP5IvrDcSmdb3LqCCmKqK5KHR0NDaaWffPoZcg3q4W1MH7jBS HUZyChx+X6qQ7qVpmNdYmnjQP5YWN90gNajsskXPxBmkeLTrsKDXvZsxEOBV5q+ekR4A bcN3qnn1AEGpxvZRgimv8UHHOg4PmZfX17BVSizUDogGwxyVThMZqXVAYESuVJ9Z71Rp Uw/A== 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=wC2QahDcPJmqLLDqgN8MhygHA1dyne9/iAbypMczX/M=; b=pIpwKxyIDJ2oGT8YoNsb/9SUhGlzoUlyQGwPAtMfb87iiKEMJd+zCq0mDxLSIUnZXv uqDQw0u1BlOU4zuqBTWoc2vNK3lUVs6dWgQd8cqjS2DA4xvNW/u8w3srcXwqjMlAz3IK /z4nd5WCoNOUDbfyaoguecmxXurNbnmYhLimQdv2p/r7k9OwNNG/Q8sY3YkmKbOufFu/ lc8W9u7QyDS7wfvrCu5pVNmGQ9ViHZYENHDXSJqJ0ovcG6VUqay8/Z80dp/ppuKfpA3E /nMcWRKE4JbLrFJgLE7DJHMOjix+mEbmtCfYniuyrt7mtF9NEexT5R9TUYaP66NnU8RO uWZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=SOaaB6Jn; 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 d11-20020a170902b70b00b0019acd30dc69si9484190pls.115.2023.03.20.03.30.22; Mon, 20 Mar 2023 03:30:37 -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=SOaaB6Jn; 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 S230224AbjCTK3I (ORCPT + 99 others); Mon, 20 Mar 2023 06:29:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230159AbjCTK2x (ORCPT ); Mon, 20 Mar 2023 06:28:53 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05E39C14A; Mon, 20 Mar 2023 03:28:51 -0700 (PDT) X-UUID: fe9b18b0c70911ed91027fb02e0f1d65-20230320 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=wC2QahDcPJmqLLDqgN8MhygHA1dyne9/iAbypMczX/M=; b=SOaaB6JnTdrkwJNdaM5s2u87L/cVzpNQN4iYajoGvf93yOE74kIVl3QlzZNx4oPOMIRa1hylH3Sfy5jkiWYnvQlbUCGwpdr22mdBi1bx8IID5wmMRi9Qivh4Kh5YpgGyurUw40T/iK2Eq1hfAnMSut7iG7Scz8mpMG9CH/OZC0I=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:4542406d-6fe5-4d9d-b4a4-aeb7aaaa04c5,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:4542406d-6fe5-4d9d-b4a4-aeb7aaaa04c5,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:df84c8b3-beed-4dfc-bd9c-e1b22fa6ccc4,B ulkID:2303201828484XK8UHOP,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: fe9b18b0c70911ed91027fb02e0f1d65-20230320 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 120901241; Mon, 20 Mar 2023 18:28:45 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) 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; Mon, 20 Mar 2023 18:28:45 +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; Mon, 20 Mar 2023 18:28:44 +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 5/6 RESEND] media: mediatek: vcodec: Change dbgfs interface to support encode Date: Mon, 20 Mar 2023 18:28:37 +0800 Message-ID: <20230320102838.8313-6-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230320102838.8313-1-yunfei.dong@mediatek.com> References: <20230320102838.8313-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?1760882314678376104?= X-GMAIL-MSGID: =?utf-8?q?1760882314678376104?= 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;