From 0a7be116952af71ce89f0bcd22dbebbef1e90102 Mon Sep 17 00:00:00 2001 From: Charles Kong Date: Tue, 19 Aug 2014 13:58:45 -0700 Subject: video: tegra: host: fix bw clock calculation Fixed the per-type aggregation of clock contraints. Corrected the calculation of bw clock. Bug 200026186 Change-Id: Ie97ef00543e64d96077ad05934fed99a20fe1bf0 Signed-off-by: Charles Kong Reviewed-on: http://git-master/r/482197 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Arto Merilainen --- drivers/video/tegra/host/nvhost_acm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/video/tegra/host/nvhost_acm.c b/drivers/video/tegra/host/nvhost_acm.c index 948d7ac3f..b98d0e66a 100644 --- a/drivers/video/tegra/host/nvhost_acm.c +++ b/drivers/video/tegra/host/nvhost_acm.c @@ -311,7 +311,7 @@ static int nvhost_module_update_rate(struct platform_device *dev, int index) if (type == NVHOST_BW) bw_constraint += constraint; - if (type == NVHOST_PIXELRATE) + else if (type == NVHOST_PIXELRATE) pixelrate += constraint; else floor_rate = max(floor_rate, constraint); @@ -324,8 +324,9 @@ static int nvhost_module_update_rate(struct platform_device *dev, int index) /* if frequency is not available, use default policy */ if (!rate) { - unsigned long bw_rate = nvhost_emc_bw_to_freq_req(rate); - rate = max(floor_rate, bw_rate); + unsigned long bw_freq_khz = + nvhost_emc_bw_to_freq_req(bw_constraint); + rate = max(floor_rate, bw_freq_khz << 10); } /* take devfreq rate into account */ -- cgit v1.2.2