summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWen Yi <wyi@nvidia.com>2011-03-23 17:18:47 -0700
committerVarun Colbert <vcolbert@nvidia.com>2011-03-29 17:19:33 -0700
commit78f8a86ecf4b00e74628a2287f95d163606e28ee (patch)
tree3a2abf5a27b6975771ce21dc21b2afec39063b72 /drivers
parent27ab1cc06532f59a7ecf1fd3f59aaac3f5e9da74 (diff)
video: tegra: dc: emc scaling based on overlay and panel freq
Change the emc frequency using number of overlays and the frequency of the display panel. Bug 800993 Change-Id: I30ef2edd1ed9b43afa8c38b0f05b5d6e49b7f892 Reviewed-on: http://git-master/r/24052 Reviewed-by: Amit Kamath <akamath@nvidia.com> Reviewed-by: Wen Yi <wyi@nvidia.com> Tested-by: Wen Yi <wyi@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-by: Matthew Longnecker <mlongnecker@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/tegra/dc/overlay.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/video/tegra/dc/overlay.c b/drivers/video/tegra/dc/overlay.c
index 4b1a9ec53711..99aa4e8825e4 100644
--- a/drivers/video/tegra/dc/overlay.c
+++ b/drivers/video/tegra/dc/overlay.c
@@ -305,7 +305,17 @@ surf_err:
kfree(data);
return err;
}
+static void tegra_overlay_set_emc_freq(struct tegra_overlay_info *dev)
+{
+ unsigned long emc_freq = 0;
+ int i;
+ for (i = 0; i < dev->dc->n_windows; i++) {
+ if (dev->overlays[i].owner != NULL)
+ emc_freq += dev->dc->mode.pclk*(i==1?2:1);
+ }
+ clk_set_rate(dev->dc->emc_clk, emc_freq);
+}
/* Overlay functions */
static bool tegra_overlay_get(struct overlay_client *client, int idx)
@@ -320,6 +330,8 @@ static bool tegra_overlay_get(struct overlay_client *client, int idx)
if (dev->overlays[idx].owner == NULL) {
dev->overlays[idx].owner = client;
ret = true;
+ if (dev->dc->mode.pclk != 0)
+ tegra_overlay_set_emc_freq(dev);
}
mutex_unlock(&dev->overlays_lock);
@@ -345,6 +357,8 @@ static void tegra_overlay_put_locked(struct overlay_client *client, int idx)
flip_args.win[2].index = -1;
tegra_overlay_flip(dev, &flip_args, NULL);
+ if (dev->dc->mode.pclk != 0)
+ tegra_overlay_set_emc_freq(dev);
}
static void tegra_overlay_put(struct overlay_client *client, int idx)