From 5494e846c78dd0da74635905ead3abe45502375f Mon Sep 17 00:00:00 2001 From: Sachit Kadle Date: Thu, 3 Nov 2016 20:31:59 -0700 Subject: gpu: nvgpu: set clk_rate on frequency change Currently, in gk20a_scale_target, we set clock frequency even if it is equivalent to the rate previously requested by the governor. This change adds a check to bypass this in case new_frequency == prev_frequency. These clocking operations result in multiple BPMP calls, and add significant overhead to submit time. So, we avoid these operations when possible. Bug 1795076 Change-Id: I0f180564e54581f0f4add4626c647e0b9a1bbe43 Signed-off-by: Sachit Kadle Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1247913 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Aaron Huang GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a_scale.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a_scale.c') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c index d2229a6a..e3b21c5a 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c @@ -181,6 +181,10 @@ static int gk20a_scale_target(struct device *dev, unsigned long *freq, if (local_freq > max_freq) local_freq = max_freq; + /* Check for duplicate request */ + if (local_freq == g->devfreq->previous_freq) + return 0; + /* set the final frequency */ rounded_rate = platform->clk_round_rate(dev, local_freq); -- cgit v1.2.2