ソースを参照

Merge "disp: msm: sde: update check flags to handle CONFIG_DEBUG_FS"

qctecmdr 5 年 前
コミット
60b0ca7dba
6 ファイル変更48 行追加22 行削除
  1. 3 2
      msm/Makefile
  2. 1 10
      msm/msm_drv.c
  3. 2 0
      msm/sde/sde_crtc.c
  4. 25 2
      msm/sde_dbg.c
  5. 12 7
      msm/sde_dbg.h
  6. 5 1
      msm/sde_rsc.c

+ 3 - 2
msm/Makefile

@@ -45,8 +45,6 @@ msm_drm-$(CONFIG_DRM_MSM_SDE) += sde/sde_crtc.o \
 	sde/sde_connector.o \
 	sde/sde_color_processing.o \
 	sde/sde_vbif.o \
-	sde_dbg.o \
-	sde_dbg_evtlog.o \
 	sde_io_util.o \
 	sde/sde_hw_reg_dma_v1_color_proc.o \
 	sde/sde_hw_color_proc_v4.o \
@@ -82,6 +80,9 @@ msm_drm-$(CONFIG_DRM_MSM_SDE) += sde/sde_crtc.o \
 	sde_vdc_helper.o \
 	sde/sde_hw_rc.o \
 
+msm_drm-$(CONFIG_DEBUG_FS) += sde_dbg.o \
+	sde_dbg_evtlog.o \
+
 msm_drm-$(CONFIG_DRM_SDE_WB) += sde/sde_wb.o \
 	sde/sde_encoder_phys_wb.o \
 

+ 1 - 10
msm/msm_drv.c

@@ -873,16 +873,7 @@ static int msm_drm_component_init(struct device *dev)
 		drm_client_register(&kms->client);
 	}
 
-	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;
-	}
-
-	ret = sde_dbg_debugfs_register(priv->debug_root);
+	ret = sde_dbg_debugfs_register(dev);
 	if (ret) {
 		dev_err(dev, "failed to reg sde dbg debugfs: %d\n", ret);
 		goto fail;

+ 2 - 0
msm/sde/sde_crtc.c

@@ -166,6 +166,7 @@ static void _sde_crtc_deinit_events(struct sde_crtc *sde_crtc)
 		return;
 }
 
+#ifdef CONFIG_DEBUG_FS
 static int _sde_debugfs_fps_status_show(struct seq_file *s, void *data)
 {
 	struct sde_crtc *sde_crtc;
@@ -212,6 +213,7 @@ static int _sde_debugfs_fps_status(struct inode *inode, struct file *file)
 	return single_open(file, _sde_debugfs_fps_status_show,
 			inode->i_private);
 }
+#endif
 
 static ssize_t fps_periodicity_ms_store(struct device *device,
 		struct device_attribute *attr, const char *buf, size_t count)

+ 25 - 2
msm/sde_dbg.c

@@ -6003,14 +6003,37 @@ static const struct file_operations sde_reg_fops = {
 #endif
 };
 
-int sde_dbg_debugfs_register(struct dentry *debugfs_root)
+int sde_dbg_debugfs_register(struct device *dev)
 {
 	static struct sde_dbg_base *dbg = &sde_dbg_base;
 	struct sde_dbg_reg_base *blk_base;
 	char debug_name[80] = "";
+	struct dentry *debugfs_root = NULL;
+	struct platform_device *pdev = to_platform_device(dev);
+	struct drm_device *ddev = platform_get_drvdata(pdev);
+	struct msm_drm_private *priv = NULL;
 
-	if (!debugfs_root)
+	if (!ddev) {
+		pr_err("Invalid drm device node\n");
 		return -EINVAL;
+	}
+
+	priv = ddev->dev_private;
+	if (!priv) {
+		pr_err("Invalid msm drm private node\n");
+		return -EINVAL;
+	}
+
+	debugfs_root = debugfs_create_dir("debug",
+			ddev->primary->debugfs_root);
+	if (IS_ERR_OR_NULL(debugfs_root)) {
+		pr_err("debugfs_root create_dir fail, error %ld\n",
+				PTR_ERR(debugfs_root));
+		priv->debug_root = NULL;
+		return -EINVAL;
+	}
+
+	priv->debug_root = debugfs_root;
 
 	debugfs_create_file("dbg_ctrl", 0600, debugfs_root, NULL,
 			&sde_dbg_ctrl_fops);

+ 12 - 7
msm/sde_dbg.h

@@ -247,10 +247,10 @@ int sde_dbg_init(struct device *dev);
 
 /**
  * sde_dbg_debugfs_register - register entries at the given debugfs dir
- * @debugfs_root:	debugfs root in which to create sde debug entries
+ * @dev:	pointer to device
  * Returns:	0 or -ERROR
  */
-int sde_dbg_debugfs_register(struct dentry *debugfs_root);
+int sde_dbg_debugfs_register(struct device *dev);
 
 /**
  * sde_dbg_destroy - destroy the global sde debug facilities
@@ -404,17 +404,22 @@ static inline ssize_t sde_evtlog_dump_to_buffer(struct sde_dbg_evtlog *evtlog,
 	return 0;
 }
 
+static inline int sde_dbg_dsi_ctrl_register(void __iomem *base,
+		const char *name)
+{
+	return 0;
+}
+
 static inline void sde_dbg_init_dbg_buses(u32 hwversion)
 {
 }
 
-static inline int sde_dbg_init(struct device *dev,
-		struct sde_dbg_power_ctrl *power_ctrl)
+static inline int sde_dbg_init(struct device *dev)
 {
 	return 0;
 }
 
-static inline int sde_dbg_debugfs_register(struct dentry *debugfs_root)
+static inline int sde_dbg_debugfs_register(struct device *dev)
 {
 	return 0;
 }
@@ -423,7 +428,7 @@ static inline void sde_dbg_destroy(void)
 {
 }
 
-static inline void sde_dbg_dump(enum sde_dbg_dump_context,
+static inline void sde_dbg_dump(enum sde_dbg_dump_context mode,
 	const char *name, ...)
 {
 }
@@ -449,7 +454,7 @@ int sde_dbg_register_dsi_ctrl(void __iomem *base, const char *name)
 	return 0;
 }
 
-void sde_dbg_set_sde_top_offset(u32 blk_off)
+static inline void sde_dbg_set_sde_top_offset(u32 blk_off)
 {
 }
 

+ 5 - 1
msm/sde_rsc.c

@@ -1132,7 +1132,6 @@ void sde_rsc_debug_dump(u32 mux_sel)
 	if (rsc->hw_ops.debug_dump)
 		rsc->hw_ops.debug_dump(rsc, mux_sel);
 }
-#endif /* defined(CONFIG_DEBUG_FS) */
 
 static int _sde_debugfs_status_show(struct seq_file *s, void *data)
 {
@@ -1581,6 +1580,11 @@ static void _sde_rsc_init_debugfs(struct sde_rsc_priv *rsc, char *name)
 	debugfs_create_x32("debug_mode", 0600, rsc->debugfs_root,
 							&rsc->debug_mode);
 }
+#else
+static void _sde_rsc_init_debugfs(struct sde_rsc_priv *rsc, char *name)
+{
+}
+#endif /* defined(CONFIG_DEBUG_FS) */
 
 static void sde_rsc_deinit(struct platform_device *pdev,
 					struct sde_rsc_priv *rsc)