xref: /OK3568_Linux_fs/kernel/drivers/gpu/arm/bifrost/mali_kbase_hwaccess_defs.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3  *
4  * (C) COPYRIGHT 2014, 2016-2018, 2020-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  * DOC: HW access common definitions
24  */
25 
26 #ifndef _KBASE_HWACCESS_DEFS_H_
27 #define _KBASE_HWACCESS_DEFS_H_
28 
29 #include <backend/gpu/mali_kbase_jm_defs.h>
30 
31 /**
32  * struct kbase_hwaccess_data - object encapsulating the GPU backend specific
33  *                              data for the HW access layer.
34  *                              hwaccess_lock (a spinlock) must be held when
35  *                              accessing this structure.
36  * @active_kctx:     pointer to active kbase context which last submitted an
37  *                   atom to GPU and while the context is active it can
38  *                   submit new atoms to GPU from the irq context also, without
39  *                   going through the bottom half of job completion path.
40  * @backend:         GPU backend specific data for HW access layer
41  */
42 struct kbase_hwaccess_data {
43 #if !MALI_USE_CSF
44 	struct kbase_context *active_kctx[BASE_JM_MAX_NR_SLOTS];
45 #endif
46 
47 	struct kbase_backend_data backend;
48 };
49 
50 #endif /* _KBASE_HWACCESS_DEFS_H_ */
51