[Intel-gfx] [PATCH] add debugfs declarations
Ben Gamari
bgamari at gmail.com
Thu Jan 15 03:38:52 CET 2009
add drm_debugfs_node stuct, drm_debugfs_root, debugfs entries to
drm_minor. Also add debugfs function declarations
---
include/drm/drmP.h | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index efa7935..3f45fb7 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
@@ -831,6 +852,8 @@ struct drm_minor {
struct proc_dir_entry *proc_root; /**< proc directory entry */
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;
@@ -1289,6 +1312,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;
@@ -1299,6 +1323,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_DEBUG_FS)
+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.6
More information about the Intel-gfx
mailing list