tizen 2.4 release
[kernel/linux-3.0.git] / drivers / gpu / arm / mali400 / mali / common / mali_kernel_utilization.h
1 /*
2  * Copyright (C) 2011-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 "mali_osk.h"
15
16 extern void (*mali_utilization_callback)(unsigned int);
17
18 /**
19  * Initialize/start the Mali GPU utilization metrics reporting.
20  *
21  * @return _MALI_OSK_ERR_OK on success, otherwise failure.
22  */
23 _mali_osk_errcode_t mali_utilization_init(void);
24
25 /**
26  * Terminate the Mali GPU utilization metrics reporting
27  */
28 void mali_utilization_term(void);
29
30 /**
31  * Check if Mali utilization is enabled
32  */
33 MALI_STATIC_INLINE mali_bool mali_utilization_enabled(void)
34 {
35         return (NULL != mali_utilization_callback);
36 }
37
38 /**
39  * Should be called when a job is about to execute a job
40  */
41 void mali_utilization_core_start(u64 time_now);
42
43 /**
44  * Should be called to stop the utilization timer during system suspend
45  */
46 void mali_utilization_suspend(void);
47
48 /**
49  * Should be called when a job has completed executing a job
50  */
51 void mali_utilization_core_end(u64 time_now);
52
53 #endif /* __MALI_KERNEL_UTILIZATION_H__ */