tizen 2.4 release
[kernel/linux-3.0.git] / drivers / gpu / arm / mali400 / r4p0_rel0 / common / mali_kernel_utilization.h
1 /*
2  * Copyright (C) 2010-2012 ARM Limited. All rights reserved.
3  * 
4  * This program is free software and is provided to you under the terms of the GNU General Public License version 2
5  * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
6  * 
7  * A copy of the licence is included with the program, and can also be obtained from Free Software
8  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
9  */
10
11 #ifndef __MALI_KERNEL_UTILIZATION_H__
12 #define __MALI_KERNEL_UTILIZATION_H__
13
14 #include <linux/mali/mali_utgard.h>
15 #include "mali_osk.h"
16
17 extern void (*mali_utilization_callback)(struct mali_gpu_utilization_data *data);
18
19 /**
20  * Initialize/start the Mali GPU utilization metrics reporting.
21  *
22  * @return _MALI_OSK_ERR_OK on success, otherwise failure.
23  */
24 _mali_osk_errcode_t mali_utilization_init(void);
25
26 /**
27  * Terminate the Mali GPU utilization metrics reporting
28  */
29 void mali_utilization_term(void);
30
31 /**
32  * Check if Mali utilization is enabled
33  */
34 MALI_STATIC_INLINE mali_bool mali_utilization_enabled(void)
35 {
36         return (NULL != mali_utilization_callback);
37 }
38
39 /**
40  * Should be called when a job is about to execute a GP job
41  */
42 void mali_utilization_gp_start(void);
43
44 /**
45  * Should be called when a job has completed executing a GP job
46  */
47 void mali_utilization_gp_end(void);
48
49 /**
50  * Should be called when a job is about to execute a PP job
51  */
52 void mali_utilization_pp_start(void);
53
54 /**
55  * Should be called when a job has completed executing a PP job
56  */
57 void mali_utilization_pp_end(void);
58
59 /**
60  * Should be called to stop the utilization timer during system suspend
61  */
62 void mali_utilization_suspend(void);
63
64
65 #endif /* __MALI_KERNEL_UTILIZATION_H__ */