diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/tegra/dc/overlay.c | 14 |
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) |