xref: /OK3568_Linux_fs/kernel/drivers/gpu/arm/bifrost/mali_kbase_hwaccess_gpuprops.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3  *
4  * (C) COPYRIGHT 2014-2015, 2017-2022 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: Base kernel property query backend APIs
24  */
25 
26 #ifndef _KBASE_HWACCESS_GPUPROPS_H_
27 #define _KBASE_HWACCESS_GPUPROPS_H_
28 
29 /**
30  * kbase_backend_gpuprops_get() - Fill @regdump with GPU properties read from
31  *				  GPU
32  * @kbdev:	Device pointer
33  * @regdump:	Pointer to struct kbase_gpuprops_regdump structure
34  *
35  * The caller should ensure that GPU remains powered-on during this function.
36  *
37  * Return: Zero for succeess or a Linux error code
38  */
39 int kbase_backend_gpuprops_get(struct kbase_device *kbdev,
40 					struct kbase_gpuprops_regdump *regdump);
41 
42 /**
43  * kbase_backend_gpuprops_get_curr_config() - Fill @curr_config_regdump with
44  *                                            relevant GPU properties read from
45  *                                            the GPU registers.
46  * @kbdev:               Device pointer.
47  * @curr_config_regdump: Pointer to struct kbase_current_config_regdump
48  *                       structure.
49  *
50  * The caller should ensure that GPU remains powered-on during this function and
51  * the caller must ensure this function returns success before using the values
52  * returned in the curr_config_regdump in any part of the kernel.
53  *
54  * Return: Zero for succeess or a Linux error code
55  */
56 int kbase_backend_gpuprops_get_curr_config(struct kbase_device *kbdev,
57 		struct kbase_current_config_regdump *curr_config_regdump);
58 
59 /**
60  * kbase_backend_gpuprops_get_features - Fill @regdump with GPU properties read
61  *                                       from GPU
62  * @kbdev:   Device pointer
63  * @regdump: Pointer to struct kbase_gpuprops_regdump structure
64  *
65  * This function reads GPU properties that are dependent on the hardware
66  * features bitmask. It will power-on the GPU if required.
67  *
68  * Return: Zero for succeess or a Linux error code
69  */
70 int kbase_backend_gpuprops_get_features(struct kbase_device *kbdev,
71 					struct kbase_gpuprops_regdump *regdump);
72 
73 /**
74  * kbase_backend_gpuprops_get_l2_features - Fill @regdump with L2_FEATURES read
75  *                                          from GPU
76  * @kbdev:   Device pointer
77  * @regdump: Pointer to struct kbase_gpuprops_regdump structure
78  *
79  * This function reads L2_FEATURES register that is dependent on the hardware
80  * features bitmask. It will power-on the GPU if required.
81  *
82  * Return: Zero on success, Linux error code on failure
83  */
84 int kbase_backend_gpuprops_get_l2_features(struct kbase_device *kbdev,
85 					struct kbase_gpuprops_regdump *regdump);
86 
87 
88 #endif /* _KBASE_HWACCESS_GPUPROPS_H_ */
89