diff options
Diffstat (limited to 'drivers/gpu/nvgpu/perf/vfe_equ.h')
-rw-r--r-- | drivers/gpu/nvgpu/perf/vfe_equ.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/perf/vfe_equ.h b/drivers/gpu/nvgpu/perf/vfe_equ.h new file mode 100644 index 00000000..8aaddccd --- /dev/null +++ b/drivers/gpu/nvgpu/perf/vfe_equ.h | |||
@@ -0,0 +1,76 @@ | |||
1 | /* | ||
2 | * general perf structures & definitions | ||
3 | * | ||
4 | * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms and conditions of the GNU General Public License, | ||
8 | * version 2, as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
13 | * more details. | ||
14 | */ | ||
15 | #ifndef _VFE_EQU_H_ | ||
16 | #define _VFE_EQU_H_ | ||
17 | |||
18 | #include "boardobj/boardobjgrp.h" | ||
19 | #include "perf/vfe_var.h" | ||
20 | #include "pmuif/gpmuifperf.h" | ||
21 | #include "pmuif/gpmuifperfvfe.h" | ||
22 | |||
23 | u32 vfe_equ_sw_setup(struct gk20a *g); | ||
24 | u32 vfe_equ_pmu_setup(struct gk20a *g); | ||
25 | |||
26 | #define VFE_EQU_GET(_pperf, _idx) \ | ||
27 | ((struct vfe_equ *)BOARDOBJGRP_OBJ_GET_BY_IDX( \ | ||
28 | &((_pperf)->vfe.equs.super.super), (_idx))) | ||
29 | |||
30 | #define VFE_EQU_IDX_IS_VALID(_pperf, _idx) \ | ||
31 | boardobjgrp_idxisvalid(&((_pperf)->vfe.equs.super.super), (_idx)) | ||
32 | |||
33 | #define VFE_EQU_OUTPUT_TYPE_IS_VALID(_pperf, _idx, _outputtype) \ | ||
34 | (VFE_EQU_IDX_IS_VALID((_pperf), (_idx)) && \ | ||
35 | ((_outputtype) != CTRL_PERF_VFE_EQU_OUTPUT_TYPE_UNITLESS) && \ | ||
36 | ((VFE_EQU_GET((_pperf), (_idx))->outputtype == (_outputtype)) || \ | ||
37 | (VFE_EQU_GET((_pperf), (_idx))->outputtype == \ | ||
38 | CTRL_PERF_VFE_EQU_OUTPUT_TYPE_UNITLESS))) | ||
39 | |||
40 | struct vfe_equ { | ||
41 | struct boardobj super; | ||
42 | u8 var_idx; | ||
43 | u8 equ_idx_next; | ||
44 | u8 output_type; | ||
45 | u32 out_range_min; | ||
46 | u32 out_range_max; | ||
47 | |||
48 | bool b_is_dynamic_valid; | ||
49 | bool b_is_dynamic; | ||
50 | }; | ||
51 | |||
52 | struct vfe_equs { | ||
53 | struct boardobjgrp_e255 super; | ||
54 | }; | ||
55 | |||
56 | struct vfe_equ_compare { | ||
57 | struct vfe_equ super; | ||
58 | u8 func_id; | ||
59 | u8 equ_idx_true; | ||
60 | u8 equ_idx_false; | ||
61 | u32 criteria; | ||
62 | }; | ||
63 | |||
64 | struct vfe_equ_minmax { | ||
65 | struct vfe_equ super; | ||
66 | bool b_max; | ||
67 | u8 equ_idx0; | ||
68 | u8 equ_idx1; | ||
69 | }; | ||
70 | |||
71 | struct vfe_equ_quadratic { | ||
72 | struct vfe_equ super; | ||
73 | u32 coeffs[CTRL_PERF_VFE_EQU_QUADRATIC_COEFF_COUNT]; | ||
74 | }; | ||
75 | |||
76 | #endif | ||