2 * Copyright (C) 2010-2012 ARM Limited. All rights reserved.
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.
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.
11 #ifndef __MALI_KERNEL_UTILIZATION_H__
12 #define __MALI_KERNEL_UTILIZATION_H__
14 #include <linux/mali/mali_utgard.h>
17 extern void (*mali_utilization_callback)(struct mali_gpu_utilization_data *data);
20 * Initialize/start the Mali GPU utilization metrics reporting.
22 * @return _MALI_OSK_ERR_OK on success, otherwise failure.
24 _mali_osk_errcode_t mali_utilization_init(void);
27 * Terminate the Mali GPU utilization metrics reporting
29 void mali_utilization_term(void);
32 * Check if Mali utilization is enabled
34 MALI_STATIC_INLINE mali_bool mali_utilization_enabled(void)
36 return (NULL != mali_utilization_callback);
40 * Should be called when a job is about to execute a GP job
42 void mali_utilization_gp_start(void);
45 * Should be called when a job has completed executing a GP job
47 void mali_utilization_gp_end(void);
50 * Should be called when a job is about to execute a PP job
52 void mali_utilization_pp_start(void);
55 * Should be called when a job has completed executing a PP job
57 void mali_utilization_pp_end(void);
60 * Should be called to stop the utilization timer during system suspend
62 void mali_utilization_suspend(void);
65 #endif /* __MALI_KERNEL_UTILIZATION_H__ */