drivers/gpu/drm/panthor/panthor_device.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panthor/panthor_device.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/panthor/panthor_device.h
Extension
.h
Size
22418 bytes
Lines
702
Domain
Driver Families
Bucket
drivers/gpu
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct panthor_soc_data {
	/** @asn_hash_enable: True if GPU_L2_CONFIG_ASN_HASH_ENABLE must be set. */
	bool asn_hash_enable;

	/** @asn_hash: ASN_HASH values when asn_hash_enable is true. */
	u32 asn_hash[3];
};

/**
 * enum panthor_device_pm_state - PM state
 */
enum panthor_device_pm_state {
	/** @PANTHOR_DEVICE_PM_STATE_SUSPENDED: Device is suspended. */
	PANTHOR_DEVICE_PM_STATE_SUSPENDED = 0,

	/** @PANTHOR_DEVICE_PM_STATE_RESUMING: Device is being resumed. */
	PANTHOR_DEVICE_PM_STATE_RESUMING,

	/** @PANTHOR_DEVICE_PM_STATE_ACTIVE: Device is active. */
	PANTHOR_DEVICE_PM_STATE_ACTIVE,

	/** @PANTHOR_DEVICE_PM_STATE_SUSPENDING: Device is being suspended. */
	PANTHOR_DEVICE_PM_STATE_SUSPENDING,
};

enum panthor_irq_state {
	/** @PANTHOR_IRQ_STATE_ACTIVE: IRQ is active and ready to process events. */
	PANTHOR_IRQ_STATE_ACTIVE = 0,
	/** @PANTHOR_IRQ_STATE_PROCESSING: IRQ is currently processing events. */
	PANTHOR_IRQ_STATE_PROCESSING,
	/** @PANTHOR_IRQ_STATE_SUSPENDED: IRQ is suspended. */
	PANTHOR_IRQ_STATE_SUSPENDED,
	/** @PANTHOR_IRQ_STATE_SUSPENDING: IRQ is being suspended. */
	PANTHOR_IRQ_STATE_SUSPENDING,
};

/**
 * struct panthor_irq - IRQ data
 *
 * Used to automate IRQ handling for the 3 different IRQs we have in this driver.
 */
struct panthor_irq {
	/** @ptdev: Panthor device */
	struct panthor_device *ptdev;

	/** @iomem: CPU mapping of IRQ base address */
	void __iomem *iomem;

	/** @irq: IRQ number. */
	int irq;

	/** @mask: Values to write to xxx_INT_MASK if active. */
	u32 mask;

	/**
	 * @mask_lock: protects modifications to _INT_MASK and @mask.
	 *
	 * In paths where _INT_MASK is updated based on a state
	 * transition/check, it's crucial for the state update/check to be
	 * inside the locked section, otherwise it introduces a race window
	 * leading to potential _INT_MASK inconsistencies.
	 */
	spinlock_t mask_lock;

	/** @state: one of &enum panthor_irq_state reflecting the current state. */
	atomic_t state;
};

/**
 * enum panthor_device_profiling_mode - Profiling state
 */
enum panthor_device_profiling_flags {
	/** @PANTHOR_DEVICE_PROFILING_DISABLED: Profiling is disabled. */
	PANTHOR_DEVICE_PROFILING_DISABLED = 0,

	/** @PANTHOR_DEVICE_PROFILING_CYCLES: Sampling job cycles. */
	PANTHOR_DEVICE_PROFILING_CYCLES = BIT(0),

	/** @PANTHOR_DEVICE_PROFILING_TIMESTAMP: Sampling job timestamp. */
	PANTHOR_DEVICE_PROFILING_TIMESTAMP = BIT(1),

	/** @PANTHOR_DEVICE_PROFILING_ALL: Sampling everything. */
	PANTHOR_DEVICE_PROFILING_ALL =
	PANTHOR_DEVICE_PROFILING_CYCLES |
	PANTHOR_DEVICE_PROFILING_TIMESTAMP,
};

/**
 * struct panthor_device - Panthor device
 */

Annotation

Implementation Notes