summaryrefslogtreecommitdiff
path: root/mali_kbase/backend/gpu/mali_kbase_pm_ca_devfreq.h
blob: cc2773995582f7324037d2eb83f02365dd13eebf (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
51
52
53
54
55
56
57
58
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
 *
 * (C) COPYRIGHT 2017-2023 ARM Limited. All rights reserved.
 *
 * This program is free software and is provided to you under the terms of the
 * GNU General Public License version 2 as published by the Free Software
 * Foundation, and any use by you of this program is subject to the terms
 * of such GNU license.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, you can access it online at
 * http://www.gnu.org/licenses/gpl-2.0.html.
 *
 */

/*
 * A core availability policy for use with devfreq, where core masks are
 * associated with OPPs.
 */

#ifndef MALI_KBASE_PM_CA_DEVFREQ_H
#define MALI_KBASE_PM_CA_DEVFREQ_H

/**
 * struct kbasep_pm_ca_policy_devfreq - Private structure for devfreq ca policy
 *
 * @cores_desired: Cores that the policy wants to be available
 * @cores_enabled: Cores that the policy is currently returning as available
 * @cores_used: Cores currently powered or transitioning
 *
 * This contains data that is private to the devfreq core availability
 * policy.
 */
struct kbasep_pm_ca_policy_devfreq {
	u64 cores_desired;
	u64 cores_enabled;
	u64 cores_used;
};

extern const struct kbase_pm_ca_policy kbase_pm_ca_devfreq_policy_ops;

/**
 * kbase_devfreq_set_core_mask - Set core mask for policy to use
 * @kbdev: Device pointer
 * @core_mask: New core mask
 *
 * The new core mask will have immediate effect if the GPU is powered, or will
 * take effect when it is next powered on.
 */
void kbase_devfreq_set_core_mask(struct kbase_device *kbdev, u64 core_mask);

#endif /* MALI_KBASE_PM_CA_DEVFREQ_H */