]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: dc: fix race condition in cmu setting
authorDaniel Solomon <daniels@nvidia.com>
Wed, 14 Jan 2015 21:56:27 +0000 (13:56 -0800)
committerMitch Luban <mluban@nvidia.com>
Tue, 27 Jan 2015 19:49:04 +0000 (11:49 -0800)
When CMU is first set by DC after resume, we use
_tegra_dc_update_cmu_aligned with force = true, to
force writing of all registers.
Since that write occurs on the next end of frame, it's
possible for a cmu_aligned ioctl to come in beforehand
and overwrite force = false, which will prevent setting
of some registers.

This change takes into consideration the current
status of the force flag when setting that flag due
to new requests.

Bug 1598319

Change-Id: I9d6f55db6faaad5db5107400d224e3ca66366c73
Signed-off-by: Daniel Solomon <daniels@nvidia.com>
Reviewed-on: http://git-master/r/672521
(cherry picked from commit 795c23337d0c31e6914e0e9f6fdf6517549121a6)
Reviewed-on: http://git-master/r/677140
Reviewed-by: Mitch Luban <mluban@nvidia.com>
Tested-by: Mitch Luban <mluban@nvidia.com>
drivers/video/tegra/dc/dc.c

index 284c287e6ba4821865bdbabb6937eeddebefdb20..8f8ea2b9091cfbc8d44aba79225c29a1bab61655 100644 (file)
@@ -1784,7 +1784,7 @@ static int _tegra_dc_update_cmu_aligned(struct tegra_dc *dc,
 
        memcpy(&dc->cmu_shadow, cmu, sizeof(dc->cmu));
        dc->cmu_shadow_dirty = true;
-       dc->cmu_shadow_force_update = force;
+       dc->cmu_shadow_force_update = dc->cmu_shadow_force_update || force;
        _tegra_dc_config_frame_end_intr(dc, true);
 
        return 0;