drivers/media/platform/qcom/venus/hfi.h

Source file repositories/reference/linux-study-clean/drivers/media/platform/qcom/venus/hfi.h

File Facts

System
Linux kernel
Corpus path
drivers/media/platform/qcom/venus/hfi.h
Extension
.h
Size
5379 bytes
Lines
177
Domain
Driver Families
Bucket
drivers/media
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 hfi_buffer_desc {
	u32 buffer_type;
	u32 buffer_size;
	u32 num_buffers;
	u32 device_addr;
	u32 extradata_addr;
	u32 extradata_size;
	u32 response_required;
};

struct hfi_frame_data {
	u32 buffer_type;
	u32 device_addr;
	u32 extradata_addr;
	u64 timestamp;
	u32 flags;
	u32 offset;
	u32 alloc_len;
	u32 filled_len;
	u32 mark_target;
	u32 mark_data;
	u32 clnt_data;
	u32 extradata_size;
};

union hfi_get_property {
	struct hfi_profile_level profile_level;
	struct hfi_buffer_requirements bufreq[HFI_BUFFER_TYPE_MAX];
};

/* HFI events */
#define EVT_SYS_EVENT_CHANGE			1
#define EVT_SYS_WATCHDOG_TIMEOUT		2
#define EVT_SYS_ERROR				3
#define EVT_SESSION_ERROR			4

/* HFI event callback structure */
struct hfi_event_data {
	u32 error;
	u32 height;
	u32 width;
	u32 event_type;
	u32 packet_buffer;
	u32 extradata_buffer;
	u32 tag;
	u32 profile;
	u32 level;
	/* the following properties start appear from v4 onwards */
	u32 bit_depth;
	u32 pic_struct;
	u32 colour_space;
	u32 entropy_mode;
	u32 buf_count;
	struct {
		u32 left, top;
		u32 width, height;
	} input_crop;
};

/* define core states */
#define CORE_UNINIT				0
#define CORE_INIT				1

/* define instance states */
#define INST_UNINIT				2
#define INST_INIT				3
#define INST_LOAD_RESOURCES			4
#define INST_START				5
#define INST_STOP				6
#define INST_RELEASE_RESOURCES			7

struct venus_core;
struct venus_inst;

struct hfi_core_ops {
	void (*event_notify)(struct venus_core *core, u32 event);
};

struct hfi_inst_ops {
	void (*buf_done)(struct venus_inst *inst, unsigned int buf_type,
			 u32 tag, u32 bytesused, u32 data_offset, u32 flags,
			 u32 hfi_flags, u64 timestamp_us);
	void (*event_notify)(struct venus_inst *inst, u32 event,
			     struct hfi_event_data *data);
	void (*flush_done)(struct venus_inst *inst);
};

struct hfi_ops {
	int (*core_init)(struct venus_core *core);
	int (*core_deinit)(struct venus_core *core);

Annotation

Implementation Notes