diff options
Diffstat (limited to 'drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sc/sc_1.0')
4 files changed, 0 insertions, 414 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sc/sc_1.0/ia_css_sc.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sc/sc_1.0/ia_css_sc.host.c deleted file mode 100644 index 565ae45b7541..000000000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sc/sc_1.0/ia_css_sc.host.c +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Support for Intel Camera Imaging ISP subsystem. - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#include "ia_css_types.h" -#include "sh_css_defs.h" -#include "ia_css_debug.h" -#include "assert_support.h" -#ifdef ISP2401 -#include "math_support.h" /* min() */ - -#define IA_CSS_INCLUDE_CONFIGURATIONS -#include "ia_css_isp_configs.h" -#endif - -#include "ia_css_sc.host.h" - -void -ia_css_sc_encode( - struct sh_css_isp_sc_params *to, - struct ia_css_shading_table **from, - unsigned size) -{ - (void)size; - to->gain_shift = (*from)->fraction_bits; -} - -void -ia_css_sc_dump( - const struct sh_css_isp_sc_params *sc, - unsigned level) -{ - if (!sc) return; - ia_css_debug_dtrace(level, "Shading Correction:\n"); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "sc_gain_shift", sc->gain_shift); -} - -#ifdef ISP2401 -void -ia_css_sc_config( - struct sh_css_isp_sc_isp_config *to, - const struct ia_css_sc_configuration *from, - unsigned size) -{ - uint32_t internal_org_x_bqs = from->internal_frame_origin_x_bqs_on_sctbl; - uint32_t internal_org_y_bqs = from->internal_frame_origin_y_bqs_on_sctbl; - uint32_t slice, rest, i; - - (void)size; - - /* The internal_frame_origin_x_bqs_on_sctbl is separated to 8 times of slice_vec. */ - rest = internal_org_x_bqs; - for (i = 0; i < SH_CSS_SC_INTERPED_GAIN_HOR_SLICE_TIMES; i++) { - slice = min(rest, ((uint32_t)ISP_SLICE_NELEMS)); - rest = rest - slice; - to->interped_gain_hor_slice_bqs[i] = slice; - } - - to->internal_frame_origin_y_bqs_on_sctbl = internal_org_y_bqs; -} - -void -ia_css_sc_configure( - const struct ia_css_binary *binary, - uint32_t internal_frame_origin_x_bqs_on_sctbl, - uint32_t internal_frame_origin_y_bqs_on_sctbl) -{ - const struct ia_css_sc_configuration config = { - internal_frame_origin_x_bqs_on_sctbl, - internal_frame_origin_y_bqs_on_sctbl }; - - ia_css_configure_sc(binary, &config); -} - -#endif -/* ------ deprecated(bz675) : from ------ */ -/* It looks like @parameter{} (in *.pipe) is used to generate the process/get/set functions, - for parameters which should be used in the isp kernels. - However, the ia_css_shading_settings structure has a parameter which is used only in the css, - and does not have a parameter which is used in the isp kernels. - Then, I did not use @parameter{} to generate the get/set function - for the ia_css_shading_settings structure. (michie) */ -void -sh_css_get_shading_settings(const struct ia_css_isp_parameters *params, - struct ia_css_shading_settings *settings) -{ - if (settings == NULL) - return; - assert(params != NULL); - - ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, - "ia_css_get_shading_settings() enter: settings=%p\n", settings); - - *settings = params->shading_settings; - - ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, - "ia_css_get_shading_settings() leave: settings.enable_shading_table_conversion=%d\n", - settings->enable_shading_table_conversion); -} - -void -sh_css_set_shading_settings(struct ia_css_isp_parameters *params, - const struct ia_css_shading_settings *settings) -{ - if (settings == NULL) - return; - assert(params != NULL); - - ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, - "ia_css_set_shading_settings() enter: settings.enable_shading_table_conversion=%d\n", - settings->enable_shading_table_conversion); - - params->shading_settings = *settings; - params->shading_settings_changed = true; - - ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, - "ia_css_set_shading_settings() leave: return_void\n"); -} -/* ------ deprecated(bz675) : to ------ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sc/sc_1.0/ia_css_sc.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sc/sc_1.0/ia_css_sc.host.h deleted file mode 100644 index b35ac3e4009b..000000000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sc/sc_1.0/ia_css_sc.host.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Support for Intel Camera Imaging ISP subsystem. - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#ifndef __IA_CSS_SC_HOST_H -#define __IA_CSS_SC_HOST_H - -#include "sh_css_params.h" - -#include "ia_css_sc_types.h" -#include "ia_css_sc_param.h" - -void -ia_css_sc_encode( - struct sh_css_isp_sc_params *to, - struct ia_css_shading_table **from, - unsigned size); - -void -ia_css_sc_dump( - const struct sh_css_isp_sc_params *sc, - unsigned level); - -#ifdef ISP2401 -/* @brief Configure the shading correction. - * @param[out] to Parameters used in the shading correction kernel in the isp. - * @param[in] from Parameters passed from the host. - * @param[in] size Size of the sh_css_isp_sc_isp_config structure. - * - * This function passes the parameters for the shading correction from the host to the isp. - */ -void -ia_css_sc_config( - struct sh_css_isp_sc_isp_config *to, - const struct ia_css_sc_configuration *from, - unsigned size); - -/* @brief Configure the shading correction. - * @param[in] binary The binary, which has the shading correction. - * @param[in] internal_frame_origin_x_bqs_on_sctbl - * X coordinate (in bqs) of the origin of the internal frame on the shading table. - * @param[in] internal_frame_origin_y_bqs_on_sctbl - * Y coordinate (in bqs) of the origin of the internal frame on the shading table. - * - * This function calls the ia_css_configure_sc() function. - * (The ia_css_configure_sc() function is automatically generated in ia_css_isp.configs.c.) - * The ia_css_configure_sc() function calls the ia_css_sc_config() function - * to pass the parameters for the shading correction from the host to the isp. - */ -void -ia_css_sc_configure( - const struct ia_css_binary *binary, - uint32_t internal_frame_origin_x_bqs_on_sctbl, - uint32_t internal_frame_origin_y_bqs_on_sctbl); - -#endif -/* ------ deprecated(bz675) : from ------ */ -void -sh_css_get_shading_settings(const struct ia_css_isp_parameters *params, - struct ia_css_shading_settings *settings); - -void -sh_css_set_shading_settings(struct ia_css_isp_parameters *params, - const struct ia_css_shading_settings *settings); -/* ------ deprecated(bz675) : to ------ */ - -#endif /* __IA_CSS_SC_HOST_H */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sc/sc_1.0/ia_css_sc_param.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sc/sc_1.0/ia_css_sc_param.h deleted file mode 100644 index d997d5137634..000000000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sc/sc_1.0/ia_css_sc_param.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Support for Intel Camera Imaging ISP subsystem. - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#ifndef __IA_CSS_SC_PARAM_H -#define __IA_CSS_SC_PARAM_H - -#include "type_support.h" - -#ifdef ISP2401 -/* To position the shading center grid point on the center of output image, - * one more grid cell is needed as margin. */ -#define SH_CSS_SCTBL_CENTERING_MARGIN 1 - -/* The shading table width and height are the number of grids, not cells. The last grid should be counted. */ -#define SH_CSS_SCTBL_LAST_GRID_COUNT 1 - -/* Number of horizontal grids per color in the shading table. */ -#define _ISP_SCTBL_WIDTH_PER_COLOR(input_width, deci_factor_log2) \ - (ISP_BQ_GRID_WIDTH(input_width, deci_factor_log2) + \ - SH_CSS_SCTBL_CENTERING_MARGIN + SH_CSS_SCTBL_LAST_GRID_COUNT) - -/* Number of vertical grids per color in the shading table. */ -#define _ISP_SCTBL_HEIGHT(input_height, deci_factor_log2) \ - (ISP_BQ_GRID_HEIGHT(input_height, deci_factor_log2) + \ - SH_CSS_SCTBL_CENTERING_MARGIN + SH_CSS_SCTBL_LAST_GRID_COUNT) - -/* Legacy API: Number of horizontal grids per color in the shading table. */ -#define _ISP_SCTBL_LEGACY_WIDTH_PER_COLOR(input_width, deci_factor_log2) \ - (ISP_BQ_GRID_WIDTH(input_width, deci_factor_log2) + SH_CSS_SCTBL_LAST_GRID_COUNT) - -/* Legacy API: Number of vertical grids per color in the shading table. */ -#define _ISP_SCTBL_LEGACY_HEIGHT(input_height, deci_factor_log2) \ - (ISP_BQ_GRID_HEIGHT(input_height, deci_factor_log2) + SH_CSS_SCTBL_LAST_GRID_COUNT) - -#endif -/* SC (Shading Corrction) */ -struct sh_css_isp_sc_params { - int32_t gain_shift; -}; - -#ifdef ISP2401 -/* Number of horizontal slice times for interpolated gain: - * - * The start position of the internal frame does not match the start position of the shading table. - * To get a vector of shading gains (interpolated horizontally and vertically) - * which matches a vector on the internal frame, - * vec_slice is used for 2 adjacent vectors of shading gains. - * The number of shift times by vec_slice is 8. - * Max grid cell bqs to support the shading table centerting: N = 32 - * CEIL_DIV(N-1, ISP_SLICE_NELEMS) = CEIL_DIV(31, 4) = 8 - */ -#define SH_CSS_SC_INTERPED_GAIN_HOR_SLICE_TIMES 8 - -struct sh_css_isp_sc_isp_config { - uint32_t interped_gain_hor_slice_bqs[SH_CSS_SC_INTERPED_GAIN_HOR_SLICE_TIMES]; - uint32_t internal_frame_origin_y_bqs_on_sctbl; -}; - -#endif -#endif /* __IA_CSS_SC_PARAM_H */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sc/sc_1.0/ia_css_sc_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sc/sc_1.0/ia_css_sc_types.h deleted file mode 100644 index 30ce499ac8cf..000000000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sc/sc_1.0/ia_css_sc_types.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Support for Intel Camera Imaging ISP subsystem. - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#ifndef __IA_CSS_SC_TYPES_H -#define __IA_CSS_SC_TYPES_H - -/* @file -* CSS-API header file for Lens Shading Correction (SC) parameters. -*/ - - -/* Number of color planes in the shading table. */ -#define IA_CSS_SC_NUM_COLORS 4 - -/* The 4 colors that a shading table consists of. - * For each color we store a grid of values. - */ -enum ia_css_sc_color { - IA_CSS_SC_COLOR_GR, /** Green on a green-red line */ - IA_CSS_SC_COLOR_R, /** Red */ - IA_CSS_SC_COLOR_B, /** Blue */ - IA_CSS_SC_COLOR_GB /** Green on a green-blue line */ -}; - -/* Lens Shading Correction table. - * - * This describes the color shading artefacts - * introduced by lens imperfections. To correct artefacts, - * bayer values should be multiplied by gains in this table. - * - *------------ deprecated(bz675) : from --------------------------- - * When shading_settings.enable_shading_table_conversion is set as 0, - * this shading table is directly sent to the isp. This table should contain - * the data based on the ia_css_shading_info information filled in the css. - * So, the driver needs to get the ia_css_shading_info information - * from the css, prior to generating the shading table. - * - * When shading_settings.enable_shading_table_conversion is set as 1, - * this shading table is converted in the legacy way in the css - * before it is sent to the isp. - * The driver does not need to get the ia_css_shading_info information. - * - * NOTE: - * The shading table conversion will be removed from the css in the near future, - * because it does not support the bayer scaling by sensor. - * Also, we had better generate the shading table only in one place(AIC). - * At the moment, to support the old driver which assumes the conversion is done in the css, - * shading_settings.enable_shading_table_conversion is set as 1 by default. - *------------ deprecated(bz675) : to --------------------------- - * - * ISP block: SC1 - * ISP1: SC1 is used. - * ISP2: SC1 is used. - */ -struct ia_css_shading_table { - uint32_t enable; /** Set to false for no shading correction. - The data field can be NULL when enable == true */ -/* ------ deprecated(bz675) : from ------ */ - uint32_t sensor_width; /** Native sensor width in pixels. */ - uint32_t sensor_height; /** Native sensor height in lines. - When shading_settings.enable_shading_table_conversion is set - as 0, sensor_width and sensor_height are NOT used. - These are used only in the legacy shading table conversion - in the css, when shading_settings. - enable_shading_table_conversion is set as 1. */ -/* ------ deprecated(bz675) : to ------ */ - uint32_t width; /** Number of data points per line per color. - u8.0, [0,81] */ - uint32_t height; /** Number of lines of data points per color. - u8.0, [0,61] */ - uint32_t fraction_bits; /** Bits of fractional part in the data - points. - u8.0, [0,13] */ - uint16_t *data[IA_CSS_SC_NUM_COLORS]; - /** Table data, one array for each color. - Use ia_css_sc_color to index this array. - u[13-fraction_bits].[fraction_bits], [0,8191] */ -}; - -/* ------ deprecated(bz675) : from ------ */ -/* Shading Correction settings. - * - * NOTE: - * This structure should be removed when the shading table conversion is - * removed from the css. - */ -struct ia_css_shading_settings { - uint32_t enable_shading_table_conversion; /** Set to 0, - if the conversion of the shading table should be disabled - in the css. (default 1) - 0: The shading table is directly sent to the isp. - The shading table should contain the data based on the - ia_css_shading_info information filled in the css. - 1: The shading table is converted in the css, to be fitted - to the shading table definition required in the isp. - NOTE: - Previously, the shading table was always converted in the css - before it was sent to the isp, and this config was not defined. - Currently, the driver is supposed to pass the shading table - which should be directly sent to the isp. - However, some drivers may still pass the shading table which - needs the conversion without setting this config as 1. - To support such an unexpected case for the time being, - enable_shading_table_conversion is set as 1 by default - in the css. */ -}; -/* ------ deprecated(bz675) : to ------ */ - -#ifdef ISP2401 - -/* Shading Correction configuration. - * - * NOTE: The shading table size is larger than or equal to the internal frame size. - */ -struct ia_css_sc_configuration { - uint32_t internal_frame_origin_x_bqs_on_sctbl; /** Origin X (in bqs) of internal frame on shading table. */ - uint32_t internal_frame_origin_y_bqs_on_sctbl; /** Origin Y (in bqs) of internal frame on shading table. */ - /** NOTE: bqs = size in BQ(Bayer Quad) unit. - 1BQ means {Gr,R,B,Gb}(2x2 pixels). - Horizontal 1 bqs corresponds to horizontal 2 pixels. - Vertical 1 bqs corresponds to vertical 2 pixels. */ -}; -#endif - -#endif /* __IA_CSS_SC_TYPES_H */ |