Loading drivers/gpu/drm/msm/sde/sde_kms.c +2 −0 Original line number Diff line number Diff line Loading @@ -293,6 +293,7 @@ static int _sde_debugfs_init(struct sde_kms *sde_kms) SDE_ERROR("failed to create debugfs debug directory\n"); sde_debugfs_danger_init(sde_kms, sde_kms->debugfs_debug); sde_debugfs_vbif_init(sde_kms, sde_kms->debugfs_debug); return 0; } Loading @@ -301,6 +302,7 @@ static void _sde_debugfs_destroy(struct sde_kms *sde_kms) { /* don't need to NULL check debugfs_root */ if (sde_kms) { sde_debugfs_vbif_destroy(sde_kms); sde_debugfs_danger_destroy(sde_kms); debugfs_remove_recursive(sde_kms->debugfs_debug); sde_kms->debugfs_debug = 0; Loading drivers/gpu/drm/msm/sde/sde_kms.h +1 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,7 @@ struct sde_kms { void *debugfs_root; struct dentry *debugfs_debug; struct dentry *debugfs_danger; struct dentry *debugfs_vbif; /* io/register spaces: */ void __iomem *mmio, *vbif[VBIF_MAX]; Loading drivers/gpu/drm/msm/sde/sde_vbif.c +75 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,8 @@ #define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__ #include <linux/debugfs.h> #include "sde_vbif.h" #include "sde_hw_vbif.h" #include "sde_trace.h" Loading Loading @@ -207,3 +209,76 @@ void sde_vbif_set_ot_limit(struct sde_kms *sde_kms, exit: return; } #ifdef CONFIG_DEBUG_FS void sde_debugfs_vbif_destroy(struct sde_kms *sde_kms) { debugfs_remove_recursive(sde_kms->debugfs_vbif); sde_kms->debugfs_vbif = NULL; } int sde_debugfs_vbif_init(struct sde_kms *sde_kms, struct dentry *debugfs_root) { char vbif_name[32]; struct dentry *debugfs_vbif; int i, j; sde_kms->debugfs_vbif = debugfs_create_dir("vbif", sde_kms->debugfs_root); if (!sde_kms->debugfs_vbif) { SDE_ERROR("failed to create vbif debugfs\n"); return -EINVAL; } for (i = 0; i < sde_kms->catalog->vbif_count; i++) { struct sde_vbif_cfg *vbif = &sde_kms->catalog->vbif[i]; snprintf(vbif_name, sizeof(vbif_name), "%d", vbif->id); debugfs_vbif = debugfs_create_dir(vbif_name, sde_kms->debugfs_vbif); debugfs_create_u32("features", 0644, debugfs_vbif, (u32 *)&vbif->features); debugfs_create_u32("xin_halt_timeout", 0444, debugfs_vbif, (u32 *)&vbif->xin_halt_timeout); debugfs_create_u32("default_rd_ot_limit", 0444, debugfs_vbif, (u32 *)&vbif->default_ot_rd_limit); debugfs_create_u32("default_wr_ot_limit", 0444, debugfs_vbif, (u32 *)&vbif->default_ot_wr_limit); for (j = 0; j < vbif->dynamic_ot_rd_tbl.count; j++) { struct sde_vbif_dynamic_ot_cfg *cfg = &vbif->dynamic_ot_rd_tbl.cfg[j]; snprintf(vbif_name, sizeof(vbif_name), "dynamic_ot_rd_%d_pps", j); debugfs_create_u64(vbif_name, 0444, debugfs_vbif, (u64 *)&cfg->pps); snprintf(vbif_name, sizeof(vbif_name), "dynamic_ot_rd_%d_ot_limit", j); debugfs_create_u32(vbif_name, 0444, debugfs_vbif, (u32 *)&cfg->ot_limit); } for (j = 0; j < vbif->dynamic_ot_wr_tbl.count; j++) { struct sde_vbif_dynamic_ot_cfg *cfg = &vbif->dynamic_ot_wr_tbl.cfg[j]; snprintf(vbif_name, sizeof(vbif_name), "dynamic_ot_wr_%d_pps", j); debugfs_create_u64(vbif_name, 0444, debugfs_vbif, (u64 *)&cfg->pps); snprintf(vbif_name, sizeof(vbif_name), "dynamic_ot_wr_%d_ot_limit", j); debugfs_create_u32(vbif_name, 0444, debugfs_vbif, (u32 *)&cfg->ot_limit); } } return 0; } #endif drivers/gpu/drm/msm/sde/sde_vbif.h +13 −0 Original line number Diff line number Diff line Loading @@ -35,4 +35,17 @@ struct sde_vbif_set_ot_params { void sde_vbif_set_ot_limit(struct sde_kms *sde_kms, struct sde_vbif_set_ot_params *params); #ifdef CONFIG_DEBUG_FS int sde_debugfs_vbif_init(struct sde_kms *sde_kms, struct dentry *debugfs_root); void sde_debugfs_vbif_destroy(struct sde_kms *sde_kms); #else static inline int sde_debugfs_vbif_init(struct sde_kms *sde_kms, struct dentry *debugfs_root) { return 0; } static inline void sde_debugfs_vbif_destroy(struct sde_kms *sde_kms) { } #endif #endif /* __SDE_VBIF_H__ */ Loading
drivers/gpu/drm/msm/sde/sde_kms.c +2 −0 Original line number Diff line number Diff line Loading @@ -293,6 +293,7 @@ static int _sde_debugfs_init(struct sde_kms *sde_kms) SDE_ERROR("failed to create debugfs debug directory\n"); sde_debugfs_danger_init(sde_kms, sde_kms->debugfs_debug); sde_debugfs_vbif_init(sde_kms, sde_kms->debugfs_debug); return 0; } Loading @@ -301,6 +302,7 @@ static void _sde_debugfs_destroy(struct sde_kms *sde_kms) { /* don't need to NULL check debugfs_root */ if (sde_kms) { sde_debugfs_vbif_destroy(sde_kms); sde_debugfs_danger_destroy(sde_kms); debugfs_remove_recursive(sde_kms->debugfs_debug); sde_kms->debugfs_debug = 0; Loading
drivers/gpu/drm/msm/sde/sde_kms.h +1 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,7 @@ struct sde_kms { void *debugfs_root; struct dentry *debugfs_debug; struct dentry *debugfs_danger; struct dentry *debugfs_vbif; /* io/register spaces: */ void __iomem *mmio, *vbif[VBIF_MAX]; Loading
drivers/gpu/drm/msm/sde/sde_vbif.c +75 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,8 @@ #define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__ #include <linux/debugfs.h> #include "sde_vbif.h" #include "sde_hw_vbif.h" #include "sde_trace.h" Loading Loading @@ -207,3 +209,76 @@ void sde_vbif_set_ot_limit(struct sde_kms *sde_kms, exit: return; } #ifdef CONFIG_DEBUG_FS void sde_debugfs_vbif_destroy(struct sde_kms *sde_kms) { debugfs_remove_recursive(sde_kms->debugfs_vbif); sde_kms->debugfs_vbif = NULL; } int sde_debugfs_vbif_init(struct sde_kms *sde_kms, struct dentry *debugfs_root) { char vbif_name[32]; struct dentry *debugfs_vbif; int i, j; sde_kms->debugfs_vbif = debugfs_create_dir("vbif", sde_kms->debugfs_root); if (!sde_kms->debugfs_vbif) { SDE_ERROR("failed to create vbif debugfs\n"); return -EINVAL; } for (i = 0; i < sde_kms->catalog->vbif_count; i++) { struct sde_vbif_cfg *vbif = &sde_kms->catalog->vbif[i]; snprintf(vbif_name, sizeof(vbif_name), "%d", vbif->id); debugfs_vbif = debugfs_create_dir(vbif_name, sde_kms->debugfs_vbif); debugfs_create_u32("features", 0644, debugfs_vbif, (u32 *)&vbif->features); debugfs_create_u32("xin_halt_timeout", 0444, debugfs_vbif, (u32 *)&vbif->xin_halt_timeout); debugfs_create_u32("default_rd_ot_limit", 0444, debugfs_vbif, (u32 *)&vbif->default_ot_rd_limit); debugfs_create_u32("default_wr_ot_limit", 0444, debugfs_vbif, (u32 *)&vbif->default_ot_wr_limit); for (j = 0; j < vbif->dynamic_ot_rd_tbl.count; j++) { struct sde_vbif_dynamic_ot_cfg *cfg = &vbif->dynamic_ot_rd_tbl.cfg[j]; snprintf(vbif_name, sizeof(vbif_name), "dynamic_ot_rd_%d_pps", j); debugfs_create_u64(vbif_name, 0444, debugfs_vbif, (u64 *)&cfg->pps); snprintf(vbif_name, sizeof(vbif_name), "dynamic_ot_rd_%d_ot_limit", j); debugfs_create_u32(vbif_name, 0444, debugfs_vbif, (u32 *)&cfg->ot_limit); } for (j = 0; j < vbif->dynamic_ot_wr_tbl.count; j++) { struct sde_vbif_dynamic_ot_cfg *cfg = &vbif->dynamic_ot_wr_tbl.cfg[j]; snprintf(vbif_name, sizeof(vbif_name), "dynamic_ot_wr_%d_pps", j); debugfs_create_u64(vbif_name, 0444, debugfs_vbif, (u64 *)&cfg->pps); snprintf(vbif_name, sizeof(vbif_name), "dynamic_ot_wr_%d_ot_limit", j); debugfs_create_u32(vbif_name, 0444, debugfs_vbif, (u32 *)&cfg->ot_limit); } } return 0; } #endif
drivers/gpu/drm/msm/sde/sde_vbif.h +13 −0 Original line number Diff line number Diff line Loading @@ -35,4 +35,17 @@ struct sde_vbif_set_ot_params { void sde_vbif_set_ot_limit(struct sde_kms *sde_kms, struct sde_vbif_set_ot_params *params); #ifdef CONFIG_DEBUG_FS int sde_debugfs_vbif_init(struct sde_kms *sde_kms, struct dentry *debugfs_root); void sde_debugfs_vbif_destroy(struct sde_kms *sde_kms); #else static inline int sde_debugfs_vbif_init(struct sde_kms *sde_kms, struct dentry *debugfs_root) { return 0; } static inline void sde_debugfs_vbif_destroy(struct sde_kms *sde_kms) { } #endif #endif /* __SDE_VBIF_H__ */