include/drm/drm_debugfs.h

Source file repositories/reference/linux-study-clean/include/drm/drm_debugfs.h

File Facts

System
Linux kernel
Corpus path
include/drm/drm_debugfs.h
Extension
.h
Size
6076 bytes
Lines
198
Domain
Repository Root And Misc
Bucket
include
Inferred role
Repository Root And Misc: implementation source
Status
source implementation candidate

Why This File Exists

Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.

Dependency Surface

Detected Declarations

Annotated Snippet

struct drm_info_list {
	/** @name: file name */
	const char *name;
	/**
	 * @show:
	 *
	 * Show callback. &seq_file->private will be set to the &struct
	 * drm_info_node corresponding to the instance of this info on a given
	 * &struct drm_minor.
	 */
	int (*show)(struct seq_file*, void*);
	/** @driver_features: Required driver features for this entry */
	u32 driver_features;
	/** @data: Driver-private data, should not be device-specific. */
	void *data;
};

/**
 * struct drm_info_node - Per-minor debugfs node structure
 *
 * This structure represents a debugfs file, as an instantiation of a &struct
 * drm_info_list on a &struct drm_minor.
 *
 * FIXME:
 *
 * No it doesn't make a hole lot of sense that we duplicate debugfs entries for
 * both the render and the primary nodes, but that's how this has organically
 * grown. It should probably be fixed, with a compatibility link, if needed.
 */
struct drm_info_node {
	/** @minor: &struct drm_minor for this node. */
	struct drm_minor *minor;
	/** @info_ent: template for this node. */
	const struct drm_info_list *info_ent;
	/* private: */
	struct list_head list;
	struct dentry *dent;
};

/**
 * struct drm_debugfs_info - debugfs info list entry
 *
 * This structure represents a debugfs file to be created by the drm
 * core.
 */
struct drm_debugfs_info {
	/** @name: File name */
	const char *name;

	/**
	 * @show:
	 *
	 * Show callback. &seq_file->private will be set to the &struct
	 * drm_debugfs_entry corresponding to the instance of this info
	 * on a given &struct drm_device.
	 */
	int (*show)(struct seq_file*, void*);

	/** @driver_features: Required driver features for this entry. */
	u32 driver_features;

	/** @data: Driver-private data, should not be device-specific. */
	void *data;
};

/**
 * struct drm_debugfs_entry - Per-device debugfs node structure
 *
 * This structure represents a debugfs file, as an instantiation of a &struct
 * drm_debugfs_info on a &struct drm_device.
 */
struct drm_debugfs_entry {
	/** @dev: &struct drm_device for this node. */
	struct drm_device *dev;

	/** @file: Template for this node. */
	struct drm_debugfs_info file;

	/** @list: Linked list of all device nodes. */
	struct list_head list;
};

#if defined(CONFIG_DEBUG_FS)
void drm_debugfs_create_files(const struct drm_info_list *files,
			      int count, struct dentry *root,
			      struct drm_minor *minor);
int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
			     struct dentry *root, struct drm_minor *minor);

void drm_debugfs_add_file(struct drm_device *dev, const char *name,

Annotation

Implementation Notes