]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: dc: maintain custom CMU settings across suspend cycles
authorDaniel Solomon <daniels@nvidia.com>
Tue, 2 Dec 2014 02:56:19 +0000 (18:56 -0800)
committerMitch Luban <mluban@nvidia.com>
Tue, 27 Jan 2015 19:48:22 +0000 (11:48 -0800)
The DC driver currently clears its CMU cache on suspend, and writes
pdata CMU settings on resume. In some situations we may choose to change
CMU data during runtime; the current behavior will reset that data on
suspend/resume cycles.

This change removes cache clearing on suspend, and on resume the driver
uses its cache instead of pdata to populate CMU.

Note 1: The original purpose of clearing the cache on suspend was to
satisfy a memcmp() and force a CMU update. Since then, memcmp was
replaced by an address comparison, so that's no longer a concern.

Note 2: This change affects dc_init(), which is called on resume and
during DC probe. During resume, CMU cache is already populated. During
probe, CMU cache is populated by set_out(), called before dc_init().

Bug 1535044

Change-Id: I26b05bbede11d9a11a0ac307e8e8da97aefa2420
Signed-off-by: Daniel Solomon <daniels@nvidia.com>
Reviewed-on: http://git-master/r/658190
(cherry picked from commit 2f46feb9c25a276e63ded41ddec20b61e456e4d5)
Reviewed-on: http://git-master/r/664722
(cherry picked from commit 2d6296391e837ed47b523795fd425c873962a634)
Reviewed-on: http://git-master/r/677139
Reviewed-by: Mitch Luban <mluban@nvidia.com>
Tested-by: Mitch Luban <mluban@nvidia.com>
drivers/video/tegra/dc/dc.c

index 5dd219ed530c97eea8af9ed1733b3edd3dc52432..284c287e6ba4821865bdbabb6937eeddebefdb20 100644 (file)
@@ -2084,16 +2084,6 @@ static int tegra_dc_set_out(struct tegra_dc *dc, struct tegra_dc_out *out)
                                dc->out->h_size, dc->out->v_size,
                                dc->mode.pclk);
                dc->initialized = true;
-
-#ifdef CONFIG_TEGRA_DC_CMU
-               /*
-                * If the bootloader already set the mode, assume the CMU
-                * parameters are also correctly set. It would be better to
-                * read them, but unfortunately there is no reliable and
-                * flicker-free way to do this!
-                */
-               tegra_dc_cache_cmu(dc, tegra_dc_get_cmu(dc));
-#endif
        } else if (out->n_modes > 0)
                tegra_dc_set_mode(dc, &dc->out->modes[0]);
 
@@ -2160,6 +2150,11 @@ static int tegra_dc_set_out(struct tegra_dc *dc, struct tegra_dc_out *out)
                dc->out_ops = NULL;
                break;
        }
+
+#ifdef CONFIG_TEGRA_DC_CMU
+       tegra_dc_cache_cmu(dc, tegra_dc_get_cmu(dc));
+#endif
+
        if (dc->out_ops && dc->out_ops->init) {
                err = dc->out_ops->init(dc);
                if (err < 0) {
@@ -3096,7 +3091,7 @@ static int tegra_dc_init(struct tegra_dc *dc)
 #endif
 
 #ifdef CONFIG_TEGRA_DC_CMU
-       _tegra_dc_update_cmu_aligned(dc, tegra_dc_get_cmu(dc), true);
+       _tegra_dc_update_cmu_aligned(dc, &dc->cmu, true);
 #endif
        tegra_dc_set_color_control(dc);
        for_each_set_bit(i, &dc->valid_windows, DC_N_WINDOWS) {