diff options
author | Vijayakumar <vsubbu@nvidia.com> | 2016-10-27 09:35:13 -0400 |
---|---|---|
committer | Deepak Nibade <dnibade@nvidia.com> | 2016-12-27 04:56:52 -0500 |
commit | 2ebf09920755daeb7e1be71bf317f88ec9d533e1 (patch) | |
tree | c9a376f8fb5f11f0dc39587992b229e1e6b06491 /drivers/gpu/nvgpu/perf/perf.c | |
parent | 1f0a38797fbd86b5f5e7f6b43d1c81b2028a82b0 (diff) |
gpu: nvgpu: handle vf curve change due to temp
JIRA DNVGPU-129
1)send 150'c as default temperature to PMU so that PMU will
start reading temperature from sensor to evaluate VFE equations
2)Send GP106's temp min and max range for GPU sensor so that PMU
will read right temperature
3)PMU will send event whenever temperature goes above +ve hysteresis
or goes below -ve hysteresis. Call the Arbiter's VF re-evaluation
function in the event handler.
Change-Id: Iaebc0655f60e17998f0864824095f4fc8bba5b62
Signed-off-by: Vijayakumar <vsubbu@nvidia.com>
Reviewed-on: http://git-master/r/1245392
(cherry picked from commit 7e59d0faa8cee6aace5524c724001e88248b2da7)
Reviewed-on: http://git-master/r/1268062
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Tested-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/perf/perf.c')
-rw-r--r-- | drivers/gpu/nvgpu/perf/perf.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/perf/perf.c b/drivers/gpu/nvgpu/perf/perf.c index 3821a8dc..41ebb315 100644 --- a/drivers/gpu/nvgpu/perf/perf.c +++ b/drivers/gpu/nvgpu/perf/perf.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include "pmuif/gpmuifperf.h" | 16 | #include "pmuif/gpmuifperf.h" |
17 | #include "pmuif/gpmuifperfvfe.h" | 17 | #include "pmuif/gpmuifperfvfe.h" |
18 | #include "gk20a/pmu_gk20a.h" | 18 | #include "gk20a/pmu_gk20a.h" |
19 | #include "clk/clk_arb.h" | ||
19 | 20 | ||
20 | struct perfrpc_pmucmdhandler_params { | 21 | struct perfrpc_pmucmdhandler_params { |
21 | struct nv_pmu_perf_rpc *prpccall; | 22 | struct nv_pmu_perf_rpc *prpccall; |
@@ -41,6 +42,22 @@ static void perfrpc_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg, | |||
41 | phandlerparams->success = 1; | 42 | phandlerparams->success = 1; |
42 | } | 43 | } |
43 | 44 | ||
45 | static int pmu_handle_perf_event(struct gk20a *g, void *pmu_msg) | ||
46 | { | ||
47 | struct nv_pmu_perf_msg *msg = (struct nv_pmu_perf_msg *)pmu_msg; | ||
48 | |||
49 | gk20a_dbg_fn(""); | ||
50 | switch (msg->msg_type) { | ||
51 | case NV_PMU_PERF_MSG_ID_VFE_CALLBACK: | ||
52 | nvgpu_clk_arb_schedule_vf_table_update(g); | ||
53 | break; | ||
54 | default: | ||
55 | WARN_ON(1); | ||
56 | break; | ||
57 | } | ||
58 | return 0; | ||
59 | } | ||
60 | |||
44 | u32 perf_pmu_vfe_load(struct gk20a *g) | 61 | u32 perf_pmu_vfe_load(struct gk20a *g) |
45 | { | 62 | { |
46 | struct pmu_cmd cmd; | 63 | struct pmu_cmd cmd; |
@@ -51,6 +68,9 @@ u32 perf_pmu_vfe_load(struct gk20a *g) | |||
51 | struct nv_pmu_perf_rpc rpccall = {0}; | 68 | struct nv_pmu_perf_rpc rpccall = {0}; |
52 | struct perfrpc_pmucmdhandler_params handler = {0}; | 69 | struct perfrpc_pmucmdhandler_params handler = {0}; |
53 | 70 | ||
71 | /*register call back for future VFE updates*/ | ||
72 | g->ops.perf.handle_pmu_perf_event = pmu_handle_perf_event; | ||
73 | |||
54 | rpccall.function = NV_PMU_PERF_RPC_ID_VFE_LOAD; | 74 | rpccall.function = NV_PMU_PERF_RPC_ID_VFE_LOAD; |
55 | rpccall.params.vfe_load.b_load = true; | 75 | rpccall.params.vfe_load.b_load = true; |
56 | cmd.hdr.unit_id = PMU_UNIT_PERF; | 76 | cmd.hdr.unit_id = PMU_UNIT_PERF; |