xref: /OK3568_Linux_fs/kernel/drivers/gpu/arm/bifrost/backend/gpu/mali_kbase_pm_shader_states.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3  *
4  * (C) COPYRIGHT 2018-2021 ARM Limited. All rights reserved.
5  *
6  * This program is free software and is provided to you under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation, and any use by you of this program is subject to the terms
9  * of such GNU license.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you can access it online at
18  * http://www.gnu.org/licenses/gpl-2.0.html.
19  *
20  */
21 
22 /*
23  * Backend-specific Power Manager shader core state definitions.
24  * The function-like macro KBASEP_SHADER_STATE() must be defined before
25  * including this header file. This header file can be included multiple
26  * times in the same compilation unit with different definitions of
27  * KBASEP_SHADER_STATE().
28  *
29  * @OFF_CORESTACK_OFF:                The shaders and core stacks are off
30  * @OFF_CORESTACK_PEND_ON:            The shaders are off, core stacks have been
31  *                                    requested to power on and hwcnt is being
32  *                                    disabled
33  * @PEND_ON_CORESTACK_ON:             Core stacks are on, shaders have been
34  *                                    requested to power on. Or after doing
35  *                                    partial shader on/off, checking whether
36  *                                    it's the desired state.
37  * @ON_CORESTACK_ON:                  The shaders and core stacks are on, and
38  *                                    hwcnt already enabled.
39  * @ON_CORESTACK_ON_RECHECK:          The shaders and core stacks are on, hwcnt
40  *                                    disabled, and checks to powering down or
41  *                                    re-enabling hwcnt.
42  * @WAIT_OFF_CORESTACK_ON:            The shaders have been requested to power
43  *                                    off, but they remain on for the duration
44  *                                    of the hysteresis timer
45  * @WAIT_GPU_IDLE:                    The shaders partial poweroff needs to
46  *                                    reach a state where jobs on the GPU are
47  *                                    finished including jobs currently running
48  *                                    and in the GPU queue because of
49  *                                    GPU2017-861
50  * @WAIT_FINISHED_CORESTACK_ON:       The hysteresis timer has expired
51  * @L2_FLUSHING_CORESTACK_ON:         The core stacks are on and the level 2
52  *                                    cache is being flushed.
53  * @READY_OFF_CORESTACK_ON:           The core stacks are on and the shaders are
54  *                                    ready to be powered off.
55  * @PEND_OFF_CORESTACK_ON:            The core stacks are on, and the shaders
56  *                                    have been requested to power off
57  * @OFF_CORESTACK_PEND_OFF:           The shaders are off, and the core stacks
58  *                                    have been requested to power off
59  * @OFF_CORESTACK_OFF_TIMER_PEND_OFF: Shaders and corestacks are off, but the
60  *                                    tick timer cancellation is still pending.
61  * @RESET_WAIT:                       The GPU is resetting, shader and core
62  *                                    stack power states are unknown
63  */
64 KBASEP_SHADER_STATE(OFF_CORESTACK_OFF)
65 KBASEP_SHADER_STATE(OFF_CORESTACK_PEND_ON)
66 KBASEP_SHADER_STATE(PEND_ON_CORESTACK_ON)
67 KBASEP_SHADER_STATE(ON_CORESTACK_ON)
68 KBASEP_SHADER_STATE(ON_CORESTACK_ON_RECHECK)
69 KBASEP_SHADER_STATE(WAIT_OFF_CORESTACK_ON)
70 #if !MALI_USE_CSF
71 KBASEP_SHADER_STATE(WAIT_GPU_IDLE)
72 #endif /* !MALI_USE_CSF */
73 KBASEP_SHADER_STATE(WAIT_FINISHED_CORESTACK_ON)
74 KBASEP_SHADER_STATE(L2_FLUSHING_CORESTACK_ON)
75 KBASEP_SHADER_STATE(READY_OFF_CORESTACK_ON)
76 KBASEP_SHADER_STATE(PEND_OFF_CORESTACK_ON)
77 KBASEP_SHADER_STATE(OFF_CORESTACK_PEND_OFF)
78 KBASEP_SHADER_STATE(OFF_CORESTACK_OFF_TIMER_PEND_OFF)
79 KBASEP_SHADER_STATE(RESET_WAIT)
80