[5/6,RESEND] media: mediatek: vcodec: Change dbgfs interface to support encode
Commit Message
Extern dbgfs init interface to support encode and create encode
dbgfs file.
Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
---
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(-)
@@ -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));
@@ -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)
{
}
@@ -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;