diff options
Diffstat (limited to 'include/pmu_perf/vfe_equ.h')
| -rw-r--r-- | include/pmu_perf/vfe_equ.h | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/include/pmu_perf/vfe_equ.h b/include/pmu_perf/vfe_equ.h new file mode 100644 index 0000000..6131d09 --- /dev/null +++ b/include/pmu_perf/vfe_equ.h | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | /* | ||
| 2 | * general perf structures & definitions | ||
| 3 | * | ||
| 4 | * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved. | ||
| 5 | * | ||
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 7 | * copy of this software and associated documentation files (the "Software"), | ||
| 8 | * to deal in the Software without restriction, including without limitation | ||
| 9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 10 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 11 | * Software is furnished to do so, subject to the following conditions: | ||
| 12 | * | ||
| 13 | * The above copyright notice and this permission notice shall be included in | ||
| 14 | * all copies or substantial portions of the Software. | ||
| 15 | * | ||
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| 21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| 22 | * DEALINGS IN THE SOFTWARE. | ||
| 23 | */ | ||
| 24 | #ifndef NVGPU_PERF_VFE_EQU_H | ||
| 25 | #define NVGPU_PERF_VFE_EQU_H | ||
| 26 | |||
| 27 | #include "boardobj/boardobjgrp.h" | ||
| 28 | #include "vfe_var.h" | ||
| 29 | #include <nvgpu/pmuif/nvgpu_gpmu_cmdif.h> | ||
| 30 | |||
| 31 | int vfe_equ_sw_setup(struct gk20a *g); | ||
| 32 | int vfe_equ_pmu_setup(struct gk20a *g); | ||
| 33 | |||
| 34 | #define VFE_EQU_GET(_pperf, _idx) \ | ||
| 35 | ((struct vfe_equ *)BOARDOBJGRP_OBJ_GET_BY_IDX( \ | ||
| 36 | &((_pperf)->vfe.equs.super.super), (_idx))) | ||
| 37 | |||
| 38 | #define VFE_EQU_IDX_IS_VALID(_pperf, _idx) \ | ||
| 39 | boardobjgrp_idxisvalid(&((_pperf)->vfe.equs.super.super), (_idx)) | ||
| 40 | |||
| 41 | #define VFE_EQU_OUTPUT_TYPE_IS_VALID(_pperf, _idx, _outputtype) \ | ||
| 42 | (VFE_EQU_IDX_IS_VALID((_pperf), (_idx)) && \ | ||
| 43 | ((_outputtype) != CTRL_PERF_VFE_EQU_OUTPUT_TYPE_UNITLESS) && \ | ||
| 44 | ((VFE_EQU_GET((_pperf), (_idx))->outputtype == (_outputtype)) || \ | ||
| 45 | (VFE_EQU_GET((_pperf), (_idx))->outputtype == \ | ||
| 46 | CTRL_PERF_VFE_EQU_OUTPUT_TYPE_UNITLESS))) | ||
| 47 | |||
| 48 | struct vfe_equ { | ||
| 49 | struct boardobj super; | ||
| 50 | u8 var_idx; | ||
| 51 | u8 equ_idx_next; | ||
| 52 | u8 output_type; | ||
| 53 | u32 out_range_min; | ||
| 54 | u32 out_range_max; | ||
| 55 | |||
| 56 | bool b_is_dynamic_valid; | ||
| 57 | bool b_is_dynamic; | ||
| 58 | }; | ||
| 59 | |||
| 60 | struct vfe_equs { | ||
| 61 | struct boardobjgrp_e255 super; | ||
| 62 | }; | ||
| 63 | |||
| 64 | struct vfe_equ_compare { | ||
| 65 | struct vfe_equ super; | ||
| 66 | u8 func_id; | ||
| 67 | u8 equ_idx_true; | ||
| 68 | u8 equ_idx_false; | ||
| 69 | u32 criteria; | ||
| 70 | }; | ||
| 71 | |||
| 72 | struct vfe_equ_minmax { | ||
| 73 | struct vfe_equ super; | ||
| 74 | bool b_max; | ||
| 75 | u8 equ_idx0; | ||
| 76 | u8 equ_idx1; | ||
| 77 | }; | ||
| 78 | |||
| 79 | struct vfe_equ_quadratic { | ||
| 80 | struct vfe_equ super; | ||
| 81 | u32 coeffs[CTRL_PERF_VFE_EQU_QUADRATIC_COEFF_COUNT]; | ||
| 82 | }; | ||
| 83 | |||
| 84 | #endif /* NVGPU_PERF_VFE_EQU_H */ | ||
