include/drm/drm_device.h

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

File Facts

System
Linux kernel
Corpus path
include/drm/drm_device.h
Extension
.h
Size
10447 bytes
Lines
407
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_wedge_task_info {
	/** @pid: pid of the task */
	pid_t pid;
	/** @comm: command name of the task */
	char comm[TASK_COMM_LEN];
};

/**
 * enum switch_power_state - power state of drm device
 */

enum switch_power_state {
	/** @DRM_SWITCH_POWER_ON: Power state is ON */
	DRM_SWITCH_POWER_ON = 0,

	/** @DRM_SWITCH_POWER_OFF: Power state is OFF */
	DRM_SWITCH_POWER_OFF = 1,

	/** @DRM_SWITCH_POWER_CHANGING: Power state is changing */
	DRM_SWITCH_POWER_CHANGING = 2,

	/** @DRM_SWITCH_POWER_DYNAMIC_OFF: Suspended */
	DRM_SWITCH_POWER_DYNAMIC_OFF = 3,
};

/**
 * struct drm_device - DRM device structure
 *
 * This structure represent a complete card that
 * may contain multiple heads.
 */
struct drm_device {
	/** @if_version: Highest interface version set */
	int if_version;

	/** @ref: Object ref-count */
	struct kref ref;

	/** @dev: Device structure of bus-device */
	struct device *dev;

	/**
	 * @dma_dev:
	 *
	 * Device for DMA operations. Only required if the device @dev
	 * cannot perform DMA by itself. Should be NULL otherwise. Call
	 * drm_dev_dma_dev() to get the DMA device instead of using this
	 * field directly. Call drm_dev_set_dma_dev() to set this field.
	 *
	 * DRM devices are sometimes bound to virtual devices that cannot
	 * perform DMA by themselves. Drivers should set this field to the
	 * respective DMA controller.
	 *
	 * Devices on USB and other peripheral busses also cannot perform
	 * DMA by themselves. The @dma_dev field should point the bus
	 * controller that does DMA on behalve of such a device. Required
	 * for importing buffers via dma-buf.
	 *
	 * If set, the DRM core automatically releases the reference on the
	 * device.
	 */
	struct device *dma_dev;

	/**
	 * @managed:
	 *
	 * Managed resources linked to the lifetime of this &drm_device as
	 * tracked by @ref.
	 */
	struct {
		/** @managed.resources: managed resources list */
		struct list_head resources;
		/** @managed.final_kfree: pointer for final kfree() call */
		void *final_kfree;
		/** @managed.lock: protects @managed.resources */
		spinlock_t lock;
	} managed;

	/** @driver: DRM driver managing the device */
	const struct drm_driver *driver;

	/**
	 * @dev_private:
	 *
	 * DRM driver private data. This is deprecated and should be left set to
	 * NULL.
	 *
	 * Instead of using this pointer it is recommended that drivers use
	 * devm_drm_dev_alloc() and embed struct &drm_device in their larger
	 * per-device structure.

Annotation

Implementation Notes