summaryrefslogtreecommitdiff
path: root/stats/ipu3_all_stats.h
blob: 3e5a33665bffa4f2a79e8e33d9f561c93a66b21b (plain)
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
/*
 * Copyright (C) 2017-2018 Intel Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * IPU3AllStats - Handle and convert statistics from kernel to AIQ interface
 *
 * This implementation is highly derived from ChromeOS:
 *   platform2/camera/hal/intel/ipu3/psl/ipu3/statsConverter/ipu-stats.cpp
 */

#ifndef IPU3_ALL_STATS_H
#define IPU3_ALL_STATS_H

#include <ia_imaging/ia_aiq_types.h>
#include <ia_imaging/stats_3a_public.h>

#include <linux/intel-ipu3.h>

namespace libcamera::ipa::ipu3 {

class IPU3AllStats
{
public:
	struct ipu3_stats_all_stats {
		struct ia_css_4a_statistics ia_css_4a_statistics;
		struct stats_4a_public_raw_buffer stats_4a_public_raw_buffer;
		struct ia_css_2500_4a_config ia_css_2500_4a_config;
	};

	static void
	ipu3_stats_get_3a(struct ipu3_stats_all_stats *all_stats,
			  const struct ipu3_uapi_stats_3a *isp_stats);

	static ia_err
	intel_skycam_statistics_convert(const ia_css_4a_statistics &statistics,
					ia_aiq_rgbs_grid *out_rgbs_grid,
					ia_aiq_af_grid *out_af_grid);
private:
	static void ipu3_stats_init_3a(struct ipu3_stats_all_stats *all_stats);
};

} /* namespace libcamera::ipa::ipu3 */

#endif /* IPU3_ALL_STATS_H */