summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/perf
diff options
context:
space:
mode:
authorVijayakumar <vsubbu@nvidia.com>2016-10-27 09:35:13 -0400
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:56:52 -0500
commit2ebf09920755daeb7e1be71bf317f88ec9d533e1 (patch)
treec9a376f8fb5f11f0dc39587992b229e1e6b06491 /drivers/gpu/nvgpu/perf
parent1f0a38797fbd86b5f5e7f6b43d1c81b2028a82b0 (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')
-rw-r--r--drivers/gpu/nvgpu/perf/perf.c20
-rw-r--r--drivers/gpu/nvgpu/perf/vfe_var.c2
2 files changed, 21 insertions, 1 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
20struct perfrpc_pmucmdhandler_params { 21struct 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
45static 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
44u32 perf_pmu_vfe_load(struct gk20a *g) 61u32 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;
diff --git a/drivers/gpu/nvgpu/perf/vfe_var.c b/drivers/gpu/nvgpu/perf/vfe_var.c
index 90963478..4f8dc83b 100644
--- a/drivers/gpu/nvgpu/perf/vfe_var.c
+++ b/drivers/gpu/nvgpu/perf/vfe_var.c
@@ -921,7 +921,7 @@ static u32 devinit_get_vfe_var_table(struct gk20a *g,
921 921
922 case VBIOS_VFE_3X_VAR_ENTRY_TYPE_SINGLE_SENSED_TEMP: 922 case VBIOS_VFE_3X_VAR_ENTRY_TYPE_SINGLE_SENSED_TEMP:
923 var_type = CTRL_PERF_VFE_VAR_TYPE_SINGLE_SENSED_TEMP; 923 var_type = CTRL_PERF_VFE_VAR_TYPE_SINGLE_SENSED_TEMP;
924 var_data.single_sensed_temp.temp_default = 105; 924 var_data.single_sensed_temp.temp_default = 0x9600;
925 var_data.single_sensed_temp.therm_channel_index = 925 var_data.single_sensed_temp.therm_channel_index =
926 (u8)BIOS_GET_FIELD(var.param0, 926 (u8)BIOS_GET_FIELD(var.param0,
927 VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSTEMP_TH_CH_IDX); 927 VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSTEMP_TH_CH_IDX);