[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230320102838.8313-5-yunfei.dong@mediatek.com>
Date: Mon, 20 Mar 2023 18:28:36 +0800
From: Yunfei Dong <yunfei.dong@...iatek.com>
To: Yunfei Dong <yunfei.dong@...iatek.com>,
Chen-Yu Tsai <wenst@...omium.org>,
Nicolas Dufresne <nicolas@...fresne.ca>,
Hans Verkuil <hverkuil-cisco@...all.nl>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Benjamin Gaignard <benjamin.gaignard@...labora.com>,
NĂcolas F . R . A . Prado
<nfraprado@...labora.com>
CC: Matthias Brugger <matthias.bgg@...il.com>,
Hsin-Yi Wang <hsinyi@...omium.org>,
Fritz Koenig <frkoenig@...omium.org>,
Daniel Vetter <daniel@...ll.ch>,
Steve Cho <stevecho@...omium.org>,
<linux-media@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
<Project_Global_Chrome_Upstream_Group@...iatek.com>
Subject: [PATCH 4/6 RESEND] media: mediatek: vcodec: Get get each instance format type
Adding echo command to get capture and output queue format type:
'echo -format > vdec'
Signed-off-by: Yunfei Dong <yunfei.dong@...iatek.com>
---
.../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;
--
2.25.1
Powered by blists - more mailing lists