Skip to content

Commit 5910584

Browse files
yunfei-mtkmchehab
authored andcommitted
media: mediatek: vcodec: Change dbgfs interface to support encode
Extend dbgfs init interface to support encode and create encode dbgfs file. Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
1 parent 6d5aea1 commit 5910584

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,14 @@ void mtk_vcodec_dbgfs_remove(struct mtk_vcodec_dev *vcodec_dev, int ctx_id)
157157
}
158158
EXPORT_SYMBOL_GPL(mtk_vcodec_dbgfs_remove);
159159

160-
void mtk_vcodec_dbgfs_init(struct mtk_vcodec_dev *vcodec_dev)
160+
void mtk_vcodec_dbgfs_init(struct mtk_vcodec_dev *vcodec_dev, bool is_encode)
161161
{
162162
struct dentry *vcodec_root;
163163

164-
vcodec_dev->dbgfs.vcodec_root = debugfs_create_dir("vcodec-dec", NULL);
164+
if (is_encode)
165+
vcodec_dev->dbgfs.vcodec_root = debugfs_create_dir("vcodec-enc", NULL);
166+
else
167+
vcodec_dev->dbgfs.vcodec_root = debugfs_create_dir("vcodec-dec", NULL);
165168
if (IS_ERR(vcodec_dev->dbgfs.vcodec_root))
166169
dev_err(&vcodec_dev->plat_dev->dev, "create vcodec dir err:%d\n",
167170
IS_ERR(vcodec_dev->dbgfs.vcodec_root));
@@ -171,6 +174,8 @@ void mtk_vcodec_dbgfs_init(struct mtk_vcodec_dev *vcodec_dev)
171174
debugfs_create_x32("mtk_vcodec_dbg", 0644, vcodec_root, &mtk_vcodec_dbg);
172175

173176
vcodec_dev->dbgfs.inst_count = 0;
177+
if (is_encode)
178+
return;
174179

175180
INIT_LIST_HEAD(&vcodec_dev->dbgfs.dbgfs_head);
176181
debugfs_create_file("vdec", 0200, vcodec_root, vcodec_dev, &vdec_fops);

drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct mtk_vcodec_dbgfs {
5252
#if defined(CONFIG_DEBUG_FS)
5353
void mtk_vcodec_dbgfs_create(struct mtk_vcodec_ctx *ctx);
5454
void mtk_vcodec_dbgfs_remove(struct mtk_vcodec_dev *vcodec_dev, int ctx_id);
55-
void mtk_vcodec_dbgfs_init(struct mtk_vcodec_dev *vcodec_dev);
55+
void mtk_vcodec_dbgfs_init(struct mtk_vcodec_dev *vcodec_dev, bool is_encode);
5656
void mtk_vcodec_dbgfs_deinit(struct mtk_vcodec_dev *vcodec_dev);
5757
#else
5858
static inline void mtk_vcodec_dbgfs_create(struct mtk_vcodec_ctx *ctx)
@@ -63,7 +63,7 @@ static inline void mtk_vcodec_dbgfs_remove(struct mtk_vcodec_dev *vcodec_dev, in
6363
{
6464
}
6565

66-
static inline void mtk_vcodec_dbgfs_init(struct mtk_vcodec_dev *vcodec_dev)
66+
static inline void mtk_vcodec_dbgfs_init(struct mtk_vcodec_dev *vcodec_dev, bool is_encode)
6767
{
6868
}
6969

drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
424424
mtk_v4l2_debug(0, "media registered as /dev/media%d", vfd_dec->minor);
425425
}
426426

427-
mtk_vcodec_dbgfs_init(dev);
427+
mtk_vcodec_dbgfs_init(dev, false);
428428
mtk_v4l2_debug(0, "decoder registered as /dev/video%d", vfd_dec->minor);
429429

430430
return 0;

0 commit comments

Comments
 (0)