MALI: midgard: rockchip: add sysfs files to get GPU utilisation
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / arm / midgard / platform / rk / mali_kbase_rk.h
1 /* drivers/gpu/t6xx/kbase/src/platform/rk/mali_kbase_platform.h
2  * Rockchip SoC Mali-Midgard platform-dependent codes
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software FoundatIon.
7  */
8
9 /**
10  * @file mali_kbase_rk.h
11  *
12  * defines work_context type of platform_dependent_part.
13  */
14
15 #ifndef _MALI_KBASE_RK_H_
16 #define _MALI_KBASE_RK_H_
17
18 /*---------------------------------------------------------------------------*/
19
20 #define DEFAULT_UTILISATION_PERIOD_IN_MS (100)
21
22 /*---------------------------------------------------------------------------*/
23
24 /*
25  * struct rk_context - work_context of platform_dependent_part_of_rk.
26  */
27 struct rk_context {
28         /*
29          * record the status of common_parts calling 'power_on_callback'
30          * and 'power_off_callback'.
31          */
32         bool is_powered;
33         struct kbase_device *kbdev;
34         struct workqueue_struct *power_off_wq;
35         struct delayed_work work;
36         unsigned int delay_ms;
37         /* debug only, the period in ms to count gpu_utilisation. */
38         unsigned int utilisation_period;
39 };
40
41 /*---------------------------------------------------------------------------*/
42
43 static inline struct rk_context *get_rk_context(
44                 const struct kbase_device *kbdev)
45 {
46         return (struct rk_context *)(kbdev->platform_context);
47 }
48
49 #endif                          /* _MALI_KBASE_RK_H_ */
50