drivers/staging/media/atomisp/pci/atomisp_fops.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/atomisp_fops.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/pci/atomisp_fops.c- Extension
.c- Size
- 16250 bytes
- Lines
- 569
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/pm_runtime.hmedia/v4l2-ioctl.hmedia/videobuf2-vmalloc.hatomisp_cmd.hatomisp_common.hatomisp_fops.hatomisp_internal.hatomisp_ioctl.hatomisp_compat.hatomisp_subdev.hatomisp_v4l2.hatomisp-regs.hhmm/hmm.hia_css_frame.htype_support.hdevice_access/device_access.h
Detected Declarations
function Copyrightfunction atomisp_buf_initfunction atomisp_q_one_metadata_bufferfunction atomisp_q_one_s3a_bufferfunction atomisp_q_one_dis_bufferfunction atomisp_q_video_buffers_to_cssfunction atomisp_qbuffers_to_cssfunction atomisp_buf_queuefunction atomisp_buf_cleanupfunction atomisp_dev_init_structfunction atomisp_subdev_init_structfunction atomisp_openfunction atomisp_release
Annotated Snippet
if (param) {
atomisp_makeup_css_parameters(asd,
&asd->params.css_param.update_flag,
¶m->params);
atomisp_apply_css_parameters(asd, ¶m->params);
if (param->params.update_flag.dz_config &&
asd->run_mode->val != ATOMISP_RUN_MODE_VIDEO) {
err = atomisp_calculate_real_zoom_region(asd,
¶m->params.dz_config, css_pipe_id);
if (!err)
asd->params.config.dz_config = ¶m->params.dz_config;
}
atomisp_css_set_isp_config_applied_frame(asd, frame);
atomisp_css_update_isp_params_on_pipe(asd,
asd->stream_env[stream_id].pipes[css_pipe_id]);
asd->params.dvs_6axis = (struct ia_css_dvs_6axis_config *)
param->params.dvs_6axis;
/*
* WORKAROUND:
* Because the camera halv3 can't ensure to set zoom
* region to per_frame setting and global setting at
* same time and only set zoom region to pre_frame
* setting now.so when the pre_frame setting include
* zoom region,I will set it to global setting.
*/
if (param->params.update_flag.dz_config &&
asd->run_mode->val != ATOMISP_RUN_MODE_VIDEO
&& !err) {
memcpy(&asd->params.css_param.dz_config,
¶m->params.dz_config,
sizeof(struct ia_css_dz_config));
asd->params.css_param.update_flag.dz_config =
(struct atomisp_dz_config *)
&asd->params.css_param.dz_config;
asd->params.css_update_params_needed = true;
}
pipe->frame_params[frame->vb.vb2_buf.index] = NULL;
}
/* Enqueue buffer */
err = atomisp_q_video_buffer_to_css(asd, frame, stream_id,
css_buf_type, css_pipe_id);
if (err) {
spin_lock_irqsave(&pipe->irq_lock, irqflags);
list_move_tail(&frame->queue, &pipe->activeq);
spin_unlock_irqrestore(&pipe->irq_lock, irqflags);
dev_err(asd->isp->dev, "%s, css q fails: %d\n",
__func__, err);
return -EINVAL;
}
/* enqueue 3A/DIS/metadata buffers */
if (asd->params.curr_grid_info.s3a_grid.enable &&
css_pipe_id == asd->params.s3a_enabled_pipe &&
css_buf_type == IA_CSS_BUFFER_TYPE_OUTPUT_FRAME)
atomisp_q_one_s3a_buffer(asd, stream_id,
css_pipe_id);
if (asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL].stream_info.
metadata_info.size &&
css_buf_type == IA_CSS_BUFFER_TYPE_OUTPUT_FRAME)
atomisp_q_one_metadata_buffer(asd, stream_id,
css_pipe_id);
if (dvs_grid && dvs_grid->enable &&
css_pipe_id == IA_CSS_PIPE_ID_VIDEO &&
css_buf_type == IA_CSS_BUFFER_TYPE_OUTPUT_FRAME)
atomisp_q_one_dis_buffer(asd, stream_id,
css_pipe_id);
}
return 0;
}
/* queue all available buffers to css */
int atomisp_qbuffers_to_css(struct atomisp_sub_device *asd)
{
enum ia_css_pipe_id pipe_id;
if (asd->copy_mode) {
pipe_id = IA_CSS_PIPE_ID_COPY;
} else if (asd->vfpp->val == ATOMISP_VFPP_DISABLE_SCALER) {
pipe_id = IA_CSS_PIPE_ID_VIDEO;
} else if (asd->vfpp->val == ATOMISP_VFPP_DISABLE_LOWLAT) {
pipe_id = IA_CSS_PIPE_ID_CAPTURE;
} else if (asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO) {
pipe_id = IA_CSS_PIPE_ID_VIDEO;
} else if (asd->run_mode->val == ATOMISP_RUN_MODE_PREVIEW) {
pipe_id = IA_CSS_PIPE_ID_PREVIEW;
Annotation
- Immediate include surface: `linux/module.h`, `linux/pm_runtime.h`, `media/v4l2-ioctl.h`, `media/videobuf2-vmalloc.h`, `atomisp_cmd.h`, `atomisp_common.h`, `atomisp_fops.h`, `atomisp_internal.h`.
- Detected declarations: `function Copyright`, `function atomisp_buf_init`, `function atomisp_q_one_metadata_buffer`, `function atomisp_q_one_s3a_buffer`, `function atomisp_q_one_dis_buffer`, `function atomisp_q_video_buffers_to_css`, `function atomisp_qbuffers_to_css`, `function atomisp_buf_queue`, `function atomisp_buf_cleanup`, `function atomisp_dev_init_struct`.
- Atlas domain: Driver Families / drivers/staging.
- 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.