[Freedreno] [DPU PATCH 08/15] drm/msm: dpu: Do debugfs init in the debugfs_init() hook

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


This allows us to remove postinit, which was added with dpu support.

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

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index 61eecae15ab3..1f2163430caf 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -323,11 +323,6 @@ static void _dpu_debugfs_destroy(struct dpu_kms *dpu_kms)
 	}
 }
 #else
-static int _dpu_debugfs_init(struct dpu_kms *dpu_kms)
-{
-	return 0;
-}
-
 static void _dpu_debugfs_destroy(struct dpu_kms *dpu_kms)
 {
 }
@@ -991,7 +986,8 @@ void dpu_kms_fbo_unreference(struct dpu_kms_fbo *fbo)
 	}
 }
 
-static int dpu_kms_postinit(struct msm_kms *kms)
+#ifdef CONFIG_DEBUG_FS
+static int dpu_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor)
 {
 	struct dpu_kms *dpu_kms = to_dpu_kms(kms);
 	struct drm_device *dev;
@@ -1010,6 +1006,7 @@ static int dpu_kms_postinit(struct msm_kms *kms)
 
 	return rc;
 }
+#endif
 
 static long dpu_kms_round_pixclk(struct msm_kms *kms, unsigned long rate,
 		struct drm_encoder *encoder)
@@ -1289,7 +1286,6 @@ void _dpu_kms_set_encoder_mode(struct msm_kms *kms,
 
 static const struct msm_kms_funcs kms_funcs = {
 	.hw_init         = dpu_kms_hw_init,
-	.postinit        = dpu_kms_postinit,
 	.irq_preinstall  = dpu_irq_preinstall,
 	.irq_postinstall = dpu_irq_postinstall,
 	.irq_uninstall   = dpu_irq_uninstall,
@@ -1311,6 +1307,9 @@ static const struct msm_kms_funcs kms_funcs = {
 	.destroy         = dpu_kms_destroy,
 	.get_address_space = _dpu_kms_get_address_space,
 	.set_encoder_mode = _dpu_kms_set_encoder_mode,
+#ifdef CONFIG_DEBUG_FS
+	.debugfs_init    = dpu_kms_debugfs_init,
+#endif
 };
 
 /* the caller api needs to turn on clock before calling it */
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index bcd001603768..1e8d67381b5a 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -593,15 +593,6 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
 	if (ret)
 		goto fail;
 
-	/* perform subdriver post initialization */
-	if (kms && kms->funcs && kms->funcs->postinit) {
-		ret = kms->funcs->postinit(kms);
-		if (ret) {
-			pr_err("kms post init failed: %d\n", ret);
-			goto fail;
-		}
-	}
-
 	drm_kms_helper_poll_init(ddev);
 
 	return 0;
diff --git a/drivers/gpu/drm/msm/msm_kms.h b/drivers/gpu/drm/msm/msm_kms.h
index 3a583ee2f27a..2f1c9702b820 100644
--- a/drivers/gpu/drm/msm/msm_kms.h
+++ b/drivers/gpu/drm/msm/msm_kms.h
@@ -34,7 +34,6 @@
 struct msm_kms_funcs {
 	/* hw initialization: */
 	int (*hw_init)(struct msm_kms *kms);
-	int (*postinit)(struct msm_kms *kms);
 	/* irq handling: */
 	void (*irq_preinstall)(struct msm_kms *kms);
 	int (*irq_postinstall)(struct msm_kms *kms);
-- 
Sean Paul, Software Engineer, Google / Chromium OS



More information about the Freedreno mailing list