diff options
| author | Alan Kwong <akwong@codeaurora.org> | 2016-10-26 12:34:48 -0400 |
|---|---|---|
| committer | Alan Kwong <akwong@codeaurora.org> | 2016-12-14 09:59:58 -0500 |
| commit | 85708a843e8a86fcdc67cd8ab6d0beff1238b3f3 (patch) | |
| tree | d2596cb61d115c126cd320d846d480122eb1b96c /drivers/gpu | |
| parent | 40b9c0ee802c5a963aa448008177dc31b040cb49 (diff) | |
drm/msm/sde: add debugfs entry for vbif
Add debugfs entry for vbif, allowing get/set of default
and dynamic OT settings.
Change-Id: Ia0237aa0befc0c6dee879bb2fca771ee39958321
Signed-off-by: Alan Kwong <akwong@codeaurora.org>
Diffstat (limited to 'drivers/gpu')
| -rw-r--r-- | drivers/gpu/drm/msm/sde/sde_kms.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/msm/sde/sde_kms.h | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/msm/sde/sde_vbif.c | 75 | ||||
| -rw-r--r-- | drivers/gpu/drm/msm/sde/sde_vbif.h | 13 |
4 files changed, 91 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/sde/sde_kms.c b/drivers/gpu/drm/msm/sde/sde_kms.c index 7d67404caef4..75170f3599e3 100644 --- a/drivers/gpu/drm/msm/sde/sde_kms.c +++ b/drivers/gpu/drm/msm/sde/sde_kms.c @@ -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; } @@ -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; diff --git a/drivers/gpu/drm/msm/sde/sde_kms.h b/drivers/gpu/drm/msm/sde/sde_kms.h index 572409bcc218..f3c165e1bfc7 100644 --- a/drivers/gpu/drm/msm/sde/sde_kms.h +++ b/drivers/gpu/drm/msm/sde/sde_kms.h @@ -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]; diff --git a/drivers/gpu/drm/msm/sde/sde_vbif.c b/drivers/gpu/drm/msm/sde/sde_vbif.c index 31ac9f39f62e..b114840d741c 100644 --- a/drivers/gpu/drm/msm/sde/sde_vbif.c +++ b/drivers/gpu/drm/msm/sde/sde_vbif.c @@ -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" @@ -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", S_IRUGO, debugfs_vbif, + (u32 *)&vbif->xin_halt_timeout); + + debugfs_create_u32("default_rd_ot_limit", S_IRUGO, debugfs_vbif, + (u32 *)&vbif->default_ot_rd_limit); + + debugfs_create_u32("default_wr_ot_limit", S_IRUGO, 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, S_IRUGO, debugfs_vbif, + (u64 *)&cfg->pps); + snprintf(vbif_name, sizeof(vbif_name), + "dynamic_ot_rd_%d_ot_limit", j); + debugfs_create_u32(vbif_name, S_IRUGO, 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, S_IRUGO, debugfs_vbif, + (u64 *)&cfg->pps); + snprintf(vbif_name, sizeof(vbif_name), + "dynamic_ot_wr_%d_ot_limit", j); + debugfs_create_u32(vbif_name, S_IRUGO, debugfs_vbif, + (u32 *)&cfg->ot_limit); + } + } + + return 0; +} +#endif diff --git a/drivers/gpu/drm/msm/sde/sde_vbif.h b/drivers/gpu/drm/msm/sde/sde_vbif.h index 4a76acd6a2d4..33f16a867a60 100644 --- a/drivers/gpu/drm/msm/sde/sde_vbif.h +++ b/drivers/gpu/drm/msm/sde/sde_vbif.h @@ -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__ */ |
