1 /*
2  *
3  * (C) COPYRIGHT 2012-2017 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 
20 /**
21  * @file
22  * Run-time work-arounds helpers
23  */
24 
25 #ifndef _KBASE_HW_H_
26 #define _KBASE_HW_H_
27 
28 #include "mali_kbase_defs.h"
29 
30 /**
31  * @brief Tell whether a work-around should be enabled
32  */
33 #define kbase_hw_has_issue(kbdev, issue)\
34 	test_bit(issue, &(kbdev)->hw_issues_mask[0])
35 
36 /**
37  * @brief Tell whether a feature is supported
38  */
39 #define kbase_hw_has_feature(kbdev, feature)\
40 	test_bit(feature, &(kbdev)->hw_features_mask[0])
41 
42 /**
43  * kbase_hw_set_issues_mask - Set the hardware issues mask based on the GPU ID
44  * @kbdev: Device pointer
45  *
46  * Return: 0 if the GPU ID was recognized, otherwise -EINVAL.
47  *
48  * The GPU ID is read from the @kbdev.
49  *
50  * In debugging versions of the driver, unknown versions of a known GPU with a
51  * new-format ID will be treated as the most recent known version not later
52  * than the actual version. In such circumstances, the GPU ID in @kbdev will
53  * also be replaced with the most recent known version.
54  *
55  * Note: The GPU configuration must have been read by
56  * kbase_gpuprops_get_props() before calling this function.
57  */
58 int kbase_hw_set_issues_mask(struct kbase_device *kbdev);
59 
60 /**
61  * @brief Set the features mask depending on the GPU ID
62  */
63 void kbase_hw_set_features_mask(struct kbase_device *kbdev);
64 
65 #endif				/* _KBASE_HW_H_ */
66