GNU Linux-libre 4.14.313-gnu1
[releases.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / sh_css_metrics.h
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 #ifndef _SH_CSS_METRICS_H_
16 #define _SH_CSS_METRICS_H_
17
18 #include <type_support.h>
19
20 struct sh_css_pc_histogram {
21         unsigned length;
22         unsigned *run;
23         unsigned *stall;
24         unsigned *msink;
25 };
26
27 #if !defined(__USE_DESIGNATED_INITIALISERS__)
28 #define DEFAULT_PC_HISTOGRAM \
29 { \
30         0, \
31         NULL, \
32         NULL, \
33         NULL \
34 }
35 #endif
36
37 struct sh_css_binary_metrics {
38         unsigned mode;
39         unsigned id;
40         struct sh_css_pc_histogram isp_histogram;
41         struct sh_css_pc_histogram sp_histogram;
42         struct sh_css_binary_metrics *next;
43 };
44
45 #if !defined(__USE_DESIGNATED_INITIALISERS__)
46 #define DEFAULT_BINARY_METRICS \
47 { \
48         0, \
49         0, \
50         DEFAULT_PC_HISTOGRAM, \
51         DEFAULT_PC_HISTOGRAM, \
52         NULL \
53 }
54 #endif
55
56 struct ia_css_frame_metrics {
57         unsigned num_frames;
58 };
59
60 struct sh_css_metrics {
61         struct sh_css_binary_metrics *binary_metrics;
62         struct ia_css_frame_metrics   frame_metrics;
63 };
64
65 extern struct sh_css_metrics sh_css_metrics;
66
67 /* includes ia_css_binary.h, which depends on sh_css_metrics.h */
68 #include "ia_css_types.h"
69
70 /* Sample ISP and SP pc and add to histogram */
71 void sh_css_metrics_enable_pc_histogram(bool enable);
72 void sh_css_metrics_start_frame(void);
73 void sh_css_metrics_start_binary(struct sh_css_binary_metrics *metrics);
74 void sh_css_metrics_sample_pcs(void);
75
76 #endif /* _SH_CSS_METRICS_H_ */