drivers/staging/media/atomisp/pci/camera/util/src/util.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/camera/util/src/util.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/pci/camera/util/src/util.c- Extension
.c- Size
- 4412 bytes
- Lines
- 186
- 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
ia_css_util.hia_css_frame.hassert_support.hmath_support.hia_css_binary.h
Detected Declarations
function Copyrightfunction ia_css_util_check_vf_infofunction ia_css_util_check_vf_out_infofunction ia_css_util_res_leqfunction ia_css_util_resolution_is_zerofunction ia_css_util_check_resfunction ia_css_util_is_input_format_rawfunction ia_css_util_is_input_format_yuvfunction ia_css_util_check_input
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
*/
#include "ia_css_util.h"
#include <ia_css_frame.h>
#include <assert_support.h>
#include <math_support.h>
/* for ia_css_binary_max_vf_width() */
#include "ia_css_binary.h"
/* MW: Table look-up ??? */
unsigned int ia_css_util_input_format_bpp(
enum atomisp_input_format format,
bool two_ppc)
{
unsigned int rval = 0;
switch (format) {
case ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY:
case ATOMISP_INPUT_FORMAT_YUV420_8:
case ATOMISP_INPUT_FORMAT_YUV422_8:
case ATOMISP_INPUT_FORMAT_RGB_888:
case ATOMISP_INPUT_FORMAT_RAW_8:
case ATOMISP_INPUT_FORMAT_BINARY_8:
case ATOMISP_INPUT_FORMAT_EMBEDDED:
rval = 8;
break;
case ATOMISP_INPUT_FORMAT_YUV420_10:
case ATOMISP_INPUT_FORMAT_YUV422_10:
case ATOMISP_INPUT_FORMAT_RAW_10:
rval = 10;
break;
case ATOMISP_INPUT_FORMAT_YUV420_16:
case ATOMISP_INPUT_FORMAT_YUV422_16:
rval = 16;
break;
case ATOMISP_INPUT_FORMAT_RGB_444:
rval = 4;
break;
case ATOMISP_INPUT_FORMAT_RGB_555:
rval = 5;
break;
case ATOMISP_INPUT_FORMAT_RGB_565:
rval = 65;
break;
case ATOMISP_INPUT_FORMAT_RGB_666:
case ATOMISP_INPUT_FORMAT_RAW_6:
rval = 6;
break;
case ATOMISP_INPUT_FORMAT_RAW_7:
rval = 7;
break;
case ATOMISP_INPUT_FORMAT_RAW_12:
rval = 12;
break;
case ATOMISP_INPUT_FORMAT_RAW_14:
if (two_ppc)
rval = 14;
else
rval = 12;
break;
case ATOMISP_INPUT_FORMAT_RAW_16:
if (two_ppc)
rval = 16;
else
rval = 12;
break;
default:
rval = 0;
break;
}
return rval;
}
int ia_css_util_check_vf_info(
const struct ia_css_frame_info *const info)
{
int err;
unsigned int max_vf_width;
assert(info);
err = ia_css_frame_check_info(info);
if (err)
return err;
max_vf_width = ia_css_binary_max_vf_width();
if (max_vf_width != 0 && info->res.width > max_vf_width * 2)
Annotation
- Immediate include surface: `ia_css_util.h`, `ia_css_frame.h`, `assert_support.h`, `math_support.h`, `ia_css_binary.h`.
- Detected declarations: `function Copyright`, `function ia_css_util_check_vf_info`, `function ia_css_util_check_vf_out_info`, `function ia_css_util_res_leq`, `function ia_css_util_resolution_is_zero`, `function ia_css_util_check_res`, `function ia_css_util_is_input_format_raw`, `function ia_css_util_is_input_format_yuv`, `function ia_css_util_check_input`.
- 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.