From patchwork Mon Mar 27 05:53:14 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: 75215 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1294291vqo; Sun, 26 Mar 2023 22:56:05 -0700 (PDT) X-Google-Smtp-Source: AKy350Y/zqWKv0mJ5BmPcf8l5MYi8hU4bObA5DFCrBquk1p2Uil7pMbONwMxZmcAh3DNtMGkKp/h X-Received: by 2002:a17:90b:1e01:b0:23f:b35b:7789 with SMTP id pg1-20020a17090b1e0100b0023fb35b7789mr11686093pjb.28.1679896565594; Sun, 26 Mar 2023 22:56:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679896565; cv=none; d=google.com; s=arc-20160816; b=KwOQhqNooQW7CJWwzwWIeP43eAcTGK1JRnmsgTVg98lYPPccdkGLg9+D7H03PVrMCZ /CVIkKxtZiKWM54Gwa0mFRSOIhmt/edO4OitoOPL5J5tR4CVDob1iDZ8lNoCNwg8DgPM D5x4tTpH4VmtjAeFIn67rWKweCFreeFLyK0ssTsDsLqnrk+k8kd9+hK7f/bQDo2gjC01 vsPZeA2r8SJK8espt7hOQ88oH9UpUZ51qLo0U3XBFVzumrKv7EVWB66GZcXKxhLrRqaj aXO1lC5q5Iptll3Zb2rlCyA8U0TqUGNkQ7vkEh+Ma7xMgN+fxwdudEu298C2KdpSTVe9 L3vw== 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=2GuFyUqiRXL44E8YjExaFkqLJRCHMgFArBeHbkEw/w8=; b=R5jQMU3L/pfrJ08zP0W9B9XoBjzQsXguUQ5Dbn39jR6zvjZzQ85bzh6B3KH/eGghD8 BUk50q3gEmR3fUWjv26ww8ZfXA0ScwDzUu5+ftmYPzQCErcbQHWx5iaaZ58ktt7Pc4mF IrsSyOPgzB0bZaPfYf1sSGhuU8wsfC2nngc3qt9qBKXDFvuZKoKsM/AJydjj92M8U4IG QD/wM7doNFLftt9MLrgsb82iHGI60jQM8tOTIjticfSiGsT+tYsrd9NGNhmeJ0kiOMsu ZkTE/BZKeTvPvmKAA4RJMUV9No++tt/GAa85alk27qWR1I4AdlhUjsS/E3Na2470gVjU z32Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=BGKMiLko; 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 nv8-20020a17090b1b4800b00233d9add5bcsi10721955pjb.166.2023.03.26.22.55.53; Sun, 26 Mar 2023 22:56:05 -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=BGKMiLko; 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 S232301AbjC0FyD (ORCPT + 99 others); Mon, 27 Mar 2023 01:54:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232071AbjC0Fxo (ORCPT ); Mon, 27 Mar 2023 01:53:44 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 681EE40FB; Sun, 26 Mar 2023 22:53:42 -0700 (PDT) X-UUID: b684a8f2cc6311eda9a90f0bb45854f4-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:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=2GuFyUqiRXL44E8YjExaFkqLJRCHMgFArBeHbkEw/w8=; b=BGKMiLkowhtO5vezsy308ryaFV4xlOYiheFY1CbvJctcm79QUmvrV6sGK98PW9mjp+vnNZuZFV1enl5b64+EdcNSc64naAvfsXB2DcHjukdOKLbFabfsus4xzMYWivjkHWuTN/g4vdXJt4VPNXHvB/b77myDrUKDCh1mtVerUks=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:7b7bf076-3f6a-4815-844a-f9f1d237c3f2,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:7b7bf076-3f6a-4815-844a-f9f1d237c3f2,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:664303f7-ddba-41c3-91d9-10eeade8eac7,B ulkID:2303271353376AWG435F,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: b684a8f2cc6311eda9a90f0bb45854f4-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 1890096889; Mon, 27 Mar 2023 13:53:35 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n1.mediatek.inc (172.21.101.185) 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:34 +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:33 +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 v3,6/7] media: mediatek: vcodec: Change dbgfs interface to support encode Date: Mon, 27 Mar 2023 13:53:14 +0800 Message-ID: <20230327055315.13936-7-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230327055315.13936-1-yunfei.dong@mediatek.com> References: <20230327055315.13936-1-yunfei.dong@mediatek.com> MIME-Version: 1.0 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761499221300471984?= X-GMAIL-MSGID: =?utf-8?q?1761499221300471984?= 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 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 b0bdb84a46df..ba43518d0fcb 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h @@ -50,7 +50,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) @@ -61,7 +61,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;