From 6420f721704daa836c261936d963cb314789c262 Mon Sep 17 00:00:00 2001 From: Mahantesh Kumbar Date: Tue, 17 Jan 2017 11:01:52 +0530 Subject: gpu: nvgpu: HAL to get current pstate - Added HAL support to get current pstate from clk_arb Note - This function is inherently unsafe to call while arbiter is running arbiter must be blocked before calling this function JIRA DNVGPU-165 Change-Id: I4e9f5eba7739280bddd9ee661fd314288c129516 Signed-off-by: Mahantesh Kumbar Reviewed-on: http://git-master/r/1286378 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a.h | 4 ++++ drivers/gpu/nvgpu/gp106/clk_arb_gp106.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 692f054f..a78ff506 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -656,6 +656,10 @@ struct gpu_ops { u16 *min_mhz, u16 *max_mhz); int (*get_arbiter_clk_default)(struct gk20a *g, u32 api_domain, u16 *default_mhz); + /* This function is inherently unsafe to call while + * arbiter is running arbiter must be blocked + * before calling this function */ + int (*get_current_pstate)(struct gk20a *g); } clk_arb; struct { int (*handle_pmu_perf_event)(struct gk20a *g, void *pmu_msg); diff --git a/drivers/gpu/nvgpu/gp106/clk_arb_gp106.c b/drivers/gpu/nvgpu/gp106/clk_arb_gp106.c index b4d1afbc..4a907521 100644 --- a/drivers/gpu/nvgpu/gp106/clk_arb_gp106.c +++ b/drivers/gpu/nvgpu/gp106/clk_arb_gp106.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -102,4 +102,5 @@ void gp106_init_clk_arb_ops(struct gpu_ops *gops) gops->clk_arb.get_arbiter_clk_domains = gp106_get_arbiter_clk_domains; gops->clk_arb.get_arbiter_clk_range = gp106_get_arbiter_clk_range; gops->clk_arb.get_arbiter_clk_default = gp106_get_arbiter_clk_default; + gops->clk_arb.get_current_pstate = nvgpu_clk_arb_get_current_pstate; } -- cgit v1.2.2