From 9ff3f79afc241c5d4fab5f823db2d9ecef760dfd Mon Sep 17 00:00:00 2001 From: Mahantesh Kumbar Date: Tue, 1 Mar 2016 11:47:31 +0530 Subject: [PATCH] gpu: nvgpu: Call ELPG enable/disable on condition Call ELPG enable/disable if ELPG support enabled else ignore Bug 200156347 Change-Id: Iaf380e17b85f7322437f9ce09507a88557b738ca Signed-off-by: Mahantesh Kumbar Reviewed-on: http://git-master/r/1021902 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Vijayakumar Subbu GVS: Gerrit_Virtual_Submit Reviewed-by: Kerwin Wan Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 3 ++- drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index fd1ff64f93f..a1ac9f25be6 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -1,7 +1,7 @@ /* * GK20A Graphics FIFO (gr host) * - * Copyright (c) 2011-2015, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2016, 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, @@ -777,6 +777,7 @@ void gk20a_fifo_reset_engine(struct gk20a *g, u32 engine_id) /* resetting engine using mc_enable_r() is not enough, we do full init sequence */ gk20a_gr_reset(g); + if (support_gk20a_pmu(g->dev) && g->elpg_enabled) gk20a_pmu_enable_elpg(g); } if (engine_id == top_device_info_type_enum_copy0_v()) diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index 8f61b585ee3..257dfb84903 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h @@ -1,7 +1,7 @@ /* * GK20A Graphics Engine * - * Copyright (c) 2011-2015, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2016, 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, @@ -444,14 +444,15 @@ bool gk20a_gr_sm_debugger_attached(struct gk20a *g); #define gr_gk20a_elpg_protected_call(g, func) \ ({ \ int err = 0; \ - if (support_gk20a_pmu(g->dev)) \ + if (support_gk20a_pmu(g->dev) && g->elpg_enabled) { \ err = gk20a_pmu_disable_elpg(g); \ - if (err) { \ - gk20a_pmu_enable_elpg(g); \ - return err; \ + if (err) { \ + gk20a_pmu_enable_elpg(g); \ + return err; \ + } \ } \ err = func; \ - if (support_gk20a_pmu(g->dev)) \ + if (support_gk20a_pmu(g->dev) && g->elpg_enabled) \ gk20a_pmu_enable_elpg(g); \ err; \ }) -- 2.39.2