diff options
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/pmu.h | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmu.h b/drivers/gpu/nvgpu/include/nvgpu/pmu.h index 76a54fa1..507b8133 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/pmu.h +++ b/drivers/gpu/nvgpu/include/nvgpu/pmu.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * Permission is hereby granted, free of charge, to any person obtaining a | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
5 | * copy of this software and associated documentation files (the "Software"), | 5 | * copy of this software and associated documentation files (the "Software"), |
@@ -154,12 +154,45 @@ enum { | |||
154 | \ | 154 | \ |
155 | _stat = nvgpu_pmu_rpc_execute(_pmu, &((_prpc)->hdr), \ | 155 | _stat = nvgpu_pmu_rpc_execute(_pmu, &((_prpc)->hdr), \ |
156 | (sizeof(*(_prpc)) - sizeof((_prpc)->scratch)),\ | 156 | (sizeof(*(_prpc)) - sizeof((_prpc)->scratch)),\ |
157 | (_size), NULL, NULL); \ | 157 | (_size), NULL, NULL, false); \ |
158 | } while (0) | ||
159 | |||
160 | /* RPC blocking call to copy back data from PMU to _prpc */ | ||
161 | #define PMU_RPC_EXECUTE_CPB(_stat, _pmu, _unit, _func, _prpc, _size)\ | ||
162 | do { \ | ||
163 | memset(&((_prpc)->hdr), 0, sizeof((_prpc)->hdr));\ | ||
164 | \ | ||
165 | (_prpc)->hdr.unit_id = PMU_UNIT_##_unit; \ | ||
166 | (_prpc)->hdr.function = NV_PMU_RPC_ID_##_unit##_##_func;\ | ||
167 | (_prpc)->hdr.flags = 0x0; \ | ||
168 | \ | ||
169 | _stat = nvgpu_pmu_rpc_execute(_pmu, &((_prpc)->hdr), \ | ||
170 | (sizeof(*(_prpc)) - sizeof((_prpc)->scratch)),\ | ||
171 | (_size), NULL, NULL, true); \ | ||
172 | } while (0) | ||
173 | |||
174 | /* RPC non-blocking with call_back handler option */ | ||
175 | #define PMU_RPC_EXECUTE_CB(_stat, _pmu, _unit, _func, _prpc, _size, _cb, _cbp)\ | ||
176 | do { \ | ||
177 | memset(&((_prpc)->hdr), 0, sizeof((_prpc)->hdr));\ | ||
178 | \ | ||
179 | (_prpc)->hdr.unit_id = PMU_UNIT_##_unit; \ | ||
180 | (_prpc)->hdr.function = NV_PMU_RPC_ID_##_unit##_##_func;\ | ||
181 | (_prpc)->hdr.flags = 0x0; \ | ||
182 | \ | ||
183 | _stat = nvgpu_pmu_rpc_execute(_pmu, &((_prpc)->hdr), \ | ||
184 | (sizeof(*(_prpc)) - sizeof((_prpc)->scratch)),\ | ||
185 | (_size), _cb, _cbp, false); \ | ||
158 | } while (0) | 186 | } while (0) |
159 | 187 | ||
160 | typedef void (*pmu_callback)(struct gk20a *, struct pmu_msg *, void *, u32, | 188 | typedef void (*pmu_callback)(struct gk20a *, struct pmu_msg *, void *, u32, |
161 | u32); | 189 | u32); |
162 | 190 | ||
191 | struct rpc_handler_payload { | ||
192 | void *rpc_buff; | ||
193 | bool is_mem_free_set; | ||
194 | }; | ||
195 | |||
163 | struct pmu_rpc_desc { | 196 | struct pmu_rpc_desc { |
164 | void *prpc; | 197 | void *prpc; |
165 | u16 size_rpc; | 198 | u16 size_rpc; |
@@ -500,6 +533,7 @@ bool nvgpu_find_hex_in_string(char *strings, struct gk20a *g, u32 *hex_pos); | |||
500 | 533 | ||
501 | /* PMU RPC */ | 534 | /* PMU RPC */ |
502 | int nvgpu_pmu_rpc_execute(struct nvgpu_pmu *pmu, struct nv_pmu_rpc_header *rpc, | 535 | int nvgpu_pmu_rpc_execute(struct nvgpu_pmu *pmu, struct nv_pmu_rpc_header *rpc, |
503 | u16 size_rpc, u16 size_scratch, pmu_callback callback, void *cb_param); | 536 | u16 size_rpc, u16 size_scratch, pmu_callback callback, void *cb_param, |
537 | bool is_copy_back); | ||
504 | 538 | ||
505 | #endif /* __NVGPU_PMU_H__ */ | 539 | #endif /* __NVGPU_PMU_H__ */ |