[Freedreno] [DPU PATCH 06/15] drm/msm: Move debugfs root tracking to dpu

Sean Paul seanpaul at chromium.org
Thu Jun 28 18:28:57 UTC 2018


We don't use it for anything else, so hide it in dpu. A few other
whitespace/trivial fixes to revert dpu changes in msm.

Signed-off-by: Sean Paul <seanpaul at chromium.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 37 ++++++++++---------------
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h |  1 +
 drivers/gpu/drm/msm/msm_drv.c           | 13 ---------
 drivers/gpu/drm/msm/msm_drv.h           |  8 +-----
 4 files changed, 17 insertions(+), 42 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index beba919a6ef6..61eecae15ab3 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -272,46 +272,38 @@ void *dpu_debugfs_create_regset32(const char *name, umode_t mode,
 			regset, &dpu_fops_regset32);
 }
 
-void *dpu_debugfs_get_root(struct dpu_kms *dpu_kms)
-{
-	struct msm_drm_private *priv;
-
-	if (!dpu_kms || !dpu_kms->dev || !dpu_kms->dev->dev_private)
-		return NULL;
-
-	priv = dpu_kms->dev->dev_private;
-	return priv->debug_root;
-}
-
 static int _dpu_debugfs_init(struct dpu_kms *dpu_kms)
 {
 	void *p;
 	int rc;
-	void *debugfs_root;
 
 	p = dpu_hw_util_get_log_mask_ptr();
 
 	if (!dpu_kms || !p)
 		return -EINVAL;
 
-	debugfs_root = dpu_debugfs_get_root(dpu_kms);
-	if (!debugfs_root)
-		return -EINVAL;
+	dpu_kms->debugfs_root = debugfs_create_dir("debug",
+					   dpu_kms->dev->primary->debugfs_root);
+	if (IS_ERR_OR_NULL(dpu_kms->debugfs_root)) {
+		DRM_ERROR("debugfs create_dir failed %ld\n",
+			  PTR_ERR(dpu_kms->debugfs_root));
+		return PTR_ERR(dpu_kms->debugfs_root);
+	}
 
-	rc = dpu_dbg_debugfs_register(debugfs_root);
+	rc = dpu_dbg_debugfs_register(dpu_kms->debugfs_root);
 	if (rc) {
 		DRM_ERROR("failed to reg dpu dbg debugfs: %d\n", rc);
 		return rc;
 	}
 
-	/* allow debugfs_root to be NULL */
-	debugfs_create_x32(DPU_DEBUGFS_HWMASKNAME, 0600, debugfs_root, p);
+	/* allow root to be NULL */
+	debugfs_create_x32(DPU_DEBUGFS_HWMASKNAME, 0600, dpu_kms->debugfs_root, p);
 
-	(void) dpu_debugfs_danger_init(dpu_kms, debugfs_root);
-	(void) dpu_debugfs_vbif_init(dpu_kms, debugfs_root);
-	(void) dpu_debugfs_core_irq_init(dpu_kms, debugfs_root);
+	(void) dpu_debugfs_danger_init(dpu_kms, dpu_kms->debugfs_root);
+	(void) dpu_debugfs_vbif_init(dpu_kms, dpu_kms->debugfs_root);
+	(void) dpu_debugfs_core_irq_init(dpu_kms, dpu_kms->debugfs_root);
 
-	rc = dpu_core_perf_debugfs_init(&dpu_kms->perf, debugfs_root);
+	rc = dpu_core_perf_debugfs_init(&dpu_kms->perf, dpu_kms->debugfs_root);
 	if (rc) {
 		DPU_ERROR("failed to init perf %d\n", rc);
 		return rc;
@@ -327,6 +319,7 @@ static void _dpu_debugfs_destroy(struct dpu_kms *dpu_kms)
 		dpu_debugfs_vbif_destroy(dpu_kms);
 		dpu_debugfs_danger_destroy(dpu_kms);
 		dpu_debugfs_core_irq_destroy(dpu_kms);
+		debugfs_remove_recursive(dpu_kms->debugfs_root);
 	}
 }
 #else
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
index fb4ae84a388a..4f86a51affdc 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
@@ -153,6 +153,7 @@ struct dpu_kms {
 	struct dpu_power_event *power_event;
 
 	/* directory entry for debugfs */
+	struct dentry *debugfs_root;
 	struct dentry *debugfs_danger;
 	struct dentry *debugfs_vbif;
 
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 5181f997f071..bcd001603768 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -16,7 +16,6 @@
  * this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <linux/debugfs.h>
 #include <linux/of_address.h>
 #include <linux/kthread.h>
 #include <uapi/linux/sched/types.h>
@@ -281,8 +280,6 @@ static int msm_drm_uninit(struct device *dev)
 
 	component_unbind_all(dev, ddev);
 
-	debugfs_remove_recursive(priv->debug_root);
-
 	if (mdss && mdss->funcs)
 		mdss->funcs->destroy(ddev);
 
@@ -596,15 +593,6 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
 	if (ret)
 		goto fail;
 
-	priv->debug_root = debugfs_create_dir("debug",
-					ddev->primary->debugfs_root);
-	if (IS_ERR_OR_NULL(priv->debug_root)) {
-		pr_err("debugfs_root create_dir fail, error %ld\n",
-		       PTR_ERR(priv->debug_root));
-		priv->debug_root = NULL;
-		goto fail;
-	}
-
 	/* perform subdriver post initialization */
 	if (kms && kms->funcs && kms->funcs->postinit) {
 		ret = kms->funcs->postinit(kms);
@@ -1091,7 +1079,6 @@ static int msm_pm_resume(struct device *dev)
 		return kms->funcs->pm_resume(dev);
 
 	drm_atomic_helper_resume(ddev, priv->pm_state);
-
 	drm_kms_helper_poll_enable(ddev);
 
 	return 0;
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index da7daacc5eb8..4a2f87fe11a9 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -74,11 +74,10 @@ struct msm_file_private {
 };
 
 enum msm_mdp_plane_property {
-	/* range properties */
 	PLANE_PROP_ZPOS,
 	PLANE_PROP_ALPHA,
 	PLANE_PROP_PREMULTIPLIED,
-	PLANE_PROP_MAX_NUM,
+	PLANE_PROP_MAX_NUM
 };
 
 struct msm_vblank_ctrl {
@@ -238,9 +237,6 @@ struct msm_drm_private {
 
 	/* whether registered and drm_dev_unregister should be called */
 	bool registered;
-
-	/* msm drv debug root node */
-	struct dentry *debug_root;
 };
 
 /* get struct msm_kms * from drm_device * */
@@ -367,7 +363,6 @@ int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev,
 		struct drm_encoder *encoder);
 
 struct msm_dsi;
-
 #ifdef CONFIG_DRM_MSM_DSI
 void __init msm_dsi_register(void);
 void __exit msm_dsi_unregister(void);
@@ -390,7 +385,6 @@ static inline int msm_dsi_modeset_init(struct msm_dsi *msm_dsi,
 
 void __init msm_mdp_register(void);
 void __exit msm_mdp_unregister(void);
-
 void __init msm_dpu_register(void);
 void __exit msm_dpu_unregister(void);
 
-- 
Sean Paul, Software Engineer, Google / Chromium OS



More information about the Freedreno mailing list