[Intel-gfx] [PATCH] add debugfs declarations

Ben Gamari bgamari at gmail.com
Thu Jan 15 01:27:54 CET 2009


---
 include/drm/drmP.h |   38 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index efe50b6..1484797 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -800,6 +800,27 @@ struct drm_driver {
 #define DRM_MINOR_CONTROL 2
 #define DRM_MINOR_RENDER 3
 
+
+/**
+ * debugfs node list. This structure represents a debugfs file to
+ * be created by the drm core
+ */
+struct drm_debugfs_list {
+        const char *name; /** file name */
+        int (*show)(struct seq_file*, void*); /** show callback*/
+        u32 driver_features; /**< Required driver features for this entry */
+};
+
+/**
+ * debugfs node structure. This structure represents a debugfs file.
+ */
+struct drm_debugfs_node {
+        struct list_head list;
+        struct drm_minor *minor;
+        struct drm_debugfs_list *debugfs_ent;
+        struct dentry *dent;  
+};
+
 /**
  * proc node list. This structure represents a debugfs file to
  * be created by the drm core
@@ -830,7 +851,9 @@ struct drm_minor {
 	struct drm_device *dev;
 
 	struct proc_dir_entry *proc_root;  /**< proc directory entry */
-  struct drm_proc_node proc_nodes;
+	struct drm_proc_node proc_nodes;
+	struct dentry *debugfs_root;
+	struct drm_debugfs_node debugfs_nodes;
 
 	struct drm_master *master; /* currently active master for this node */
 	struct list_head master_list;
@@ -1288,6 +1311,7 @@ extern unsigned int drm_debug;
 
 extern struct class *drm_class;
 extern struct proc_dir_entry *drm_proc_root;
+extern struct dentry *drm_debugfs_root;
 
 extern struct idr drm_minors_idr;
 
@@ -1298,6 +1322,18 @@ extern int drm_proc_init(struct drm_minor *minor, int minor_id,
 			 struct proc_dir_entry *root);
 extern int drm_proc_cleanup(struct drm_minor *minor, struct proc_dir_entry *root);
 
+                                /* Debugfs support */
+#if defined(CONFIG_DRM_DEBUGFS)
+extern int drm_debugfs_init(struct drm_minor *minor, int minor_id,
+                            struct dentry *root);
+extern int drm_debugfs_create_files(struct drm_debugfs_list *files, int count,
+                                    struct dentry *root,
+                                    struct drm_minor *minor);
+extern int drm_debugfs_remove_files(struct drm_debugfs_list *files, int count,
+                                    struct drm_minor *minor);
+extern int drm_debugfs_cleanup(struct drm_minor *minor);
+#endif
+
 				/* Scatter Gather Support (drm_scatter.h) */
 extern void drm_sg_cleanup(struct drm_sg_mem * entry);
 extern int drm_sg_alloc_ioctl(struct drm_device *dev, void *data,
-- 
1.6.0.5




More information about the Intel-gfx mailing list