diff options
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/enabled.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/enabled.h b/drivers/gpu/nvgpu/include/nvgpu/enabled.h new file mode 100644 index 00000000..5d30ba12 --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/enabled.h | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #ifndef __NVGPU_ENABLED_H__ | ||
18 | #define __NVGPU_ENABLED_H__ | ||
19 | |||
20 | struct gk20a; | ||
21 | |||
22 | #include <nvgpu/types.h> | ||
23 | |||
24 | /* | ||
25 | * Available flags that describe what's enabled and what's not in the GPU. Each | ||
26 | * flag here is defined by it's offset in a bitmap. | ||
27 | */ | ||
28 | #define NVGPU_IS_FMODEL 1 | ||
29 | #define NVGPU_DRIVER_IS_DYING 2 | ||
30 | |||
31 | /* | ||
32 | * Must be greater than the largest bit offset in the above list. | ||
33 | */ | ||
34 | #define NVGPU_MAX_ENABLED_BITS 64 | ||
35 | |||
36 | /** | ||
37 | * nvgpu_is_enabled - Check if the passed flag is enabled. | ||
38 | * | ||
39 | * @g - The GPU. | ||
40 | * @flag - Which flag to check. | ||
41 | * | ||
42 | * Returns true if the passed @flag is true; false otherwise. | ||
43 | */ | ||
44 | bool nvgpu_is_enabled(struct gk20a *g, int flag); | ||
45 | |||
46 | /** | ||
47 | * __nvgpu_set_enabled - Set the state of a flag. | ||
48 | * | ||
49 | * @g - The GPU. | ||
50 | * @flag - Which flag to modify. | ||
51 | * @state - The state to set the flag to. | ||
52 | * | ||
53 | * Set the state of the passed @flag to @state. This will return the previous | ||
54 | * state of the passed @flag. | ||
55 | */ | ||
56 | bool __nvgpu_set_enabled(struct gk20a *g, int flag, bool state); | ||
57 | |||
58 | int nvgpu_init_enabled_flags(struct gk20a *g); | ||
59 | |||
60 | #endif | ||