summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNitin Kumbhar <nkumbhar@nvidia.com>2011-09-05 18:21:45 +0530
committerAnnamaria Pyreddy <apyreddy@nvidia.com>2011-09-06 22:43:23 -0700
commitb75b93abc2b5ff097dfcff5dc55321af0244dc32 (patch)
tree30ced327bcb10f2ded11b440fa6a5f0ea7fb98e3
parentfbb2f23a11d86848a92e50430c8566c78a2f2bd6 (diff)
video: tegra: dc: update emc clk for multiple dcs
When an overlay is opened or closed it updates emc clk as per pclk. However, this does not consider state of other dc for memory bandwidth consideration. This results in underflow errors when both display controllers are in use. To avoid underflow, update emc clk as per state of both dcs. BUG 865578 Change-Id: I595c17a2284ce9857acb040e3c6ee6cadf0b4e50 Reviewed-on: http://git-master/r/50736 Tested-by: Nitin Kumbhar <nkumbhar@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Gerrit_Virtual_Submit Reviewed-by: Jon Mayo <jmayo@nvidia.com>
-rw-r--r--drivers/video/tegra/dc/dc.c14
-rw-r--r--drivers/video/tegra/dc/dc_priv.h1
-rw-r--r--drivers/video/tegra/dc/overlay.c4
3 files changed, 19 insertions, 0 deletions
diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c
index 57ca161f9765..b2cb5c404d90 100644
--- a/drivers/video/tegra/dc/dc.c
+++ b/drivers/video/tegra/dc/dc.c
@@ -352,6 +352,20 @@ out:
return ret;
}
+unsigned int tegra_dc_has_multiple_dc(void)
+{
+ unsigned int idx;
+ unsigned int cnt = 0;
+ struct tegra_dc *dc;
+
+ mutex_lock(&tegra_dc_lock);
+ for (idx = 0; idx < TEGRA_MAX_DC; idx++)
+ cnt += ((dc = tegra_dcs[idx]) != NULL && dc->enabled) ? 1 : 0;
+ mutex_unlock(&tegra_dc_lock);
+
+ return (cnt > 1);
+}
+
struct tegra_dc *tegra_dc_get_dc(unsigned idx)
{
if (idx < TEGRA_MAX_DC)
diff --git a/drivers/video/tegra/dc/dc_priv.h b/drivers/video/tegra/dc/dc_priv.h
index d31c4436dcba..c6097398caf6 100644
--- a/drivers/video/tegra/dc/dc_priv.h
+++ b/drivers/video/tegra/dc/dc_priv.h
@@ -142,6 +142,7 @@ static inline void *tegra_dc_get_outdata(struct tegra_dc *dc)
}
void tegra_dc_setup_clk(struct tegra_dc *dc, struct clk *clk);
+unsigned int tegra_dc_has_multiple_dc(void);
extern struct tegra_dc_out_ops tegra_dc_rgb_ops;
extern struct tegra_dc_out_ops tegra_dc_hdmi_ops;
diff --git a/drivers/video/tegra/dc/overlay.c b/drivers/video/tegra/dc/overlay.c
index c5d293dacca4..ae29bba7b024 100644
--- a/drivers/video/tegra/dc/overlay.c
+++ b/drivers/video/tegra/dc/overlay.c
@@ -410,6 +410,10 @@ static void tegra_overlay_set_emc_freq(struct tegra_overlay_info *dev)
if (dev->overlays[i].owner != NULL)
emc_freq += dev->dc->mode.pclk*(i==1?2:1)*2;
}
+
+ if (tegra_dc_has_multiple_dc())
+ emc_freq = ULONG_MAX;
+
clk_set_rate(dev->dc->emc_clk, emc_freq);
}