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 <vgarodia@codeaurora.org>
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
This commit is contained in:
Manikanta Kanamarlapudi 2019-05-08 17:26:43 +05:30 • committed by Gerrit - the friendly Code Review server
commit 3418f42be4

View file

@ -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;
}