msm: vidc: avoid repeatedly set the same freq

If requested clk_freq is not changed, don't call
clk driver to the same value repeatedly.

Change-Id: I7ff1d7faedb10b06c0371f66b4a6cf6592d165fe
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
This commit is contained in:
Qiwei Liu 2019-08-02 22:34:15 +08:00
commit 37de0e68d4

View file

@ -1326,6 +1326,10 @@ static int __set_clocks(struct venus_hfi_device *device, u32 freq)
struct clock_info *cl;
int rc = 0;
/* bail early if requested clk_freq is not changed */
if (freq == device->clk_freq)
return 0;
venus_hfi_for_each_clock(device, cl) {
if (cl->has_scaling) {/* has_scaling */
rc = __set_clk_rate(device, cl, freq);