drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c

Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c

File Facts

System
Linux kernel
Corpus path
drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c
Extension
.c
Size
21948 bytes
Lines
770
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.

Dependency Surface

Detected Declarations

Annotated Snippet

if (s->mode == mode) {
			*stage = s;
			return 0;
		}
	}
	return -EINVAL;
}

int ia_css_pipeline_get_stage_from_fw(struct ia_css_pipeline
	*pipeline,
	u32 fw_handle,
	struct ia_css_pipeline_stage **stage)
{
	struct ia_css_pipeline_stage *s;

	assert(pipeline);
	assert(stage);
	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "%s()\n", __func__);
	for (s = pipeline->stages; s; s = s->next) {
		if ((s->firmware) && (s->firmware->handle == fw_handle)) {
			*stage = s;
			return 0;
		}
	}
	return -EINVAL;
}

int ia_css_pipeline_get_fw_from_stage(struct ia_css_pipeline
	*pipeline,
	u32 stage_num,
	uint32_t *fw_handle)
{
	struct ia_css_pipeline_stage *s;

	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "%s()\n", __func__);
	if ((!pipeline) || (!fw_handle))
		return -EINVAL;

	for (s = pipeline->stages; s; s = s->next) {
		if ((s->stage_num == stage_num) && (s->firmware)) {
			*fw_handle = s->firmware->handle;
			return 0;
		}
	}
	return -EINVAL;
}

int ia_css_pipeline_get_output_stage(
    struct ia_css_pipeline *pipeline,
    int mode,
    struct ia_css_pipeline_stage **stage)
{
	struct ia_css_pipeline_stage *s;

	assert(pipeline);
	assert(stage);
	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
			    "ia_css_pipeline_get_output_stage() enter:\n");

	*stage = NULL;
	/* First find acceleration firmware at end of pipe */
	for (s = pipeline->stages; s; s = s->next) {
		if (s->firmware && s->mode == mode &&
		    s->firmware->info.isp.sp.enable.output)
			*stage = s;
	}
	if (*stage)
		return 0;
	/* If no firmware, find binary in pipe */
	return ia_css_pipeline_get_stage(pipeline, mode, stage);
}

bool ia_css_pipeline_has_stopped(struct ia_css_pipeline *pipeline)
{
	/* Android compilation files if made an local variable
	stack size on android is limited to 2k and this structure
	is around 2.5K, in place of static malloc can be done but
	if this call is made too often it will lead to fragment memory
	versus a fixed allocation */
	static struct sh_css_sp_group sp_group;
	unsigned int thread_id;
	const struct ia_css_fw_info *fw;
	unsigned int HIVE_ADDR_sp_group;

	fw = &sh_css_sp_fw;
	HIVE_ADDR_sp_group = fw->info.sp.group;

	ia_css_pipeline_get_sp_thread_id(pipeline->pipe_num, &thread_id);
	sp_dmem_load(SP0_ID,
		     (unsigned int)sp_address_of(sp_group),

Annotation

Implementation Notes