drivers/staging/media/atomisp/pci/isp/kernels/dvs/dvs_1.0/ia_css_dvs.host.c

Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/isp/kernels/dvs/dvs_1.0/ia_css_dvs.host.c

File Facts

System
Linux kernel
Corpus path
drivers/staging/media/atomisp/pci/isp/kernels/dvs/dvs_1.0/ia_css_dvs.host.c
Extension
.c
Size
8575 bytes
Lines
288
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.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0
/*
 * Support for Intel Camera Imaging ISP subsystem.
 * Copyright (c) 2015, Intel Corporation.
 */

#include "hmm.h"

#include "ia_css_frame_public.h"
#define IA_CSS_INCLUDE_CONFIGURATIONS
#include "ia_css_isp_configs.h"

#include "ia_css_types.h"
#include "ia_css_host_data.h"
#include "sh_css_param_dvs.h"
#include "sh_css_params.h"
#include "ia_css_binary.h"
#include "ia_css_debug.h"
#include "assert_support.h"

#include "ia_css_dvs.host.h"

static const struct ia_css_dvs_configuration default_config = {
	.info = (struct ia_css_frame_info *)NULL,
};

void
ia_css_dvs_config(
    struct sh_css_isp_dvs_isp_config *to,
    const struct ia_css_dvs_configuration  *from,
    unsigned int size)
{
	(void)size;
	to->num_horizontal_blocks =
	    DVS_NUM_BLOCKS_X(from->info->res.width);
	to->num_vertical_blocks =
	    DVS_NUM_BLOCKS_Y(from->info->res.height);
}

int ia_css_dvs_configure(const struct ia_css_binary     *binary,
			 const struct ia_css_frame_info *info)
{
	struct ia_css_dvs_configuration config = default_config;

	config.info = info;

	return ia_css_configure_dvs(binary, &config);
}

static void
convert_coords_to_ispparams(
    struct ia_css_host_data *gdc_warp_table,
    const struct ia_css_dvs_6axis_config *config,
    unsigned int i_stride,
    unsigned int o_width,
    unsigned int o_height,
    unsigned int uv_flag)
{
	unsigned int i, j;
	gdc_warp_param_mem_t s = { 0 };
	unsigned int x00, x01, x10, x11,
		 y00, y01, y10, y11;

	unsigned int xmin, ymin, xmax, ymax;
	unsigned int topleft_x, topleft_y, bottom_x, bottom_y,
		 topleft_x_frac, topleft_y_frac;
	unsigned int dvs_interp_envelope = (DVS_GDC_INTERP_METHOD == HRT_GDC_BLI_MODE ?
					    DVS_GDC_BLI_INTERP_ENVELOPE : DVS_GDC_BCI_INTERP_ENVELOPE);

	/* number of blocks per height and width */
	unsigned int num_blocks_y =  (uv_flag ? DVS_NUM_BLOCKS_Y_CHROMA(
					  o_height) : DVS_NUM_BLOCKS_Y(o_height));
	unsigned int num_blocks_x =  (uv_flag ? DVS_NUM_BLOCKS_X_CHROMA(
					  o_width)  : DVS_NUM_BLOCKS_X(
					  o_width)); // round num_x up to blockdim_x, if it concerns the Y0Y1 block (uv_flag==0) round up to even

	unsigned int in_stride = i_stride * DVS_INPUT_BYTES_PER_PIXEL;
	unsigned int width, height;
	unsigned int *xbuff = NULL;
	unsigned int *ybuff = NULL;
	struct gdc_warp_param_mem_s *ptr;

	assert(config);
	assert(gdc_warp_table);
	assert(gdc_warp_table->address);

	ptr = (struct gdc_warp_param_mem_s *)gdc_warp_table->address;

	ptr += (2 * uv_flag); /* format is Y0 Y1 UV, so UV starts at 3rd position */

Annotation

Implementation Notes