From 37de0e68d4c8ecedb942d4f215a03fa76f4be930 Mon Sep 17 00:00:00 2001 From: Qiwei Liu Date: Fri, 2 Aug 2019 22:34:15 +0800 Subject: [PATCH] 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 --- msm/vidc/hfi_common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/msm/vidc/hfi_common.c b/msm/vidc/hfi_common.c index 5b6beb3fe538..429ea53534d5 100644 --- a/msm/vidc/hfi_common.c +++ b/msm/vidc/hfi_common.c @@ -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);