]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blob - drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/gc/gc_2/ia_css_gc2.host.c
staging/atomisp: Add support for the Intel IPU v2
[mirror_ubuntu-hirsute-kernel.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / isp / kernels / gc / gc_2 / ia_css_gc2.host.c
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 #include "ia_css_types.h"
16 #include "sh_css_defs.h"
17 #ifndef IA_CSS_NO_DEBUG
18 /* FIXME: See BZ 4427 */
19 #include "ia_css_debug.h"
20 #endif
21 #include "csc/csc_1.0/ia_css_csc.host.h"
22 #include "vamem.h"
23
24 #include "ia_css_gc2.host.h"
25
26 const struct ia_css_cc_config default_yuv2rgb_cc_config = {
27 12,
28 {4096, -4096, 4096, 4096, 4096, 0, 4096, -4096, -4096}
29 };
30
31 const struct ia_css_cc_config default_rgb2yuv_cc_config = {
32 13,
33 {2449, 4809, 934, -1382, -2714, 4096, 4096, -3430, -666}
34 };
35
36 void
37 ia_css_yuv2rgb_encode(
38 struct sh_css_isp_csc_params *to,
39 const struct ia_css_cc_config *from,
40 unsigned size)
41 {
42 ia_css_encode_cc(to, from, size);
43 }
44
45 void
46 ia_css_rgb2yuv_encode(
47 struct sh_css_isp_csc_params *to,
48 const struct ia_css_cc_config *from,
49 unsigned size)
50 {
51 ia_css_encode_cc(to, from, size);
52 }
53
54 void
55 ia_css_r_gamma_vamem_encode(
56 struct sh_css_isp_rgb_gamma_vamem_params *to,
57 const struct ia_css_rgb_gamma_table *from,
58 unsigned size)
59 {
60 (void)size;
61 memcpy (&to->gc, &from->data, sizeof(to->gc));
62 }
63
64 void
65 ia_css_g_gamma_vamem_encode(
66 struct sh_css_isp_rgb_gamma_vamem_params *to,
67 const struct ia_css_rgb_gamma_table *from,
68 unsigned size)
69 {
70 (void)size;
71 memcpy (&to->gc, &from->data, sizeof(to->gc));
72 }
73
74 void
75 ia_css_b_gamma_vamem_encode(
76 struct sh_css_isp_rgb_gamma_vamem_params *to,
77 const struct ia_css_rgb_gamma_table *from,
78 unsigned size)
79 {
80 (void)size;
81 memcpy (&to->gc, &from->data, sizeof(to->gc));
82 }
83
84 #ifndef IA_CSS_NO_DEBUG
85 void
86 ia_css_yuv2rgb_dump(
87 const struct sh_css_isp_csc_params *yuv2rgb,
88 unsigned level)
89 {
90 ia_css_cc_dump(yuv2rgb, level, "YUV to RGB Conversion");
91 }
92
93 void
94 ia_css_rgb2yuv_dump(
95 const struct sh_css_isp_csc_params *rgb2yuv,
96 unsigned level)
97 {
98 ia_css_cc_dump(rgb2yuv, level, "RGB to YUV Conversion");
99 }
100
101 void
102 ia_css_rgb_gamma_table_debug_dtrace(
103 const struct ia_css_rgb_gamma_table *config,
104 unsigned level)
105 {
106 (void)config;
107 (void)level;
108 }
109 #endif
110