drivers/staging/media/atomisp/pci/isp/kernels/ynr/ynr_1.0/ia_css_ynr.host.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/isp/kernels/ynr/ynr_1.0/ia_css_ynr.host.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/pci/isp/kernels/ynr/ynr_1.0/ia_css_ynr.host.c- Extension
.c- Size
- 5823 bytes
- Lines
- 210
- 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_types.hsh_css_defs.hia_css_debug.hsh_css_frac.hbnr/bnr_1.0/ia_css_bnr.host.hia_css_ynr.host.h
Detected Declarations
function ia_css_nr_encodefunction ia_css_yee_encodefunction ia_css_nr_dumpfunction ia_css_yee_dumpfunction ia_css_nr_debug_dtracefunction ia_css_ee_debug_dtracefunction ia_css_init_ynr_state
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
*/
#include "ia_css_types.h"
#include "sh_css_defs.h"
#include "ia_css_debug.h"
#include "sh_css_frac.h"
#include "bnr/bnr_1.0/ia_css_bnr.host.h"
#include "ia_css_ynr.host.h"
const struct ia_css_nr_config default_nr_config = {
16384,
8192,
1280,
0,
0
};
const struct ia_css_ee_config default_ee_config = {
8192,
128,
2048
};
void
ia_css_nr_encode(
struct sh_css_isp_ynr_params *to,
const struct ia_css_nr_config *from,
unsigned int size)
{
(void)size;
/* YNR (Y Noise Reduction) */
to->threshold =
uDIGIT_FITTING(8192U, 16, SH_CSS_BAYER_BITS);
to->gain_all =
uDIGIT_FITTING(from->ynr_gain, 16, SH_CSS_YNR_GAIN_SHIFT);
to->gain_dir =
uDIGIT_FITTING(from->ynr_gain, 16, SH_CSS_YNR_GAIN_SHIFT);
to->threshold_cb =
uDIGIT_FITTING(from->threshold_cb, 16, SH_CSS_BAYER_BITS);
to->threshold_cr =
uDIGIT_FITTING(from->threshold_cr, 16, SH_CSS_BAYER_BITS);
}
void
ia_css_yee_encode(
struct sh_css_isp_yee_params *to,
const struct ia_css_yee_config *from,
unsigned int size)
{
int asiWk1 = (int)from->ee.gain;
int asiWk2 = asiWk1 / 8;
int asiWk3 = asiWk1 / 4;
(void)size;
/* YEE (Y Edge Enhancement) */
to->dirthreshold_s =
min((uDIGIT_FITTING(from->nr.direction, 16, SH_CSS_BAYER_BITS)
<< 1),
SH_CSS_BAYER_MAXVAL);
to->dirthreshold_g =
min((uDIGIT_FITTING(from->nr.direction, 16, SH_CSS_BAYER_BITS)
<< 4),
SH_CSS_BAYER_MAXVAL);
to->dirthreshold_width_log2 =
uFRACTION_BITS_FITTING(8);
to->dirthreshold_width =
1 << to->dirthreshold_width_log2;
to->detailgain =
uDIGIT_FITTING(from->ee.detail_gain, 11,
SH_CSS_YEE_DETAIL_GAIN_SHIFT);
to->coring_s =
(uDIGIT_FITTING(56U, 16, SH_CSS_BAYER_BITS) *
from->ee.threshold) >> 8;
to->coring_g =
(uDIGIT_FITTING(224U, 16, SH_CSS_BAYER_BITS) *
from->ee.threshold) >> 8;
/* 8; // *1.125 ->[s4.8] */
to->scale_plus_s =
(asiWk1 + asiWk2) >> (11 - SH_CSS_YEE_SCALE_SHIFT);
/* 8; // ( * -.25)->[s4.8] */
to->scale_plus_g =
(0 - asiWk3) >> (11 - SH_CSS_YEE_SCALE_SHIFT);
/* 8; // *0.875 ->[s4.8] */
to->scale_minus_s =
(asiWk1 - asiWk2) >> (11 - SH_CSS_YEE_SCALE_SHIFT);
Annotation
- Immediate include surface: `ia_css_types.h`, `sh_css_defs.h`, `ia_css_debug.h`, `sh_css_frac.h`, `bnr/bnr_1.0/ia_css_bnr.host.h`, `ia_css_ynr.host.h`.
- Detected declarations: `function ia_css_nr_encode`, `function ia_css_yee_encode`, `function ia_css_nr_dump`, `function ia_css_yee_dump`, `function ia_css_nr_debug_dtrace`, `function ia_css_ee_debug_dtrace`, `function ia_css_init_ynr_state`.
- 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.