1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2023 MediaTek Inc.
4 * Author: Yunfei Dong <yunfei.dong@mediatek.com>
7 #ifndef __MTK_VCODEC_DBGFS_H__
8 #define __MTK_VCODEC_DBGFS_H__
10 struct mtk_vcodec_dec_dev;
11 struct mtk_vcodec_dec_ctx;
14 * enum mtk_vdec_dbgfs_log_index - used to get different debug information
16 enum mtk_vdec_dbgfs_log_index {
17 MTK_VDEC_DBGFS_PICINFO,
18 MTK_VDEC_DBGFS_FORMAT,
23 * struct mtk_vcodec_dbgfs_inst - debugfs information for each inst
24 * @node: list node for each inst
25 * @vcodec_ctx: struct mtk_vcodec_dec_ctx
26 * @inst_id: index of the context that the same with ctx->id
28 struct mtk_vcodec_dbgfs_inst {
29 struct list_head node;
30 struct mtk_vcodec_dec_ctx *vcodec_ctx;
35 * struct mtk_vcodec_dbgfs - dbgfs information
36 * @dbgfs_head: list head used to link each instance
37 * @vcodec_root: vcodec dbgfs entry
38 * @dbgfs_lock: dbgfs lock used to protect dbgfs_buf
39 * @dbgfs_buf: dbgfs buf used to store dbgfs cmd
40 * @buf_size: buffer size of dbgfs
41 * @inst_count: the count of total instance
43 struct mtk_vcodec_dbgfs {
44 struct list_head dbgfs_head;
45 struct dentry *vcodec_root;
46 struct mutex dbgfs_lock;
52 #if defined(CONFIG_DEBUG_FS)
53 void mtk_vcodec_dbgfs_create(struct mtk_vcodec_dec_ctx *ctx);
54 void mtk_vcodec_dbgfs_remove(struct mtk_vcodec_dec_dev *vcodec_dev, int ctx_id);
55 void mtk_vcodec_dbgfs_init(void *vcodec_dev, bool is_encode);
56 void mtk_vcodec_dbgfs_deinit(struct mtk_vcodec_dbgfs *dbgfs);
58 static inline void mtk_vcodec_dbgfs_create(struct mtk_vcodec_dec_ctx *ctx)
62 static inline void mtk_vcodec_dbgfs_remove(struct mtk_vcodec_dec_dev *vcodec_dev, int ctx_id)
66 static inline void mtk_vcodec_dbgfs_init(void *vcodec_dev, bool is_encode)
70 static inline void mtk_vcodec_dbgfs_deinit(struct mtk_vcodec_dbgfs *dbgfs)