GNU Linux-libre 4.14.290-gnu1
[releases.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / isp / kernels / dpc2 / ia_css_dpc2.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_dpc2.host.h"
16 #include "assert_support.h"
17
18 void
19 ia_css_dpc2_encode(
20         struct ia_css_isp_dpc2_params *to,
21         const struct ia_css_dpc2_config *from,
22         size_t size)
23 {
24         (void)size;
25
26         assert ((from->metric1 >= 0) && (from->metric1 <= METRIC1_ONE_FP));
27         assert ((from->metric3 >= 0) && (from->metric3 <= METRIC3_ONE_FP));
28         assert ((from->metric2 >= METRIC2_ONE_FP) &&
29                         (from->metric2 < 256*METRIC2_ONE_FP));
30         assert ((from->wb_gain_gr > 0) && (from->wb_gain_gr < 16*WBGAIN_ONE_FP));
31         assert ((from->wb_gain_r  > 0) && (from->wb_gain_r  < 16*WBGAIN_ONE_FP));
32         assert ((from->wb_gain_b  > 0) && (from->wb_gain_b  < 16*WBGAIN_ONE_FP));
33         assert ((from->wb_gain_gb > 0) && (from->wb_gain_gb < 16*WBGAIN_ONE_FP));
34
35         to->metric1 = from->metric1;
36         to->metric2 = from->metric2;
37         to->metric3 = from->metric3;
38
39         to->wb_gain_gr = from->wb_gain_gr;
40         to->wb_gain_r  = from->wb_gain_r;
41         to->wb_gain_b  = from->wb_gain_b;
42         to->wb_gain_gb = from->wb_gain_gb;
43 }
44
45 /* TODO: AM: This needs a proper implementation. */
46 void
47 ia_css_init_dpc2_state(
48         void *state,
49         size_t size)
50 {
51         (void)state;
52         (void)size;
53 }
54
55 #ifndef IA_CSS_NO_DEBUG
56 /* TODO: AM: This needs a proper implementation. */
57 void
58 ia_css_dpc2_debug_dtrace(
59         const struct ia_css_dpc2_config *config,
60         unsigned level)
61 {
62         (void)config;
63         (void)level;
64 }
65 #endif