From 03b3d64a3fef9419e1b6eec35ff9add0785dd045 Mon Sep 17 00:00:00 2001 From: Adam Cheney Date: Fri, 15 Jun 2012 19:22:35 -0700 Subject: 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 Reviewed-on: http://git-master/r/109370 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Robert Morell Reviewed-by: Nirav Patel Reviewed-by: Jon Mayo --- drivers/video/tegra/dc/dc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/video/tegra/dc/dc.c') diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index db4efc95aab1..0b923693a937 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -931,6 +931,7 @@ int tegra_dc_update_windows(struct tegra_dc_win *windows[], int n) update_mask |= WIN_A_ACT_REQ << win->idx; if (!WIN_IS_ENABLED(win)) { + dc->windows[i].dirty = 1; tegra_dc_writel(dc, 0, DC_WIN_WIN_OPTIONS); continue; } -- cgit v1.2.3