1a3e1737eSAnthony Koo /*
2a3e1737eSAnthony Koo  * Copyright 2016 Advanced Micro Devices, Inc.
3a3e1737eSAnthony Koo  *
4a3e1737eSAnthony Koo  * Permission is hereby granted, free of charge, to any person obtaining a
5a3e1737eSAnthony Koo  * copy of this software and associated documentation files (the "Software"),
6a3e1737eSAnthony Koo  * to deal in the Software without restriction, including without limitation
7a3e1737eSAnthony Koo  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8a3e1737eSAnthony Koo  * and/or sell copies of the Software, and to permit persons to whom the
9a3e1737eSAnthony Koo  * Software is furnished to do so, subject to the following conditions:
10a3e1737eSAnthony Koo  *
11a3e1737eSAnthony Koo  * The above copyright notice and this permission notice shall be included in
12a3e1737eSAnthony Koo  * all copies or substantial portions of the Software.
13a3e1737eSAnthony Koo  *
14a3e1737eSAnthony Koo  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15a3e1737eSAnthony Koo  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16a3e1737eSAnthony Koo  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17a3e1737eSAnthony Koo  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18a3e1737eSAnthony Koo  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19a3e1737eSAnthony Koo  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20a3e1737eSAnthony Koo  * OTHER DEALINGS IN THE SOFTWARE.
21a3e1737eSAnthony Koo  *
22a3e1737eSAnthony Koo  * Authors: AMD
23a3e1737eSAnthony Koo  *
24a3e1737eSAnthony Koo  */
25a3e1737eSAnthony Koo 
26a3e1737eSAnthony Koo #ifndef MODULES_INC_MOD_STATS_H_
27a3e1737eSAnthony Koo #define MODULES_INC_MOD_STATS_H_
28a3e1737eSAnthony Koo 
29a3e1737eSAnthony Koo #include "dm_services.h"
30a3e1737eSAnthony Koo 
31a3e1737eSAnthony Koo struct mod_stats {
32a3e1737eSAnthony Koo 	int dummy;
33a3e1737eSAnthony Koo };
34a3e1737eSAnthony Koo 
35a3e1737eSAnthony Koo struct mod_stats_caps {
36a3e1737eSAnthony Koo 	bool dummy;
37a3e1737eSAnthony Koo };
38a3e1737eSAnthony Koo 
391810f441SJaehyun Chung struct mod_stats_init_params {
401810f441SJaehyun Chung 	unsigned int stats_enable;
411810f441SJaehyun Chung 	unsigned int stats_entries;
421810f441SJaehyun Chung };
431810f441SJaehyun Chung 
441810f441SJaehyun Chung struct mod_stats *mod_stats_create(struct dc *dc,
451810f441SJaehyun Chung 		struct mod_stats_init_params *init_params);
46a3e1737eSAnthony Koo 
47a3e1737eSAnthony Koo void mod_stats_destroy(struct mod_stats *mod_stats);
48a3e1737eSAnthony Koo 
49a3e1737eSAnthony Koo bool mod_stats_init(struct mod_stats *mod_stats);
50a3e1737eSAnthony Koo 
51a3e1737eSAnthony Koo void mod_stats_dump(struct mod_stats *mod_stats);
52a3e1737eSAnthony Koo 
53a3e1737eSAnthony Koo void mod_stats_reset_data(struct mod_stats *mod_stats);
54a3e1737eSAnthony Koo 
556474b282SAnthony Koo void mod_stats_update_event(struct mod_stats *mod_stats,
566474b282SAnthony Koo 		char *event_string,
576474b282SAnthony Koo 		unsigned int length);
586474b282SAnthony Koo 
59a3e1737eSAnthony Koo void mod_stats_update_flip(struct mod_stats *mod_stats,
60953fee81SAric Cyr 		unsigned long long timestamp_in_ns);
61a3e1737eSAnthony Koo 
62a3e1737eSAnthony Koo void mod_stats_update_vupdate(struct mod_stats *mod_stats,
63953fee81SAric Cyr 		unsigned long long timestamp_in_ns);
64a3e1737eSAnthony Koo 
65a3e1737eSAnthony Koo void mod_stats_update_freesync(struct mod_stats *mod_stats,
66a3e1737eSAnthony Koo 		unsigned int v_total_min,
67a3e1737eSAnthony Koo 		unsigned int v_total_max,
68a3e1737eSAnthony Koo 		unsigned int event_triggers,
69a3e1737eSAnthony Koo 		unsigned int window_min,
70a3e1737eSAnthony Koo 		unsigned int window_max,
71a3e1737eSAnthony Koo 		unsigned int lfc_mid_point_in_us,
72a3e1737eSAnthony Koo 		unsigned int inserted_frames,
73a3e1737eSAnthony Koo 		unsigned int inserted_frame_duration_in_us);
74a3e1737eSAnthony Koo 
75a3e1737eSAnthony Koo #endif /* MODULES_INC_MOD_STATS_H_ */
76