// SPDX-License-Identifier: GPL-2.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 <linux/log2.h> #include "type_support.h" #include "math_support.h" #include "sh_css_defs.h" #include "ia_css_types.h" #include "assert_support.h" #include "ia_css_xnr3.host.h" /* Maximum value for alpha on ISP interface */ #define XNR_MAX_ALPHA … /* Minimum value for sigma on host interface. Lower values translate to * max_alpha. */ #define XNR_MIN_SIGMA … /* * division look-up table * Refers to XNR3.0.5 */ #define XNR3_LOOK_UP_TABLE_POINTS … static const s16 x[XNR3_LOOK_UP_TABLE_POINTS] = …; static const s16 a[XNR3_LOOK_UP_TABLE_POINTS] = …; static const s16 b[XNR3_LOOK_UP_TABLE_POINTS] = …; static const s16 c[XNR3_LOOK_UP_TABLE_POINTS] = …; /* * Default kernel parameters. In general, default is bypass mode or as close * to the ineffective values as possible. Due to the chroma down+upsampling, * perfect bypass mode is not possible for xnr3 filter itself. Instead, the * 'blending' parameter is used to create a bypass. */ const struct ia_css_xnr3_config default_xnr3_config = …; /* * Compute an alpha value for the ISP kernel from sigma value on the host * parameter interface as: alpha_scale * 1/(sigma/sigma_scale) */ static int32_t compute_alpha(int sigma) { … } /* * Compute the scaled coring value for the ISP kernel from the value on the * host parameter interface. */ static int32_t compute_coring(int coring) { … } /* * Compute the scaled blending strength for the ISP kernel from the value on * the host parameter interface. */ static int32_t compute_blending(int strength) { … } void ia_css_xnr3_encode( struct sh_css_isp_xnr3_params *to, const struct ia_css_xnr3_config *from, unsigned int size) { … } /* ISP2401 */ /* (void) = ia_css_xnr3_vmem_encode(*to, *from) * ----------------------------------------------- * VMEM Encode Function to translate UV parameters from userspace into ISP space */ void ia_css_xnr3_vmem_encode( struct sh_css_isp_xnr3_vmem_params *to, const struct ia_css_xnr3_config *from, unsigned int size) { … } /* Dummy Function added as the tool expects it*/ void ia_css_xnr3_debug_dtrace( const struct ia_css_xnr3_config *config, unsigned int level) { … }