drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c- Extension
.c- Size
- 19839 bytes
- Lines
- 701
- 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.
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hmedia/v4l2-mem2mem.hiris_hfi_gen1.hiris_hfi_gen1_defines.hiris_instance.hiris_vdec.hiris_vpu_buffer.h
Detected Declarations
struct iris_hfi_gen1_response_pkt_infofunction Copyrightfunction iris_hfi_gen1_event_seq_changedfunction iris_hfi_gen1_sys_event_notifyfunction iris_hfi_gen1_event_session_errorfunction iris_hfi_gen1_session_event_notifyfunction iris_hfi_gen1_sys_init_donefunction iris_hfi_gen1_sys_get_prop_image_versionfunction iris_hfi_gen1_sys_property_infofunction iris_hfi_gen1_session_etb_donefunction v4l2_m2m_for_each_src_buf_safefunction iris_hfi_gen1_session_ftb_donefunction list_for_each_entryfunction v4l2_m2m_for_each_dst_buf_safefunction iris_hfi_gen1_handle_responsefunction iris_hfi_gen1_flush_debug_queuefunction iris_hfi_gen1_response_handler
Annotated Snippet
struct iris_hfi_gen1_response_pkt_info {
u32 pkt;
u32 pkt_sz;
};
static const struct iris_hfi_gen1_response_pkt_info pkt_infos[] = {
{
.pkt = HFI_MSG_EVENT_NOTIFY,
.pkt_sz = sizeof(struct hfi_msg_event_notify_pkt),
},
{
.pkt = HFI_MSG_SYS_INIT,
.pkt_sz = sizeof(struct hfi_msg_sys_init_done_pkt),
},
{
.pkt = HFI_MSG_SYS_PROPERTY_INFO,
.pkt_sz = sizeof(struct hfi_msg_sys_property_info_pkt),
},
{
.pkt = HFI_MSG_SYS_SESSION_INIT,
.pkt_sz = sizeof(struct hfi_msg_session_init_done_pkt),
},
{
.pkt = HFI_MSG_SYS_SESSION_END,
.pkt_sz = sizeof(struct hfi_msg_session_hdr_pkt),
},
{
.pkt = HFI_MSG_SESSION_LOAD_RESOURCES,
.pkt_sz = sizeof(struct hfi_msg_session_hdr_pkt),
},
{
.pkt = HFI_MSG_SESSION_START,
.pkt_sz = sizeof(struct hfi_msg_session_hdr_pkt),
},
{
.pkt = HFI_MSG_SESSION_STOP,
.pkt_sz = sizeof(struct hfi_msg_session_hdr_pkt),
},
{
.pkt = HFI_MSG_SESSION_EMPTY_BUFFER,
.pkt_sz = sizeof(struct hfi_msg_session_empty_buffer_done_pkt),
},
{
.pkt = HFI_MSG_SESSION_FILL_BUFFER,
.pkt_sz = sizeof(struct hfi_msg_session_fbd_compressed_pkt),
},
{
.pkt = HFI_MSG_SESSION_FLUSH,
.pkt_sz = sizeof(struct hfi_msg_session_flush_done_pkt),
},
{
.pkt = HFI_MSG_SESSION_RELEASE_RESOURCES,
.pkt_sz = sizeof(struct hfi_msg_session_hdr_pkt),
},
{
.pkt = HFI_MSG_SESSION_RELEASE_BUFFERS,
.pkt_sz = sizeof(struct hfi_msg_session_release_buffers_done_pkt),
},
};
static void iris_hfi_gen1_handle_response(struct iris_core *core, void *response)
{
struct hfi_pkt_hdr *hdr = (struct hfi_pkt_hdr *)response;
const struct iris_hfi_gen1_response_pkt_info *pkt_info;
struct device *dev = core->dev;
struct hfi_session_pkt *pkt;
struct iris_inst *inst;
bool found = false;
u32 i;
for (i = 0; i < ARRAY_SIZE(pkt_infos); i++) {
pkt_info = &pkt_infos[i];
if (pkt_info->pkt != hdr->pkt_type)
continue;
found = true;
break;
}
if (!found || hdr->size < pkt_info->pkt_sz) {
dev_err(dev, "bad packet size (%d should be %d, pkt type:%x, found %d)\n",
hdr->size, pkt_info->pkt_sz, hdr->pkt_type, found);
return;
}
switch (hdr->pkt_type) {
case HFI_MSG_SYS_INIT:
iris_hfi_gen1_sys_init_done(core, hdr);
break;
case HFI_MSG_SYS_PROPERTY_INFO:
Annotation
- Immediate include surface: `linux/bitfield.h`, `media/v4l2-mem2mem.h`, `iris_hfi_gen1.h`, `iris_hfi_gen1_defines.h`, `iris_instance.h`, `iris_vdec.h`, `iris_vpu_buffer.h`.
- Detected declarations: `struct iris_hfi_gen1_response_pkt_info`, `function Copyright`, `function iris_hfi_gen1_event_seq_changed`, `function iris_hfi_gen1_sys_event_notify`, `function iris_hfi_gen1_event_session_error`, `function iris_hfi_gen1_session_event_notify`, `function iris_hfi_gen1_sys_init_done`, `function iris_hfi_gen1_sys_get_prop_image_version`, `function iris_hfi_gen1_sys_property_info`, `function iris_hfi_gen1_session_etb_done`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.