video: rockchip: mpp: adjust the scope of debugfs relative code

Change-Id: Ief1bbbfc3712c38f9cf3e2468db0eb8fc5410d3f
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
This commit is contained in:
Ding Wei
2020-06-22 17:32:31 +08:00
committed by Tao Huang
parent 3915fb8f88
commit 7c8b4804d6
8 changed files with 104 additions and 36 deletions

View File

@@ -759,13 +759,13 @@ static int iep2_free_task(struct mpp_session *session,
return 0;
}
#ifdef CONFIG_DEBUG_FS
static int iep2_debugfs_remove(struct mpp_dev *mpp)
{
#ifdef CONFIG_DEBUG_FS
struct iep2_dev *iep = to_iep2_dev(mpp);
debugfs_remove_recursive(iep->debugfs);
#endif
return 0;
}
@@ -775,7 +775,6 @@ static int iep2_debugfs_init(struct mpp_dev *mpp)
iep->aclk_debug = 0;
iep->session_max_buffers_debug = 0;
#ifdef CONFIG_DEBUG_FS
iep->debugfs = debugfs_create_dir(mpp->dev->of_node->name,
mpp->srv->debugfs);
if (IS_ERR_OR_NULL(iep->debugfs)) {
@@ -787,11 +786,21 @@ static int iep2_debugfs_init(struct mpp_dev *mpp)
iep->debugfs, &iep->aclk_debug);
debugfs_create_u32("session_buffers", 0644,
iep->debugfs, &iep->session_max_buffers_debug);
#endif
if (iep->session_max_buffers_debug)
mpp->session_max_buffers = iep->session_max_buffers_debug;
return 0;
}
#else
static inline int iep2_debugfs_remove(struct mpp_dev *mpp)
{
return 0;
}
static inline int iep2_debugfs_init(struct mpp_dev *mpp)
{
return 0;
}
#endif
#define IEP2_TILE_W_MAX 120
#define IEP2_TILE_H_MAX 272

View File

@@ -1106,13 +1106,13 @@ static int rkvdec_free_task(struct mpp_session *session,
return 0;
}
#ifdef CONFIG_DEBUG_FS
static int rkvdec_debugfs_remove(struct mpp_dev *mpp)
{
#ifdef CONFIG_DEBUG_FS
struct rkvdec_dev *dec = to_rkvdec_dev(mpp);
debugfs_remove_recursive(dec->debugfs);
#endif
return 0;
}
@@ -1125,7 +1125,6 @@ static int rkvdec_debugfs_init(struct mpp_dev *mpp)
dec->clk_cabac_debug = 0;
dec->clk_hevc_cabac_debug = 0;
dec->session_max_buffers_debug = 0;
#ifdef CONFIG_DEBUG_FS
dec->debugfs = debugfs_create_dir(mpp->dev->of_node->name,
mpp->srv->debugfs);
if (IS_ERR_OR_NULL(dec->debugfs)) {
@@ -1143,12 +1142,22 @@ static int rkvdec_debugfs_init(struct mpp_dev *mpp)
dec->debugfs, &dec->clk_hevc_cabac_debug);
debugfs_create_u32("session_buffers", 0644,
dec->debugfs, &dec->session_max_buffers_debug);
#endif
if (dec->session_max_buffers_debug)
mpp->session_max_buffers = dec->session_max_buffers_debug;
return 0;
}
#else
static inline int rkvdec_debugfs_remove(struct mpp_dev *mpp)
{
return 0;
}
static inline int rkvdec_debugfs_init(struct mpp_dev *mpp)
{
return 0;
}
#endif
static int rkvdec_init(struct mpp_dev *mpp)
{

View File

@@ -589,13 +589,13 @@ static int rkvenc_free_task(struct mpp_session *session,
return 0;
}
#ifdef CONFIG_DEBUG_FS
static int rkvenc_debugfs_remove(struct mpp_dev *mpp)
{
#ifdef CONFIG_DEBUG_FS
struct rkvenc_dev *enc = to_rkvenc_dev(mpp);
debugfs_remove_recursive(enc->debugfs);
#endif
return 0;
}
@@ -606,7 +606,6 @@ static int rkvenc_debugfs_init(struct mpp_dev *mpp)
enc->aclk_debug_mhz = 0;
enc->clk_core_debug_mhz = 0;
enc->session_max_buffers_debug = 0;
#ifdef CONFIG_DEBUG_FS
enc->debugfs = debugfs_create_dir(mpp->dev->of_node->name,
mpp->srv->debugfs);
if (IS_ERR_OR_NULL(enc->debugfs)) {
@@ -620,12 +619,22 @@ static int rkvenc_debugfs_init(struct mpp_dev *mpp)
enc->debugfs, &enc->clk_core_debug_mhz);
debugfs_create_u32("session_buffers", 0644,
enc->debugfs, &enc->session_max_buffers_debug);
#endif
if (enc->session_max_buffers_debug)
mpp->session_max_buffers = enc->session_max_buffers_debug;
return 0;
}
#else
static inline int rkvenc_debugfs_remove(struct mpp_dev *mpp)
{
return 0;
}
static inline int rkvenc_debugfs_init(struct mpp_dev *mpp)
{
return 0;
}
#endif
#ifdef CONFIG_PM_DEVFREQ
static int rkvenc_devfreq_target(struct device *dev,
@@ -1093,7 +1102,6 @@ static int rkvenc_probe(struct platform_device *pdev)
mpp->session_max_buffers = RKVENC_SESSION_MAX_BUFFERS;
rkvenc_debugfs_init(mpp);
dev_info(dev, "probing finish\n");
return 0;

View File

@@ -115,26 +115,35 @@ static int mpp_remove_service(struct mpp_service *srv)
return 0;
}
#ifdef CONFIG_DEBUG_FS
static int mpp_debugfs_remove(struct mpp_service *srv)
{
#ifdef CONFIG_DEBUG_FS
debugfs_remove_recursive(srv->debugfs);
#endif
return 0;
}
static int mpp_debugfs_init(struct mpp_service *srv)
{
#ifdef CONFIG_DEBUG_FS
srv->debugfs = debugfs_create_dir(MPP_SERVICE_NAME, NULL);
if (IS_ERR_OR_NULL(srv->debugfs)) {
mpp_err("failed on open debugfs\n");
srv->debugfs = NULL;
}
#endif
return 0;
}
#else
static inline int mpp_debugfs_remove(struct mpp_service *srv)
{
return 0;
}
static inline int mpp_debugfs_init(struct mpp_service *srv)
{
return 0;
}
#endif
static int mpp_service_probe(struct platform_device *pdev)
{
@@ -215,9 +224,7 @@ static int mpp_service_probe(struct platform_device *pdev)
goto fail_register;
}
mpp_sub_drivers = srv->sub_drivers;
mpp_debugfs_init(srv);
dev_info(dev, "probe success\n");
return 0;

View File

@@ -490,13 +490,13 @@ static int vdpu_free_task(struct mpp_session *session,
return 0;
}
#ifdef CONFIG_DEBUG_FS
static int vdpu_debugfs_remove(struct mpp_dev *mpp)
{
#ifdef CONFIG_DEBUG_FS
struct vdpu_dev *dec = to_vdpu_dev(mpp);
debugfs_remove_recursive(dec->debugfs);
#endif
return 0;
}
@@ -506,8 +506,6 @@ static int vdpu_debugfs_init(struct mpp_dev *mpp)
dec->aclk_debug = 0;
dec->session_max_buffers_debug = 0;
#ifdef CONFIG_DEBUG_FS
dec->debugfs = debugfs_create_dir(mpp->dev->of_node->name,
mpp->srv->debugfs);
if (IS_ERR_OR_NULL(dec->debugfs)) {
@@ -519,12 +517,22 @@ static int vdpu_debugfs_init(struct mpp_dev *mpp)
dec->debugfs, &dec->aclk_debug);
debugfs_create_u32("session_buffers", 0644,
dec->debugfs, &dec->session_max_buffers_debug);
#endif
if (dec->session_max_buffers_debug)
mpp->session_max_buffers = dec->session_max_buffers_debug;
return 0;
}
#else
static inline int vdpu_debugfs_remove(struct mpp_dev *mpp)
{
return 0;
}
static inline int vdpu_debugfs_init(struct mpp_dev *mpp)
{
return 0;
}
#endif
static int vdpu_init(struct mpp_dev *mpp)
{

View File

@@ -442,13 +442,13 @@ static int vdpu_free_task(struct mpp_session *session,
return 0;
}
#ifdef CONFIG_DEBUG_FS
static int vdpu_debugfs_remove(struct mpp_dev *mpp)
{
#ifdef CONFIG_DEBUG_FS
struct vdpu_dev *dec = to_vdpu_dev(mpp);
debugfs_remove_recursive(dec->debugfs);
#endif
return 0;
}
@@ -458,7 +458,6 @@ static int vdpu_debugfs_init(struct mpp_dev *mpp)
dec->aclk_debug = 0;
dec->session_max_buffers_debug = 0;
#ifdef CONFIG_DEBUG_FS
dec->debugfs = debugfs_create_dir(mpp->dev->of_node->name,
mpp->srv->debugfs);
if (IS_ERR_OR_NULL(dec->debugfs)) {
@@ -470,12 +469,22 @@ static int vdpu_debugfs_init(struct mpp_dev *mpp)
dec->debugfs, &dec->aclk_debug);
debugfs_create_u32("session_buffers", 0644,
dec->debugfs, &dec->session_max_buffers_debug);
#endif
if (dec->session_max_buffers_debug)
mpp->session_max_buffers = dec->session_max_buffers_debug;
return 0;
}
#else
static inline int vdpu_debugfs_remove(struct mpp_dev *mpp)
{
return 0;
}
static inline int vdpu_debugfs_init(struct mpp_dev *mpp)
{
return 0;
}
#endif
static int vdpu_init(struct mpp_dev *mpp)
{

View File

@@ -396,13 +396,13 @@ static int vepu_free_task(struct mpp_session *session,
return 0;
}
#ifdef CONFIG_DEBUG_FS
static int vepu_debugfs_remove(struct mpp_dev *mpp)
{
#ifdef CONFIG_DEBUG_FS
struct vepu_dev *enc = to_vepu_dev(mpp);
debugfs_remove_recursive(enc->debugfs);
#endif
return 0;
}
@@ -412,7 +412,6 @@ static int vepu_debugfs_init(struct mpp_dev *mpp)
enc->aclk_debug = 0;
enc->session_max_buffers_debug = 0;
#ifdef CONFIG_DEBUG_FS
enc->debugfs = debugfs_create_dir(mpp->dev->of_node->name,
mpp->srv->debugfs);
if (IS_ERR_OR_NULL(enc->debugfs)) {
@@ -424,12 +423,22 @@ static int vepu_debugfs_init(struct mpp_dev *mpp)
enc->debugfs, &enc->aclk_debug);
debugfs_create_u32("session_buffers", 0644,
enc->debugfs, &enc->session_max_buffers_debug);
#endif
if (enc->session_max_buffers_debug)
mpp->session_max_buffers = enc->session_max_buffers_debug;
return 0;
}
#else
static inline int vepu_debugfs_remove(struct mpp_dev *mpp)
{
return 0;
}
static inline int vepu_debugfs_init(struct mpp_dev *mpp)
{
return 0;
}
#endif
static int vepu_init(struct mpp_dev *mpp)
{

View File

@@ -407,13 +407,13 @@ static int vepu_free_task(struct mpp_session *session,
return 0;
}
#ifdef CONFIG_DEBUG_FS
static int vepu_debugfs_remove(struct mpp_dev *mpp)
{
#ifdef CONFIG_DEBUG_FS
struct vepu_dev *enc = to_vepu_dev(mpp);
debugfs_remove_recursive(enc->debugfs);
#endif
return 0;
}
@@ -423,7 +423,6 @@ static int vepu_debugfs_init(struct mpp_dev *mpp)
enc->aclk_debug = 0;
enc->session_max_buffers_debug = 0;
#ifdef CONFIG_DEBUG_FS
enc->debugfs = debugfs_create_dir(mpp->dev->of_node->name,
mpp->srv->debugfs);
if (IS_ERR_OR_NULL(enc->debugfs)) {
@@ -435,11 +434,21 @@ static int vepu_debugfs_init(struct mpp_dev *mpp)
enc->debugfs, &enc->aclk_debug);
debugfs_create_u32("session_buffers", 0644,
enc->debugfs, &enc->session_max_buffers_debug);
#endif
if (enc->session_max_buffers_debug)
mpp->session_max_buffers = enc->session_max_buffers_debug;
return 0;
}
#else
static inline int vepu_debugfs_remove(struct mpp_dev *mpp)
{
return 0;
}
static inline int vepu_debugfs_init(struct mpp_dev *mpp)
{
return 0;
}
#endif
static int vepu_init(struct mpp_dev *mpp)
{