From 3418f42be463cfa096525fcacfc5c499f2ddb3d4 Mon Sep 17 00:00:00 2001 From: Manikanta Kanamarlapudi Date: Wed, 8 May 2019 17:26:43 +0530 Subject: [PATCH] msm: vidc: Update device clock after cx ipeak logic Existing code updates the device clock before cx ipeak logic. As a result, the cx ipeak takes a decision based on updated clock rather than the clock at which the device was running. With the change, device clock is updated after the cx ipeak is decided. Change-Id: Icfde29176f8adb3a12c68a611f47b83ca7a8e4a9 Signed-off-by: Vikash Garodia Signed-off-by: Manikanta Kanamarlapudi --- msm/vidc/hfi_common.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/msm/vidc/hfi_common.c b/msm/vidc/hfi_common.c index 4364e8e54308..4fbbda3a8c15 100644 --- a/msm/vidc/hfi_common.c +++ b/msm/vidc/hfi_common.c @@ -1292,13 +1292,12 @@ static int __set_clk_rate(struct venus_hfi_device *device, return rc; } - device->clk_freq = rate; - - if (device->clk_freq >= threshold_freq && rate < threshold_freq) { + if (ipeak && device->clk_freq >= threshold_freq && rate < threshold_freq) { rc = cx_ipeak_update(ipeak, false); if (rc) { dprintk(VIDC_ERR, "cx_ipeak_update failed! ipeak %pK\n", ipeak); + device->clk_freq = rate; return rc; } dprintk(VIDC_PERF, @@ -1306,6 +1305,8 @@ static int __set_clk_rate(struct venus_hfi_device *device, device->clk_freq, rate, threshold_freq); } + device->clk_freq = rate; + return rc; }