drivers/staging/media/atomisp/pci/sh_css_sp.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/sh_css_sp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/pci/sh_css_sp.c- Extension
.c- Size
- 52070 bytes
- Lines
- 1739
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
hmm.hsh_css_sp.hinput_formatter.hdma.hia_css_buffer.hia_css_binary.hsh_css_hrt.hsh_css_defs.hsh_css_internal.hia_css_control.hia_css_debug.hia_css_debug_pipe.hia_css_event_public.hia_css_mmu.hia_css_stream.hia_css_isp_param.hsh_css_params.hsh_css_legacy.hia_css_frame_comm.hia_css_isys.hgdc_device.hassert_support.hsw_event_global.hia_css_event.hmmu_device.hia_css_spctrl.hatomisp_internal.hia_css_isp_configs.hia_css_isp_states.hisp/kernels/ipu2_io_ls/bayer_io_ls/ia_css_bayer_io.host.h
Detected Declarations
function store_sp_group_datafunction copy_isp_stage_to_sp_stagefunction store_sp_stage_datafunction store_sp_per_frame_datafunction sh_css_store_sp_per_frame_datafunction sh_css_sp_get_debug_statefunction sh_css_sp_start_binary_copyfunction sh_css_sp_start_raw_copyfunction sh_css_sp_start_isys_copyfunction sh_css_sp_get_binary_copy_sizefunction sh_css_sp_get_sw_interrupt_valuefunction sh_css_copy_buffer_attr_to_spbufferfunction sh_css_copy_frame_to_spframefunction set_input_frame_bufferfunction set_output_frame_bufferfunction set_view_finder_bufferfunction sh_css_sp_set_if_configsfunction sh_css_sp_program_input_circuitfunction sh_css_sp_configure_sync_genfunction sh_css_sp_configure_prbsfunction sh_css_sp_configure_enable_raw_pool_lockingfunction sh_css_sp_enable_isys_event_queuefunction sh_css_sp_set_disable_continuous_viewfinderfunction sh_css_sp_write_frame_pointersfunction sh_css_sp_init_groupfunction sh_css_stage_write_binary_infofunction copy_isp_mem_if_to_ddrfunction is_sp_stagefunction configure_isp_from_argsfunction initialize_isp_statesfunction initialize_frame_buffer_attributefunction initialize_stage_framesfunction sh_css_sp_init_stagefunction sp_init_stagefunction sp_init_sp_stagefunction sh_css_sp_init_pipelinefunction sh_css_sp_uninit_pipelinefunction sh_css_write_host2sp_commandfunction sh_css_read_host2sp_commandfunction sh_css_init_host2sp_frame_datafunction sh_css_update_host2sp_offline_framefunction sh_css_update_host2sp_mipi_framefunction sh_css_update_host2sp_mipi_metadatafunction sh_css_update_host2sp_num_mipi_framesfunction sh_css_update_host2sp_cont_num_raw_framesfunction sh_css_event_init_irq_maskfunction ia_css_pipe_set_irq_maskfunction ia_css_event_get_irq_mask
Annotated Snippet
if (is_sp_stage(stage)) {
sp_init_sp_stage(stage, pipe_num, two_ppc,
copy_ovrd, if_config_index);
} else {
if ((stage->stage_num != 0) ||
SH_CSS_PIPE_PORT_CONFIG_IS_CONTINUOUS(me->inout_port_config))
tmp_if_config_index = SH_CSS_IF_CONFIG_NOT_NEEDED;
else
tmp_if_config_index = if_config_index;
sp_init_stage(stage, pipe_num,
xnr, tmp_if_config_index, two_ppc);
}
store_sp_stage_data(pipe_id, pipe_num, num);
}
sh_css_sp_group.pipe[thread_id].pipe_config |= (uint32_t)
(me->acquire_isp_each_stage << IA_CSS_ACQUIRE_ISP_POS);
store_sp_group_data();
}
void
sh_css_sp_uninit_pipeline(unsigned int pipe_num)
{
unsigned int thread_id;
ia_css_pipeline_get_sp_thread_id(pipe_num, &thread_id);
/*memset(&sh_css_sp_group.pipe[thread_id], 0, sizeof(struct sh_css_sp_pipeline));*/
sh_css_sp_group.pipe[thread_id].num_stages = 0;
}
bool sh_css_write_host2sp_command(enum host2sp_commands host2sp_command)
{
unsigned int HIVE_ADDR_host_sp_com = sh_css_sp_fw.info.sp.host_sp_com;
unsigned int offset = (unsigned int)offsetof(struct host_sp_communication,
host2sp_command)
/ sizeof(int);
enum host2sp_commands last_cmd = host2sp_cmd_error;
(void)HIVE_ADDR_host_sp_com; /* Suppress warnings in CRUN */
/* Previous command must be handled by SP (by design) */
last_cmd = load_sp_array_uint(host_sp_com, offset);
if (last_cmd != host2sp_cmd_ready)
IA_CSS_ERROR("last host command not handled by SP(%d)", last_cmd);
store_sp_array_uint(host_sp_com, offset, host2sp_command);
return (last_cmd == host2sp_cmd_ready);
}
enum host2sp_commands
sh_css_read_host2sp_command(void)
{
unsigned int HIVE_ADDR_host_sp_com = sh_css_sp_fw.info.sp.host_sp_com;
unsigned int offset = (unsigned int)offsetof(struct host_sp_communication, host2sp_command)
/ sizeof(int);
(void)HIVE_ADDR_host_sp_com; /* Suppress warnings in CRUN */
return (enum host2sp_commands)load_sp_array_uint(host_sp_com, offset);
}
/*
* Frame data is no longer part of the sp_stage structure but part of a
* separate structure. The aim is to make the sp_data struct static
* (it defines a pipeline) and that the dynamic (per frame) data is stored
* separately.
*
* This function must be called first every where were you start constructing
* a new pipeline by defining one or more stages with use of variable
* sh_css_sp_stage. Even the special cases like accelerator and copy_frame
* These have a pipeline of just 1 stage.
*/
void
sh_css_init_host2sp_frame_data(void)
{
/* Clean table */
unsigned int HIVE_ADDR_host_sp_com = sh_css_sp_fw.info.sp.host_sp_com;
(void)HIVE_ADDR_host_sp_com; /* Suppress warnings in CRUN */
/*
* rvanimme: don't clean it to save static frame info line ref_in
* ref_out, and tnr_frames. Once this static data is in a
* separate data struct, this may be enable (but still, there is
* no need for it)
*/
}
/*
* @brief Update the offline frame information in host_sp_communication.
* Refer to "sh_css_sp.h" for more details.
*/
void
Annotation
- Immediate include surface: `hmm.h`, `sh_css_sp.h`, `input_formatter.h`, `dma.h`, `ia_css_buffer.h`, `ia_css_binary.h`, `sh_css_hrt.h`, `sh_css_defs.h`.
- Detected declarations: `function store_sp_group_data`, `function copy_isp_stage_to_sp_stage`, `function store_sp_stage_data`, `function store_sp_per_frame_data`, `function sh_css_store_sp_per_frame_data`, `function sh_css_sp_get_debug_state`, `function sh_css_sp_start_binary_copy`, `function sh_css_sp_start_raw_copy`, `function sh_css_sp_start_isys_copy`, `function sh_css_sp_get_binary_copy_size`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: source implementation candidate.
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.