drivers/accel/ivpu/vpu_jsm_api.h

Source file repositories/reference/linux-study-clean/drivers/accel/ivpu/vpu_jsm_api.h

File Facts

System
Linux kernel
Corpus path
drivers/accel/ivpu/vpu_jsm_api.h
Extension
.h
Size
57902 bytes
Lines
1759
Domain
Driver Families
Bucket
drivers/accel
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 vpu_job_queue_entry {
	/** Address of VPU commands batch buffer */
	u64 batch_buf_addr;
	/** Job ID */
	u32 job_id;
	/** Flags bit field, see VPU_JOB_FLAGS_* above */
	u32 flags;
	/**
	 * Doorbell ring timestamp taken by KMD from SoC's global system clock, in
	 * microseconds. NPU can convert this value to its own fixed clock's timebase,
	 * to match other profiling timestamps.
	 */
	u64 doorbell_timestamp;
	/** Extra id for job tracking, used only in the firmware perf traces */
	u64 host_tracking_id;
	/** Address of the primary preemption buffer to use for this job */
	u64 primary_preempt_buf_addr;
	/** Size of the primary preemption buffer to use for this job */
	u32 primary_preempt_buf_size;
	/** Size of secondary preemption buffer to use for this job */
	u32 secondary_preempt_buf_size;
	/** Address of secondary preemption buffer to use for this job */
	u64 secondary_preempt_buf_addr;
	u64 reserved_0;
};

/**
 * Inline command format.
 * Inline commands are the commands executed at scheduler level (typically,
 * synchronization directives). Inline command and job objects must be of
 * the same size and have flags field at same offset.
 */
struct vpu_inline_cmd {
	u64 reserved_0;
	/** Inline command type, see VPU_INLINE_CMD_TYPE_* defines. */
	u32 type;
	/** Flags bit field, see VPU_JOB_FLAGS_* above. */
	u32 flags;
	/** Inline command payload. Depends on inline command type. */
	union payload {
		/** Fence (wait and signal) commands' payload. */
		struct fence {
			/** Fence object handle. */
			u64 fence_handle;
			/** User VA of the current fence value. */
			u64 current_value_va;
			/** User VA of the monitored fence value (read-only). */
			u64 monitored_value_va;
			/** Value to wait for or write in fence location. */
			u64 value;
			/** User VA of the log buffer in which to add log entry on completion. */
			u64 log_buffer_va;
			/** NPU private data. */
			u64 npu_private_data;
		} fence;
		/**
		 * Other commands do not have a payload:
		 * Payload definition for future inline commands can be inserted here.
		 */
		u64 reserved_1[6];
	} payload;
};

/**
 * Job queue slots can be populated either with job objects or inline command objects.
 */
union vpu_jobq_slot {
	struct vpu_job_queue_entry job;
	struct vpu_inline_cmd inline_cmd;
};

/**
 * Job queue control registers.
 */
struct vpu_job_queue_header {
	u32 engine_idx;
	u32 head;
	u32 tail;
	u32 flags;
	/** Set to 1 to indicate priority_band field is valid */
	u32 priority_band_valid;
	/**
	 * Priority for the work of this job queue, valid only if the HWS is NOT used
	 * and the @ref priority_band_valid is set to 1. It is applied only during
	 * the @ref VPU_JSM_MSG_REGISTER_DB message processing.
	 * The device firmware might use the priority_band to optimize the power
	 * management logic, but it will not affect the order of jobs.
	 * Available priority bands: @see enum vpu_job_scheduling_priority_band
	 */
	u32 priority_band;

Annotation

Implementation Notes