From 8ef013e36ec2dc3be878d057024290e00b7aad49 Mon Sep 17 00:00:00 2001 From: Vijayakumar Date: Thu, 27 Oct 2016 19:16:36 +0530 Subject: gpu: nvgpu: handle vf curve change due to temp JIRA DNVGPU-129 1)Add function hook for PMU VFE event handler which will do for VF curve re-evaluation 2)Add function hook to send temperature limit of GPU sensor 3)Call VFE event handler from PMU's event handle function Change-Id: I2e3577d3d895e97e6ad06e92f0f4827f9855d0b6 Signed-off-by: Vijayakumar Reviewed-on: http://git-master/r/1245393 (cherry picked from commit 1a5c6c32cdec73fb23735430f43577eda675e5af) Reviewed-on: http://git-master/r/1268060 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 5 +++++ drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 10 +++++++++- drivers/gpu/nvgpu/pmuif/gpmuifperf.h | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 02d3ffe0..ed3a1d2d 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -589,6 +589,8 @@ struct gpu_ops { int (*elcg_init_idle_filters)(struct gk20a *g); void (*therm_debugfs_init)(struct gk20a *g); int (*get_internal_sensor_curr_temp)(struct gk20a *g, u32 *temp_f24_8); + void (*get_internal_sensor_limits)(s32 *max_24_8, + s32 *min_24_8); } therm; struct { bool (*is_pmu_supported)(struct gk20a *g); @@ -642,6 +644,9 @@ struct gpu_ops { int (*get_arbiter_clk_default)(struct gk20a *g, u32 api_domain, u16 *default_mhz); } clk_arb; + struct { + int (*handle_pmu_perf_event)(struct gk20a *g, void *pmu_msg); + } perf; bool privsecurity; bool securegpccs; bool pmupstate; diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index 1e9f291f..1d580dae 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c @@ -3976,14 +3976,22 @@ static int pmu_handle_perfmon_event(struct pmu_gk20a *pmu, static int pmu_handle_event(struct pmu_gk20a *pmu, struct pmu_msg *msg) { int err = 0; + struct gk20a *g = gk20a_from_pmu(pmu); gk20a_dbg_fn(""); - switch (msg->hdr.unit_id) { case PMU_UNIT_PERFMON: case PMU_UNIT_PERFMON_T18X: err = pmu_handle_perfmon_event(pmu, &msg->msg.perfmon); break; + case PMU_UNIT_PERF: + if (g->ops.perf.handle_pmu_perf_event != NULL) { + err = g->ops.perf.handle_pmu_perf_event(g, + (void *)&msg->msg.perf); + } else { + WARN_ON(1); + } + break; default: break; } diff --git a/drivers/gpu/nvgpu/pmuif/gpmuifperf.h b/drivers/gpu/nvgpu/pmuif/gpmuifperf.h index b1d2f3fd..181a65f5 100644 --- a/drivers/gpu/nvgpu/pmuif/gpmuifperf.h +++ b/drivers/gpu/nvgpu/pmuif/gpmuifperf.h @@ -87,6 +87,7 @@ struct nv_pmu_perf_rpc { #define NV_PMU_PERF_MSG_ID_RPC (0x00000003) #define NV_PMU_PERF_MSG_ID_BOARDOBJ_GRP_SET (0x00000004) #define NV_PMU_PERF_MSG_ID_BOARDOBJ_GRP_GET_STATUS (0x00000006) +#define NV_PMU_PERF_MSG_ID_VFE_CALLBACK (0x00000005) /*! * Message carrying the result of the perf RPC execution. -- cgit v1.2.2