summaryrefslogtreecommitdiff
path: root/drivers/gpu/arm/midgard/platform/rk/mali_kbase_rk.h
blob: e1623806abe8b07d84bff60d6a5c6cd6675489b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* drivers/gpu/t6xx/kbase/src/platform/rk/mali_kbase_platform.h
 * Rockchip SoC Mali-Midgard platform-dependent codes
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software FoundatIon.
 */

/**
 * @file mali_kbase_rk.h
 *
 * defines work_context type of platform_dependent_part.
 */

#ifndef _MALI_KBASE_RK_H_
#define _MALI_KBASE_RK_H_

/*---------------------------------------------------------------------------*/

#define DEFAULT_UTILISATION_PERIOD_IN_MS (100)

/*---------------------------------------------------------------------------*/

/*
 * struct rk_context - work_context of platform_dependent_part_of_rk.
 */
struct rk_context {
	/*
	 * record the status of common_parts calling 'power_on_callback'
	 * and 'power_off_callback'.
	 */
	bool is_powered;
	struct kbase_device *kbdev;
	struct workqueue_struct *power_off_wq;
	struct delayed_work work;
	unsigned int delay_ms;
	/* debug only, the period in ms to count gpu_utilisation. */
	unsigned int utilisation_period;
};

/*---------------------------------------------------------------------------*/

static inline struct rk_context *get_rk_context(
		const struct kbase_device *kbdev)
{
	return (struct rk_context *)(kbdev->platform_context);
}

#endif				/* _MALI_KBASE_RK_H_ */