drivers/staging/media/atomisp/pci/camera/pipe/src/pipe_binarydesc.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/camera/pipe/src/pipe_binarydesc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/pci/camera/pipe/src/pipe_binarydesc.c- Extension
.c- Size
- 26622 bytes
- Lines
- 836
- 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
linux/kernel.hlinux/math.hia_css_pipe_binarydesc.hia_css_frame_format.hia_css_pipe.hia_css_pipe_util.hia_css_util.hia_css_debug.hsh_css_params.hassert_support.hgdc_device.h
Detected Declarations
function Copyrightfunction ia_css_pipe_get_copy_binarydescfunction ia_css_pipe_get_vfpp_binarydescfunction sh_css_bds_factor_get_fractfunction binarydesc_calculate_bds_factorfunction ia_css_pipe_get_preview_binarydescfunction ia_css_pipe_get_video_binarydescfunction ia_css_pipe_get_yuvscaler_binarydescfunction ia_css_pipe_get_capturepp_binarydescfunction ia_css_pipe_get_primary_binarydescfunction ia_css_pipe_get_pre_gdc_binarydescfunction ia_css_pipe_get_gdc_binarydescfunction ia_css_pipe_get_post_gdc_binarydescfunction ia_css_pipe_get_pre_de_binarydescfunction ia_css_pipe_get_pre_anr_binarydescfunction ia_css_pipe_get_anr_binarydescfunction ia_css_pipe_get_post_anr_binarydescfunction ia_css_pipe_get_ldc_binarydesc
Annotated Snippet
if (cond) {
*bds_factor = i;
return 0;
}
}
/* Throw an error since a suitable bds_factor cannot be found */
return -EINVAL;
}
int ia_css_pipe_get_preview_binarydesc(
struct ia_css_pipe *const pipe,
struct ia_css_binary_descr *preview_descr,
struct ia_css_frame_info *in_info,
struct ia_css_frame_info *bds_out_info,
struct ia_css_frame_info *out_info,
struct ia_css_frame_info *vf_info)
{
int err;
struct ia_css_frame_info *out_infos[IA_CSS_BINARY_MAX_OUTPUT_PORTS];
int mode = IA_CSS_BINARY_MODE_PREVIEW;
unsigned int i;
assert(pipe);
assert(in_info);
assert(out_info);
assert(vf_info);
IA_CSS_ENTER_PRIVATE("");
/*
* Set up the info of the input frame with
* the ISP required resolution
*/
in_info->res = pipe->config.input_effective_res;
in_info->padded_width = in_info->res.width;
in_info->raw_bit_depth = ia_css_pipe_util_pipe_input_format_bpp(pipe);
if (ia_css_util_is_input_format_yuv(pipe->stream->config.input_config.format))
mode = IA_CSS_BINARY_MODE_COPY;
else
in_info->format = IA_CSS_FRAME_FORMAT_RAW;
out_infos[0] = out_info;
for (i = 1; i < IA_CSS_BINARY_MAX_OUTPUT_PORTS; i++)
out_infos[i] = NULL;
pipe_binarydesc_get_offline(pipe, mode,
preview_descr, in_info, out_infos, vf_info);
if (pipe->stream->config.online) {
preview_descr->online = pipe->stream->config.online;
preview_descr->two_ppc =
(pipe->stream->config.pixels_per_clock == 2);
}
preview_descr->stream_format = pipe->stream->config.input_config.format;
/* TODO: Remove this when bds_out_info is available! */
*bds_out_info = *in_info;
if (pipe->extra_config.enable_raw_binning) {
if (pipe->config.bayer_ds_out_res.width != 0 &&
pipe->config.bayer_ds_out_res.height != 0) {
bds_out_info->res.width =
pipe->config.bayer_ds_out_res.width;
bds_out_info->res.height =
pipe->config.bayer_ds_out_res.height;
bds_out_info->padded_width =
pipe->config.bayer_ds_out_res.width;
err =
binarydesc_calculate_bds_factor(in_info->res,
bds_out_info->res,
&preview_descr->required_bds_factor);
if (err)
return err;
} else {
bds_out_info->res.width = in_info->res.width / 2;
bds_out_info->res.height = in_info->res.height / 2;
bds_out_info->padded_width = in_info->padded_width / 2;
preview_descr->required_bds_factor =
SH_CSS_BDS_FACTOR_2_00;
}
} else {
/* TODO: Remove this when bds_out_info->is available! */
bds_out_info->res.width = in_info->res.width;
bds_out_info->res.height = in_info->res.height;
bds_out_info->padded_width = in_info->padded_width;
preview_descr->required_bds_factor = SH_CSS_BDS_FACTOR_1_00;
}
pipe->required_bds_factor = preview_descr->required_bds_factor;
/* bayer ds and fractional ds cannot be enabled at the same time,
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/math.h`, `ia_css_pipe_binarydesc.h`, `ia_css_frame_format.h`, `ia_css_pipe.h`, `ia_css_pipe_util.h`, `ia_css_util.h`, `ia_css_debug.h`.
- Detected declarations: `function Copyright`, `function ia_css_pipe_get_copy_binarydesc`, `function ia_css_pipe_get_vfpp_binarydesc`, `function sh_css_bds_factor_get_fract`, `function binarydesc_calculate_bds_factor`, `function ia_css_pipe_get_preview_binarydesc`, `function ia_css_pipe_get_video_binarydesc`, `function ia_css_pipe_get_yuvscaler_binarydesc`, `function ia_css_pipe_get_capturepp_binarydesc`, `function ia_css_pipe_get_primary_binarydesc`.
- 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.