drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c- Extension
.c- Size
- 28870 bytes
- Lines
- 1029
- 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
media/v4l2-mem2mem.hiris_hfi_gen2.hiris_hfi_gen2_defines.hiris_hfi_gen2_packet.hiris_vdec.hiris_vpu_buffer.hiris_vpu_common.h
Detected Declarations
struct iris_hfi_gen2_core_hfi_rangestruct iris_hfi_gen2_inst_hfi_rangestruct iris_hfi_gen2_packet_handlefunction iris_hfi_gen2_buf_type_to_driverfunction iris_hfi_gen2_is_valid_hfi_buffer_typefunction iris_hfi_gen2_is_valid_hfi_portfunction iris_hfi_gen2_get_driver_buffer_flagsfunction iris_hfi_gen2_validate_packet_payloadfunction iris_hfi_gen2_validate_packetfunction iris_hfi_gen2_validate_hdr_packetfunction iris_hfi_gen2_handle_session_infofunction iris_hfi_gen2_handle_session_errorfunction iris_hfi_gen2_handle_system_errorfunction iris_hfi_gen2_handle_system_initfunction iris_hfi_gen2_handle_session_closefunction iris_hfi_gen2_handle_input_bufferfunction v4l2_m2m_for_each_src_buf_safefunction iris_hfi_gen2_handle_output_bufferfunction v4l2_m2m_for_each_dst_buf_safefunction iris_hfi_gen2_handle_dequeue_buffersfunction v4l2_m2m_for_each_src_buf_safefunction v4l2_m2m_for_each_dst_buf_safefunction iris_hfi_gen2_handle_release_internal_bufferfunction list_for_each_entryfunction iris_hfi_gen2_handle_session_stopfunction iris_hfi_gen2_handle_session_bufferfunction iris_hfi_gen2_handle_session_drainfunction iris_hfi_gen2_read_input_subcr_paramsfunction iris_hfi_gen2_handle_src_changefunction iris_hfi_gen2_handle_session_commandfunction iris_hfi_gen2_handle_session_propertyfunction iris_hfi_gen2_handle_image_version_propertyfunction iris_hfi_gen2_handle_system_propertyfunction iris_hfi_gen2_handle_system_responsefunction iris_hfi_gen2_init_src_change_paramfunction iris_hfi_gen2_handle_session_responsefunction iris_hfi_gen2_handle_responsefunction iris_hfi_gen2_flush_debug_queuefunction iris_hfi_gen2_response_handler
Annotated Snippet
struct iris_hfi_gen2_core_hfi_range {
u32 begin;
u32 end;
int (*handle)(struct iris_core *core, struct iris_hfi_packet *pkt);
};
struct iris_hfi_gen2_inst_hfi_range {
u32 begin;
u32 end;
int (*handle)(struct iris_inst *inst, struct iris_hfi_packet *pkt);
};
struct iris_hfi_gen2_packet_handle {
enum hfi_buffer_type type;
int (*handle)(struct iris_inst *inst, struct iris_hfi_packet *pkt);
};
static u32 iris_hfi_gen2_buf_type_to_driver(struct iris_inst *inst,
enum hfi_buffer_type buf_type)
{
switch (buf_type) {
case HFI_BUFFER_BITSTREAM:
return BUF_INPUT;
case HFI_BUFFER_RAW:
return BUF_OUTPUT;
case HFI_BUFFER_BIN:
return BUF_BIN;
case HFI_BUFFER_ARP:
return BUF_ARP;
case HFI_BUFFER_COMV:
return BUF_COMV;
case HFI_BUFFER_NON_COMV:
return BUF_NON_COMV;
case HFI_BUFFER_LINE:
return BUF_LINE;
case HFI_BUFFER_DPB:
if (inst->domain == DECODER)
return BUF_DPB;
else
return BUF_SCRATCH_2;
case HFI_BUFFER_PERSIST:
return BUF_PERSIST;
case HFI_BUFFER_PARTIAL_DATA:
return BUF_PARTIAL;
case HFI_BUFFER_VPSS:
return BUF_VPSS;
default:
return 0;
}
}
static bool iris_hfi_gen2_is_valid_hfi_buffer_type(u32 buffer_type)
{
switch (buffer_type) {
case HFI_BUFFER_BITSTREAM:
case HFI_BUFFER_RAW:
case HFI_BUFFER_BIN:
case HFI_BUFFER_ARP:
case HFI_BUFFER_COMV:
case HFI_BUFFER_NON_COMV:
case HFI_BUFFER_LINE:
case HFI_BUFFER_DPB:
case HFI_BUFFER_PERSIST:
case HFI_BUFFER_VPSS:
case HFI_BUFFER_PARTIAL_DATA:
return true;
default:
return false;
}
}
static bool iris_hfi_gen2_is_valid_hfi_port(u32 port, u32 buffer_type)
{
if (port == HFI_PORT_NONE && buffer_type != HFI_BUFFER_PERSIST)
return false;
if (port != HFI_PORT_BITSTREAM && port != HFI_PORT_RAW)
return false;
return true;
}
static int iris_hfi_gen2_get_driver_buffer_flags(struct iris_inst *inst, u32 hfi_flags)
{
struct iris_inst_hfi_gen2 *inst_hfi_gen2 = to_iris_inst_hfi_gen2(inst);
u32 keyframe = HFI_GEN2_PICTURE_IDR | HFI_GEN2_PICTURE_I |
HFI_GEN2_PICTURE_CRA | HFI_GEN2_PICTURE_BLA;
u32 driver_flags = 0;
if (inst_hfi_gen2->hfi_frame_info.picture_type & HFI_GEN2_PICTURE_NOSHOW)
Annotation
- Immediate include surface: `media/v4l2-mem2mem.h`, `iris_hfi_gen2.h`, `iris_hfi_gen2_defines.h`, `iris_hfi_gen2_packet.h`, `iris_vdec.h`, `iris_vpu_buffer.h`, `iris_vpu_common.h`.
- Detected declarations: `struct iris_hfi_gen2_core_hfi_range`, `struct iris_hfi_gen2_inst_hfi_range`, `struct iris_hfi_gen2_packet_handle`, `function iris_hfi_gen2_buf_type_to_driver`, `function iris_hfi_gen2_is_valid_hfi_buffer_type`, `function iris_hfi_gen2_is_valid_hfi_port`, `function iris_hfi_gen2_get_driver_buffer_flags`, `function iris_hfi_gen2_validate_packet_payload`, `function iris_hfi_gen2_validate_packet`, `function iris_hfi_gen2_validate_hdr_packet`.
- 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.