From patchwork Mon Feb 6 12:07:06 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: 53208 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2196353wrn; Mon, 6 Feb 2023 04:10:37 -0800 (PST) X-Google-Smtp-Source: AK7set8RCObxmxq8t308Rdcr+eKxyKbJjfHZxexYktw/GMeRvqVUvKoRFgIaiv3HvWlVCRPA6yil X-Received: by 2002:a1c:4b16:0:b0:3dc:19d1:3c1f with SMTP id y22-20020a1c4b16000000b003dc19d13c1fmr18385877wma.30.1675685437678; Mon, 06 Feb 2023 04:10:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675685437; cv=none; d=google.com; s=arc-20160816; b=f4loPZvzez6QdxjKKbnqIpyvL+SNqnhLD13OqeINlbvZI3wdgfWbebFOTrxEQzas9O 5NCRbMp4JpIbyJ+sxZwo9VMJIHgHxZJ+OQI2bFBSjUMxGthoBRo54eskD/EuExXuq7pG AkzU3obUSRGUmMv9Z6RSMBwuDeWeQgMvth13/1VFcUARczdQUM1CSjebVhnPnQksRGbv QMhxY2fqvoDwzJ1q0lxrVBG3Ndp64zLnda/68NaCUv/IV9JGwODRu4kibmjyF10U2RAw l6Wg0izfNR3rTzUKIk1Srx2mFO2+tyYEqIdOtUVMBCE4hGYUqXuwZ04nSZRk1jckh5cz 4NLg== 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=2pQGKOjFD0EPNmzhVI3is/MPjDoOLrtnUT5IvptZW2g=; b=uQLpDBWhP40+as34d0Vqu2TphuoiaEd2TGbwOR4ka0VL+/FQIrdqW8StcbAs6fhtbL 8NFLT6O/CECu9Q0z10McqoQNxyxwuBt36bHGmHjTvVNs/ik93A7QRtdxJPOuQ/fFB79y 9AXvlhZ39wXpn/eSwE/ZzhOlC3Aw+fdywK60zty4XrkI8/vWdl8bS0AYRm+uKNEqxquO zKKtXYlkPsKV3nSPCXyk14545samEMtahMvDydC0P5t74eJFSIrswTVNtKJ809CUSNHs HXvd/ZHetoBxn2IJfjiUHOAr5j3kxlQWMqFfISrEhg5hkRF7Zm/k4891qm0AOAGiULIT aYLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=KwCB2xvo; 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 b10-20020a05600c4e0a00b003dc48b1f68asi10511275wmq.48.2023.02.06.04.10.14; Mon, 06 Feb 2023 04:10:37 -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=KwCB2xvo; 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 S230141AbjBFMHa (ORCPT + 99 others); Mon, 6 Feb 2023 07:07:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229700AbjBFMHX (ORCPT ); Mon, 6 Feb 2023 07:07:23 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0C3D16320; Mon, 6 Feb 2023 04:07:21 -0800 (PST) X-UUID: cb95d5c2a61611ed945fc101203acc17-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=2pQGKOjFD0EPNmzhVI3is/MPjDoOLrtnUT5IvptZW2g=; b=KwCB2xvoPlyEO8zcGeJa1fGnz1hosiJgDC1ZdUwVjU86lMdbW/G5RLCeRVgpejDmdKXc49O7bCUWH8BAIeXTB5ZLDt//k2i0aiC7MygsLDxim1JLIh3hoEgUv0yHGC/mk+aKm6MgV0ujb5xEy8C2Rv/iN9skiCj0BmFZ4LyBUGM=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:ea7d3391-6695-4b14-bab0-d8cac65ab097,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:885ddb2,CLOUDID:92647356-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: cb95d5c2a61611ed945fc101203acc17-20230206 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1315678384; Mon, 06 Feb 2023 20:07:15 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) 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.792.3; Mon, 6 Feb 2023 20:07:13 +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:13 +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 4/6] media: mediatek: vcodec: Get get each instance format type Date: Mon, 6 Feb 2023 20:07:06 +0800 Message-ID: <20230206120708.19631-5-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?1757083533519364821?= X-GMAIL-MSGID: =?utf-8?q?1757083533519364821?= Adding echo command to get capture and output queue format type: 'echo -format > vdec' Signed-off-by: Yunfei Dong --- .../mediatek/vcodec/mtk_vcodec_dbgfs.c | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c index 9e7d57d21cea..8a03f986a857 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c @@ -10,6 +10,34 @@ #include "mtk_vcodec_drv.h" #include "mtk_vcodec_util.h" +static void mtk_vdec_dbgfs_get_format_type(int output, int capture) +{ + switch (output) { + case V4L2_PIX_FMT_H264_SLICE: + pr_info("output format: h264 slice\n"); + break; + case V4L2_PIX_FMT_VP8_FRAME: + pr_info("output format: vp8 slice\n"); + break; + case V4L2_PIX_FMT_VP9_FRAME: + pr_info("output format: vp9 slice\n"); + break; + default: + pr_info("unsupported output format: 0x%x\n", output); + } + + switch (capture) { + case V4L2_PIX_FMT_MM21: + pr_info("capture format MM21\n"); + break; + case V4L2_PIX_FMT_MT21C: + pr_info("capture format MT21C\n"); + break; + default: + pr_info("unsupported capture format: 0x%x\n", capture); + } +} + static ssize_t mtk_vdec_dbgfs_write(struct file *filp, const char __user *ubuf, size_t count, loff_t *ppos) { @@ -33,11 +61,17 @@ static ssize_t mtk_vdec_dbgfs_write(struct file *filp, const char __user *ubuf, ctx->picinfo.pic_w, ctx->picinfo.pic_h, ctx->picinfo.buf_w, ctx->picinfo.buf_h); } + + if (strstr(buf, "-format")) { + str_count++; + mtk_vdec_dbgfs_get_format_type(ctx->current_codec, ctx->capture_fourcc); + } } if (!str_count) { pr_info("\t can not found useful cmd: %s\n", buf); pr_info("\t -picinfo ex. echo -picinfo\n"); + pr_info("\t -format ex. echo -format\n"); } return count;