xref: /OK3568_Linux_fs/kernel/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_pm_ca_fixed.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  *
3  * (C) COPYRIGHT 2013-2015 ARM Limited. All rights reserved.
4  *
5  * This program is free software and is provided to you under the terms of the
6  * GNU General Public License version 2 as published by the Free Software
7  * Foundation, and any use by you of this program is subject to the terms
8  * of such GNU licence.
9  *
10  * A copy of the licence is included with the program, and can also be obtained
11  * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12  * Boston, MA  02110-1301, USA.
13  *
14  */
15 
16 
17 
18 /*
19  * A power policy implementing fixed core availability
20  */
21 
22 #include <mali_kbase.h>
23 #include <mali_kbase_pm.h>
24 
fixed_init(struct kbase_device * kbdev)25 static void fixed_init(struct kbase_device *kbdev)
26 {
27 	kbdev->pm.backend.ca_in_transition = false;
28 }
29 
fixed_term(struct kbase_device * kbdev)30 static void fixed_term(struct kbase_device *kbdev)
31 {
32 	CSTD_UNUSED(kbdev);
33 }
34 
fixed_get_core_mask(struct kbase_device * kbdev)35 static u64 fixed_get_core_mask(struct kbase_device *kbdev)
36 {
37 	return kbdev->gpu_props.props.raw_props.shader_present;
38 }
39 
fixed_update_core_status(struct kbase_device * kbdev,u64 cores_ready,u64 cores_transitioning)40 static void fixed_update_core_status(struct kbase_device *kbdev,
41 					u64 cores_ready,
42 					u64 cores_transitioning)
43 {
44 	CSTD_UNUSED(kbdev);
45 	CSTD_UNUSED(cores_ready);
46 	CSTD_UNUSED(cores_transitioning);
47 }
48 
49 /*
50  * The struct kbase_pm_policy structure for the fixed power policy.
51  *
52  * This is the static structure that defines the fixed power policy's callback
53  * and name.
54  */
55 const struct kbase_pm_ca_policy kbase_pm_ca_fixed_policy_ops = {
56 	"fixed",			/* name */
57 	fixed_init,			/* init */
58 	fixed_term,			/* term */
59 	fixed_get_core_mask,		/* get_core_mask */
60 	fixed_update_core_status,	/* update_core_status */
61 	0u,				/* flags */
62 	KBASE_PM_CA_POLICY_ID_FIXED,	/* id */
63 };
64 
65 KBASE_EXPORT_TEST_API(kbase_pm_ca_fixed_policy_ops);
66