drivers/staging/media/atomisp/pci/sh_css_param_dvs.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/sh_css_param_dvs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/pci/sh_css_param_dvs.c- Extension
.c- Size
- 8743 bytes
- Lines
- 276
- 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.
- 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/overflow.hsh_css_param_dvs.hassert_support.htype_support.hia_css_err.hia_css_types.hia_css_debug.h
Detected Declarations
function Copyrightfunction init_dvs_6axis_table_from_defaultfunction init_dvs_6axis_table_from_configfunction generate_dvs_6axis_tablefunction generate_dvs_6axis_table_from_configfunction free_dvs_6axis_tablefunction copy_dvs_6axis_tablefunction ia_css_dvs_statistics_get
Annotated Snippet
if (dvs_config_src) {
dvs_config->width_y = width_y = dvs_config_src->width_y;
dvs_config->height_y = height_y = dvs_config_src->height_y;
dvs_config->width_uv = width_uv = dvs_config_src->width_uv;
dvs_config->height_uv = height_uv = dvs_config_src->height_uv;
IA_CSS_LOG("alloc_dvs_6axis_table Y: W %d H %d", width_y, height_y);
} else if (frame_res) {
dvs_config->width_y = width_y = DVS_TABLE_IN_BLOCKDIM_X_LUMA(frame_res->width);
dvs_config->height_y = height_y = DVS_TABLE_IN_BLOCKDIM_Y_LUMA(
frame_res->height);
dvs_config->width_uv = width_uv = DVS_TABLE_IN_BLOCKDIM_X_CHROMA(
frame_res->width /
2); /* UV = Y/2, depens on colour format YUV 4.2.0*/
dvs_config->height_uv = height_uv = DVS_TABLE_IN_BLOCKDIM_Y_CHROMA(
frame_res->height /
2);/* UV = Y/2, depens on colour format YUV 4.2.0*/
IA_CSS_LOG("alloc_dvs_6axis_table Y: W %d H %d", width_y, height_y);
}
/* Generate Y buffers */
dvs_config->xcoords_y = kvmalloc(array3_size(width_y, height_y, sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->xcoords_y) {
IA_CSS_ERROR("out of memory");
err = -ENOMEM;
goto exit;
}
dvs_config->ycoords_y = kvmalloc(array3_size(width_y, height_y, sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->ycoords_y) {
IA_CSS_ERROR("out of memory");
err = -ENOMEM;
goto exit;
}
/* Generate UV buffers */
IA_CSS_LOG("UV W %d H %d", width_uv, height_uv);
dvs_config->xcoords_uv = kvmalloc(array3_size(width_uv, height_uv,
sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->xcoords_uv) {
IA_CSS_ERROR("out of memory");
err = -ENOMEM;
goto exit;
}
dvs_config->ycoords_uv = kvmalloc(array3_size(width_uv, height_uv,
sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->ycoords_uv) {
IA_CSS_ERROR("out of memory");
err = -ENOMEM;
}
exit:
if (err) {
free_dvs_6axis_table(
&dvs_config); /* we might have allocated some memory, release this */
dvs_config = NULL;
}
}
IA_CSS_LEAVE("dvs_config=%p", dvs_config);
return dvs_config;
}
static void
init_dvs_6axis_table_from_default(struct ia_css_dvs_6axis_config *dvs_config,
const struct ia_css_resolution *dvs_offset)
{
unsigned int x, y;
unsigned int width_y = dvs_config->width_y;
unsigned int height_y = dvs_config->height_y;
unsigned int width_uv = dvs_config->width_uv;
unsigned int height_uv = dvs_config->height_uv;
IA_CSS_LOG("Env_X=%d, Env_Y=%d, width_y=%d, height_y=%d",
dvs_offset->width, dvs_offset->height, width_y, height_y);
for (y = 0; y < height_y; y++) {
for (x = 0; x < width_y; x++) {
dvs_config->xcoords_y[y * width_y + x] = (dvs_offset->width + x *
DVS_BLOCKDIM_X) << DVS_COORD_FRAC_BITS;
}
}
for (y = 0; y < height_y; y++) {
for (x = 0; x < width_y; x++) {
dvs_config->ycoords_y[y * width_y + x] = (dvs_offset->height + y *
DVS_BLOCKDIM_Y_LUMA) << DVS_COORD_FRAC_BITS;
Annotation
- Immediate include surface: `linux/overflow.h`, `sh_css_param_dvs.h`, `assert_support.h`, `type_support.h`, `ia_css_err.h`, `ia_css_types.h`, `ia_css_debug.h`.
- Detected declarations: `function Copyright`, `function init_dvs_6axis_table_from_default`, `function init_dvs_6axis_table_from_config`, `function generate_dvs_6axis_table`, `function generate_dvs_6axis_table_from_config`, `function free_dvs_6axis_table`, `function copy_dvs_6axis_table`, `function ia_css_dvs_statistics_get`.
- 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.