aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/dpc2/ia_css_dpc2.host.c
blob: bc14b85cf952767b1654b921b986deeb0d0bd9a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
 * 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_dpc2.host.h"
#include "assert_support.h"

void
ia_css_dpc2_encode(
	struct ia_css_isp_dpc2_params *to,
	const struct ia_css_dpc2_config *from,
	size_t size)
{
	(void)size;

	assert ((from->metric1 >= 0) && (from->metric1 <= METRIC1_ONE_FP));
	assert ((from->metric3 >= 0) && (from->metric3 <= METRIC3_ONE_FP));
	assert ((from->metric2 >= METRIC2_ONE_FP) &&
			(from->metric2 < 256*METRIC2_ONE_FP));
	assert ((from->wb_gain_gr > 0) && (from->wb_gain_gr < 16*WBGAIN_ONE_FP));
	assert ((from->wb_gain_r  > 0) && (from->wb_gain_r  < 16*WBGAIN_ONE_FP));
	assert ((from->wb_gain_b  > 0) && (from->wb_gain_b  < 16*WBGAIN_ONE_FP));
	assert ((from->wb_gain_gb > 0) && (from->wb_gain_gb < 16*WBGAIN_ONE_FP));

	to->metric1 = from->metric1;
	to->metric2 = from->metric2;
	to->metric3 = from->metric3;

	to->wb_gain_gr = from->wb_gain_gr;
	to->wb_gain_r  = from->wb_gain_r;
	to->wb_gain_b  = from->wb_gain_b;
	to->wb_gain_gb = from->wb_gain_gb;
}

/* TODO: AM: This needs a proper implementation. */
void
ia_css_init_dpc2_state(
	void *state,
	size_t size)
{
	(void)state;
	(void)size;
}

#ifndef IA_CSS_NO_DEBUG
/* TODO: AM: This needs a proper implementation. */
void
ia_css_dpc2_debug_dtrace(
	const struct ia_css_dpc2_config *config,
	unsigned level)
{
	(void)config;
	(void)level;
}
#endif