diff options
author | Jon Mayo <jmayo@nvidia.com> | 2011-07-07 16:29:57 -0700 |
---|---|---|
committer | Cheryl Jones <chjones@nvidia.com> | 2011-09-27 17:27:17 -0700 |
commit | caa11380dc3db31b47e1aef630253498fdccc4e4 (patch) | |
tree | e93af863579d9a0202abc44c4ea4fb9c3c196d66 | |
parent | c7ab0b1c79f23ea0ca4f105841646a6c1724e5a8 (diff) |
video: tegra: dc: clean up dynamic emc code
refactor emc code and centralize it in one place.
Bug 850852
Reviewed-on: http://git-master/r/40131
(cherry picked from commit f9de6e2cffed3d3202378aaf46438a759196565e)
Change-Id: Iccf3d195b65d4c2769c94d5cd30f4194bd1da0b5
Reviewed-on: http://git-master/r/51129
Reviewed-by: Cheryl Jones <chjones@nvidia.com>
Tested-by: Cheryl Jones <chjones@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/include/mach/dc.h | 1 | ||||
-rw-r--r-- | drivers/video/tegra/dc/dc.c | 15 | ||||
-rw-r--r-- | drivers/video/tegra/dc/overlay.c | 2 | ||||
-rw-r--r-- | drivers/video/tegra/fb.c | 3 |
4 files changed, 4 insertions, 17 deletions
diff --git a/arch/arm/mach-tegra/include/mach/dc.h b/arch/arm/mach-tegra/include/mach/dc.h index 9b848be43ead..4d5beae07d56 100644 --- a/arch/arm/mach-tegra/include/mach/dc.h +++ b/arch/arm/mach-tegra/include/mach/dc.h @@ -361,7 +361,6 @@ u32 tegra_dc_incr_syncpt_max(struct tegra_dc *dc); void tegra_dc_incr_syncpt_min(struct tegra_dc *dc, u32 val); int tegra_dc_set_default_emc(struct tegra_dc *dc); -int tegra_dc_set_dynamic_emc(struct tegra_dc_win *windows[], int n); /* tegra_dc_update_windows and tegra_dc_sync_windows do not support windows * with differenct dcs in one call diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index 96c0b5d1a65f..3f6b061ed1a4 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -615,7 +615,7 @@ static void tegra_dc_reduce_emc_worker(struct work_struct *work) mutex_unlock(&dc->lock); } -int tegra_dc_set_dynamic_emc(struct tegra_dc_win *windows[], int n) +static int tegra_dc_set_dynamic_emc(struct tegra_dc_win *windows[], int n) { unsigned long new_rate; struct tegra_dc *dc; @@ -625,13 +625,6 @@ int tegra_dc_set_dynamic_emc(struct tegra_dc_win *windows[], int n) dc = windows[0]->dc; - mutex_lock(&dc->lock); - - if (!dc->enabled) { - mutex_unlock(&dc->lock); - return -EFAULT; - } - /* calculate the new rate based on this POST */ new_rate = tegra_dc_get_emc_rate(windows, n); @@ -649,12 +642,10 @@ int tegra_dc_set_dynamic_emc(struct tegra_dc_win *windows[], int n) schedule_delayed_work(&dc->reduce_emc_clk_work, msecs_to_jiffies(windows_idle_detection_time)); - mutex_unlock(&dc->lock); - return 0; } -int tegra_dc_set_default_emc(struct tegra_dc *dc) +int tegra_dc_set_default_emc(struct tegra_dc *dc) { /* * POST happens whenever this function is called, we first delete any @@ -699,6 +690,8 @@ int tegra_dc_update_windows(struct tegra_dc_win *windows[], int n) return -EFAULT; } + tegra_dc_set_dynamic_emc(windows, n); + if (no_vsync) tegra_dc_writel(dc, WRITE_MUX_ACTIVE | READ_MUX_ACTIVE, DC_CMD_STATE_ACCESS); else diff --git a/drivers/video/tegra/dc/overlay.c b/drivers/video/tegra/dc/overlay.c index bc0df39796f9..9d46df358643 100644 --- a/drivers/video/tegra/dc/overlay.c +++ b/drivers/video/tegra/dc/overlay.c @@ -309,11 +309,9 @@ static void tegra_overlay_flip_worker(struct work_struct *work) dcwins[i] = tegra_dc_get_window(overlay->dc, i); tegra_overlay_blend_reorder(&overlay->blend, dcwins); - tegra_dc_set_dynamic_emc(dcwins, DC_N_WINDOWS); tegra_dc_update_windows(dcwins, DC_N_WINDOWS); tegra_dc_sync_windows(dcwins, DC_N_WINDOWS); } else { - tegra_dc_set_dynamic_emc(wins, nr_win); tegra_dc_update_windows(wins, nr_win); /* TODO: implement swapinterval here */ tegra_dc_sync_windows(wins, nr_win); diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c index 6e8102674f95..73ed79193889 100644 --- a/drivers/video/tegra/fb.c +++ b/drivers/video/tegra/fb.c @@ -306,7 +306,6 @@ static int tegra_fb_pan_display(struct fb_var_screeninfo *var, /* TODO: update virt_addr */ tegra_dc_set_default_emc(tegra_fb->win->dc); - tegra_dc_set_dynamic_emc(&tegra_fb->win, 1); tegra_dc_update_windows(&tegra_fb->win, 1); tegra_dc_sync_windows(&tegra_fb->win, 1); } @@ -516,7 +515,6 @@ static void tegra_fb_flip_worker(struct work_struct *work) #endif } - tegra_dc_set_dynamic_emc(wins, nr_win); tegra_dc_update_windows(wins, nr_win); /* TODO: implement swapinterval here */ tegra_dc_sync_windows(wins, nr_win); @@ -880,7 +878,6 @@ struct tegra_fb_info *tegra_fb_register(struct nvhost_device *ndev, if (fb_data->flags & TEGRA_FB_FLIP_ON_PROBE) { tegra_dc_set_default_emc(tegra_fb->win->dc); - tegra_dc_set_dynamic_emc(&tegra_fb->win, 1); tegra_dc_update_windows(&tegra_fb->win, 1); tegra_dc_sync_windows(&tegra_fb->win, 1); } |