drivers/staging/media/atomisp/pci/sh_css_defs.h
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/sh_css_defs.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/pci/sh_css_defs.h- Extension
.h- Size
- 14214 bytes
- Lines
- 354
- 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/math.hisp.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#ifndef _SH_CSS_DEFS_H_
#define _SH_CSS_DEFS_H_
#include <linux/math.h>
#include "isp.h"
/*#include "vamem.h"*/ /* Cannot include for VAMEM properties this file is visible on ISP -> pipeline generator */
/* ID's for refcount */
#define IA_CSS_REFCOUNT_PARAM_SET_POOL 0xCAFE0001
#define IA_CSS_REFCOUNT_PARAM_BUFFER 0xCAFE0002
/* Digital Image Stabilization */
#define SH_CSS_DIS_DECI_FACTOR_LOG2 6
/* UV offset: 1:uv=-128...127, 0:uv=0...255 */
#define SH_CSS_UV_OFFSET_IS_0 0
/* Bits of bayer is adjusted as 13 in ISP */
#define SH_CSS_BAYER_BITS 13
/* Max value of bayer data (unsigned 13bit in ISP) */
#define SH_CSS_BAYER_MAXVAL ((1U << SH_CSS_BAYER_BITS) - 1)
/* Bits of yuv in ISP */
#define SH_CSS_ISP_YUV_BITS 8
#define SH_CSS_DP_GAIN_SHIFT 5
#define SH_CSS_BNR_GAIN_SHIFT 13
#define SH_CSS_YNR_GAIN_SHIFT 13
#define SH_CSS_AE_YCOEF_SHIFT 13
#define SH_CSS_AF_FIR_SHIFT 13
#define SH_CSS_YEE_DETAIL_GAIN_SHIFT 8 /* [u5.8] */
#define SH_CSS_YEE_SCALE_SHIFT 8
#define SH_CSS_TNR_COEF_SHIFT 13
#define SH_CSS_MACC_COEF_SHIFT 11 /* [s2.11] for ISP1 */
#define SH_CSS_MACC2_COEF_SHIFT 13 /* [s[exp].[13-exp]] for ISP2 */
#define SH_CSS_DIS_COEF_SHIFT 13
/* enumeration of the bayer downscale factors. When a binary supports multiple
* factors, the OR of these defines is used to build the mask of supported
* factors. The BDS factor is used in pre-processor expressions so we cannot
* use an enum here. */
#define SH_CSS_BDS_FACTOR_1_00 (0)
#define SH_CSS_BDS_FACTOR_1_25 (1)
#define SH_CSS_BDS_FACTOR_1_50 (2)
#define SH_CSS_BDS_FACTOR_2_00 (3)
#define SH_CSS_BDS_FACTOR_2_25 (4)
#define SH_CSS_BDS_FACTOR_2_50 (5)
#define SH_CSS_BDS_FACTOR_3_00 (6)
#define SH_CSS_BDS_FACTOR_4_00 (7)
#define SH_CSS_BDS_FACTOR_4_50 (8)
#define SH_CSS_BDS_FACTOR_5_00 (9)
#define SH_CSS_BDS_FACTOR_6_00 (10)
#define SH_CSS_BDS_FACTOR_8_00 (11)
#define NUM_BDS_FACTORS (12)
#define PACK_BDS_FACTOR(factor) (1 << (factor))
/* Following macros should match with the type enum ia_css_pipe_version in
* ia_css_pipe_public.h. The reason to add these macros is that enum type
* will be evaluted to 0 in preprocessing time. */
#define SH_CSS_ISP_PIPE_VERSION_1 1
#define SH_CSS_ISP_PIPE_VERSION_2_2 2
#define SH_CSS_ISP_PIPE_VERSION_2_6_1 3
#define SH_CSS_ISP_PIPE_VERSION_2_7 4
/*--------------- sRGB Gamma -----------------
CCM : YCgCo[0,8191] -> RGB[0,4095]
sRGB Gamma : RGB [0,4095] -> RGB[0,8191]
CSC : RGB [0,8191] -> YUV[0,8191]
CCM:
Y[0,8191],CgCo[-4096,4095],coef[-8192,8191] -> RGB[0,4095]
sRGB Gamma:
RGB[0,4095] -(interpolation step16)-> RGB[0,255] -(LUT 12bit)-> RGB[0,4095] -> RGB[0,8191]
CSC:
RGB[0,8191],coef[-8192,8191] -> RGB[0,8191]
--------------------------------------------*/
/* Bits of input/output of sRGB Gamma */
#define SH_CSS_RGB_GAMMA_INPUT_BITS 12 /* [0,4095] */
#define SH_CSS_RGB_GAMMA_OUTPUT_BITS 13 /* [0,8191] */
/* Bits of fractional part of interpolation in vamem, [0,4095]->[0,255] */
#define SH_CSS_RGB_GAMMA_FRAC_BITS \
(SH_CSS_RGB_GAMMA_INPUT_BITS - SH_CSS_ISP_RGB_GAMMA_TABLE_SIZE_LOG2)
#define SH_CSS_RGB_GAMMA_ONE BIT(SH_CSS_RGB_GAMMA_FRAC_BITS)
Annotation
- Immediate include surface: `linux/math.h`, `isp.h`.
- 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.