]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blob - drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/xnr/xnr_3.0/ia_css_xnr3_param.h
staging/atomisp: Add support for the Intel IPU v2
[mirror_ubuntu-hirsute-kernel.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / isp / kernels / xnr / xnr_3.0 / ia_css_xnr3_param.h
1 /*
2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 2015, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 */
14
15 #ifndef __IA_CSS_XNR3_PARAM_H
16 #define __IA_CSS_XNR3_PARAM_H
17
18 #include "type_support.h"
19 #ifdef ISP2401
20 #include "vmem.h" /* needed for VMEM_ARRAY */
21
22 #endif
23
24 /* Scaling factor of the alpha values: which fixed-point value represents 1.0?
25 * It must be chosen such that 1/min_sigma still fits in an ISP vector
26 * element. */
27 #define XNR_ALPHA_SCALE_LOG2 5
28 #define XNR_ALPHA_SCALE_FACTOR (1 << XNR_ALPHA_SCALE_LOG2)
29
30 /* Scaling factor of the coring values on the ISP. */
31 #define XNR_CORING_SCALE_LOG2 (ISP_VEC_ELEMBITS-1)
32 #define XNR_CORING_SCALE_FACTOR (1 << XNR_CORING_SCALE_LOG2)
33
34 /* Scaling factor of the blending strength on the ISP. */
35 #define XNR_BLENDING_SCALE_LOG2 (ISP_VEC_ELEMBITS-1)
36 #define XNR_BLENDING_SCALE_FACTOR (1 << XNR_BLENDING_SCALE_LOG2)
37
38 /* XNR3 filter size. Must be 11x11, 9x9 or 5x5. */
39 #ifdef FLT_KERNEL_9x9
40 #define XNR_FILTER_SIZE 9
41 #else
42 #ifdef FLT_KERNEL_11x11
43 #define XNR_FILTER_SIZE 11
44 #else
45 #define XNR_FILTER_SIZE 5
46 #endif
47 #endif
48
49 /* XNR3 alpha (1/sigma) parameters on the ISP, expressed as a base (0) value
50 * for dark areas, and a scaled diff towards the value for bright areas. */
51 struct sh_css_xnr3_alpha_params {
52 int32_t y0;
53 int32_t u0;
54 int32_t v0;
55 int32_t ydiff;
56 int32_t udiff;
57 int32_t vdiff;
58 };
59
60 /* XNR3 coring parameters on the ISP, expressed as a base (0) value
61 * for dark areas, and a scaled diff towards the value for bright areas. */
62 struct sh_css_xnr3_coring_params {
63 int32_t u0;
64 int32_t v0;
65 int32_t udiff;
66 int32_t vdiff;
67 };
68
69 /* XNR3 blending strength on the ISP. */
70 struct sh_css_xnr3_blending_params {
71 int32_t strength;
72 };
73
74 /* XNR3 ISP parameters */
75 struct sh_css_isp_xnr3_params {
76 struct sh_css_xnr3_alpha_params alpha;
77 struct sh_css_xnr3_coring_params coring;
78 struct sh_css_xnr3_blending_params blending;
79 };
80
81 #ifdef ISP2401
82 /*
83 * STRUCT sh_css_isp_xnr3_vmem_params
84 * -----------------------------------------------
85 * ISP VMEM parameters
86 */
87 struct sh_css_isp_xnr3_vmem_params {
88 VMEM_ARRAY(x, ISP_VEC_NELEMS);
89 VMEM_ARRAY(a, ISP_VEC_NELEMS);
90 VMEM_ARRAY(b, ISP_VEC_NELEMS);
91 VMEM_ARRAY(c, ISP_VEC_NELEMS);
92 };
93
94
95 #endif
96 #endif /*__IA_CSS_XNR3_PARAM_H */