1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2015, Intel Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  */
15 
16 #ifndef _SH_CSS_METRICS_H_
17 #define _SH_CSS_METRICS_H_
18 
19 #include <type_support.h>
20 
21 struct sh_css_pc_histogram {
22 	unsigned int length;
23 	unsigned int *run;
24 	unsigned int *stall;
25 	unsigned int *msink;
26 };
27 
28 struct sh_css_binary_metrics {
29 	unsigned int mode;
30 	unsigned int id;
31 	struct sh_css_pc_histogram isp_histogram;
32 	struct sh_css_pc_histogram sp_histogram;
33 	struct sh_css_binary_metrics *next;
34 };
35 
36 struct ia_css_frame_metrics {
37 	unsigned int num_frames;
38 };
39 
40 struct sh_css_metrics {
41 	struct sh_css_binary_metrics *binary_metrics;
42 	struct ia_css_frame_metrics   frame_metrics;
43 };
44 
45 extern struct sh_css_metrics sh_css_metrics;
46 
47 /* includes ia_css_binary.h, which depends on sh_css_metrics.h */
48 #include "ia_css_types.h"
49 
50 /* Sample ISP and SP pc and add to histogram */
51 void sh_css_metrics_enable_pc_histogram(bool enable);
52 void sh_css_metrics_start_frame(void);
53 void sh_css_metrics_start_binary(struct sh_css_binary_metrics *metrics);
54 void sh_css_metrics_sample_pcs(void);
55 
56 #endif /* _SH_CSS_METRICS_H_ */
57