drivers/gpu/drm/xe/xe_oa_types.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_oa_types.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/xe/xe_oa_types.h
Extension
.h
Size
6747 bytes
Lines
272
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 xe_oa_format {
	/** @counter_select: counter select value (see Bspec 52198/60942) */
	u32 counter_select;
	/** @size: record size as written by HW (multiple of 64 byte cachelines) */
	int size;
	/** @type: of enum drm_xe_oa_format_type */
	int type;
	/** @header: 32 or 64 bit report headers */
	enum xe_oa_report_header header;
	/** @counter_size: counter size value (see Bspec 60942) */
	u16 counter_size;
	/** @bc_report: BC report value (see Bspec 60942) */
	u16 bc_report;
};

/** struct xe_oa_regs - Registers for each OA unit */
struct xe_oa_regs {
	u32 base;
	struct xe_reg oa_head_ptr;
	struct xe_reg oa_tail_ptr;
	struct xe_reg oa_buffer;
	struct xe_reg oa_ctx_ctrl;
	struct xe_reg oa_ctrl;
	struct xe_reg oa_debug;
	struct xe_reg oa_status;
	struct xe_reg oa_mmio_trg;
	u32 oa_ctrl_counter_select_mask;
};

/**
 * struct xe_oa_unit - Hardware OA unit
 */
struct xe_oa_unit {
	/** @oa_unit_id: identifier for the OA unit */
	u16 oa_unit_id;

	/** @gt: gt associated with the OA unit */
	struct xe_gt *gt;

	/** @type: Type of OA unit - OAM, OAG etc. */
	enum drm_xe_oa_unit_type type;

	/** @regs: OA registers for programming the OA unit */
	struct xe_oa_regs regs;

	/** @num_engines: number of engines attached to this OA unit */
	u32 num_engines;

	/** @exclusive_stream: The stream currently using the OA unit */
	struct xe_oa_stream *exclusive_stream;
};

/**
 * struct xe_oa_gt - OA per-gt information
 */
struct xe_oa_gt {
	/** @gt_lock: lock protecting create/destroy OA streams */
	struct mutex gt_lock;

	/** @num_oa_units: number of oa units for each gt */
	u32 num_oa_units;

	/** @oa_unit: array of oa_units */
	struct xe_oa_unit *oa_unit;
};

/**
 * struct xe_oa - OA device level information
 */
struct xe_oa {
	/** @xe: back pointer to xe device */
	struct xe_device *xe;

	/** @metrics_kobj: kobj for metrics sysfs */
	struct kobject *metrics_kobj;

	/** @metrics_lock: lock protecting add/remove configs */
	struct mutex metrics_lock;

	/** @metrics_idr: List of dynamic configurations (struct xe_oa_config) */
	struct idr metrics_idr;

	/** @oa_formats: tracks all OA formats across platforms */
	const struct xe_oa_format *oa_formats;

	/** @format_mask: tracks valid OA formats for a platform */
	unsigned long format_mask[BITS_TO_LONGS(__XE_OA_FORMAT_MAX)];

	/** @oa_unit_ids: tracks oa unit ids assigned across gt's */
	u16 oa_unit_ids;

Annotation

Implementation Notes