2 * Copyright (C) 2010-2014 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>
18 * Initialize/start the Mali GPU utilization metrics reporting.
20 * @return _MALI_OSK_ERR_OK on success, otherwise failure.
22 _mali_osk_errcode_t mali_utilization_init(void);
25 * Terminate the Mali GPU utilization metrics reporting
27 void mali_utilization_term(void);
30 * Check if Mali utilization is enabled
32 mali_bool mali_utilization_enabled(void);
35 * Should be called when a job is about to execute a GP job
37 void mali_utilization_gp_start(void);
40 * Should be called when a job has completed executing a GP job
42 void mali_utilization_gp_end(void);
45 * Should be called when a job is about to execute a PP job
47 void mali_utilization_pp_start(void);
50 * Should be called when a job has completed executing a PP job
52 void mali_utilization_pp_end(void);
55 * Should be called to calcution the GPU utilization
57 struct mali_gpu_utilization_data *mali_utilization_calculate(u64 *start_time, u64 *time_period);
59 _mali_osk_spinlock_irq_t *mali_utilization_get_lock(void);
61 void mali_utilization_platform_realize(struct mali_gpu_utilization_data *util_data);
63 void mali_utilization_data_lock(void);
65 void mali_utilization_data_unlock(void);
67 void mali_utilization_reset(void);
70 #endif /* __MALI_KERNEL_UTILIZATION_H__ */