From 2ebf09920755daeb7e1be71bf317f88ec9d533e1 Mon Sep 17 00:00:00 2001 From: Vijayakumar Date: Thu, 27 Oct 2016 19:05:13 +0530 Subject: 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 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 Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/perf/perf.c | 20 ++++++++++++++++++++ drivers/gpu/nvgpu/perf/vfe_var.c | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/perf') 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 @@ #include "pmuif/gpmuifperf.h" #include "pmuif/gpmuifperfvfe.h" #include "gk20a/pmu_gk20a.h" +#include "clk/clk_arb.h" struct perfrpc_pmucmdhandler_params { struct nv_pmu_perf_rpc *prpccall; @@ -41,6 +42,22 @@ static void perfrpc_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg, phandlerparams->success = 1; } +static int pmu_handle_perf_event(struct gk20a *g, void *pmu_msg) +{ + struct nv_pmu_perf_msg *msg = (struct nv_pmu_perf_msg *)pmu_msg; + + gk20a_dbg_fn(""); + switch (msg->msg_type) { + case NV_PMU_PERF_MSG_ID_VFE_CALLBACK: + nvgpu_clk_arb_schedule_vf_table_update(g); + break; + default: + WARN_ON(1); + break; + } + return 0; +} + u32 perf_pmu_vfe_load(struct gk20a *g) { struct pmu_cmd cmd; @@ -51,6 +68,9 @@ u32 perf_pmu_vfe_load(struct gk20a *g) struct nv_pmu_perf_rpc rpccall = {0}; struct perfrpc_pmucmdhandler_params handler = {0}; + /*register call back for future VFE updates*/ + g->ops.perf.handle_pmu_perf_event = pmu_handle_perf_event; + rpccall.function = NV_PMU_PERF_RPC_ID_VFE_LOAD; rpccall.params.vfe_load.b_load = true; 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, case VBIOS_VFE_3X_VAR_ENTRY_TYPE_SINGLE_SENSED_TEMP: var_type = CTRL_PERF_VFE_VAR_TYPE_SINGLE_SENSED_TEMP; - var_data.single_sensed_temp.temp_default = 105; + var_data.single_sensed_temp.temp_default = 0x9600; var_data.single_sensed_temp.therm_channel_index = (u8)BIOS_GET_FIELD(var.param0, VBIOS_VFE_3X_VAR_ENTRY_PAR0_SSTEMP_TH_CH_IDX); -- cgit v1.2.2