summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/perf
diff options
context:
space:
mode:
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);