video: tegra: dc: fix MC_DECERR display0_win errors on shutdown
authorAdam Cheney <acheney@nvidia.com>
Sat, 16 Jun 2012 02:22:35 +0000 (19:22 -0700)
committerDan Willemsen <dwillemsen@nvidia.com>
Sat, 14 Sep 2013 08:25:00 +0000 (01:25 -0700)
commitdde4aa12285bf686049c59e8054dce60dbfdcdfe
treea8691275fa3e7ff711d38e5a7c951b4a0abd6b57
parentb1052876e6bbc67e797a828645fdb8687d9a4bc7
video: tegra: dc: fix MC_DECERR display0_win errors on shutdown

When a DC window is being released, a NULL flip is used to indicate
that the window should be disabled.  To disable a window, 0 is
written to WIN_OPTIONS.

The MC_DECERR on window shutdown is a symptom of forgetting step 2)
below when disabling windows, leaving no indication that there is
anything to wait for.  This causes DC to erroneously unpin the
scanout buffer while the buffer is still actively being used.

Summary of flip (window update) synchronization in DC:
1) program some window registers
2) set win->dirty=1
3) schedule the activation of the registers
4) request VBLANK or HBLANK interrupts
5) wait for win->dirty==0

In the trigger_windows ISR (every VBLANK or HBLANK):
1) if there is no window update pending in HW, clear dirty flag to
   indicate that ACTIVE registers are up-to-date.

bug 991572
bug 995614
bug 989119
bug 983251
bug 960424
bug 866711

Change-Id: I8b710aac874b202838c3989608b7e0bd15425382
Signed-off-by: Adam Cheney <acheney@nvidia.com>
Reviewed-on: http://git-master/r/109370
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Robert Morell <rmorell@nvidia.com>
Reviewed-by: Nirav Patel <nipatel@nvidia.com>
Reviewed-by: Jon Mayo <jmayo@nvidia.com>

Rebase-Id: R96ce8befac08dec2a7b6e9e5bf666c5cd26f0e9a
drivers/video/tegra/dc/dc.c