summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/dc/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/tegra/dc/window.c')
-rw-r--r--drivers/video/tegra/dc/window.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/video/tegra/dc/window.c b/drivers/video/tegra/dc/window.c
index 0b4350d..cd91fab 100644
--- a/drivers/video/tegra/dc/window.c
+++ b/drivers/video/tegra/dc/window.c
@@ -24,6 +24,7 @@
#include "dc_priv.h"
static int no_vsync;
+static atomic_t frame_end_ref = ATOMIC_INIT(0);
module_param_named(no_vsync, no_vsync, int, S_IRUGO | S_IWUSR);
@@ -40,6 +41,17 @@ static bool tegra_dc_windows_are_clean(struct tegra_dc_win *windows[],
return true;
}
+int tegra_dc_config_frame_end_intr(struct tegra_dc *dc, bool enable)
+{
+ tegra_dc_writel(dc, FRAME_END_INT, DC_CMD_INT_STATUS);
+ if (enable) {
+ atomic_inc(&frame_end_ref);
+ tegra_dc_unmask_interrupt(dc, FRAME_END_INT);
+ } else if (!atomic_dec_return(&frame_end_ref))
+ tegra_dc_mask_interrupt(dc, FRAME_END_INT);
+ return 0;
+}
+
static int get_topmost_window(u32 *depths, unsigned long *wins)
{
int idx, best = -1;
@@ -406,8 +418,9 @@ int tegra_dc_update_windows(struct tegra_dc_win *windows[], int n)
FRAME_END_INT | V_BLANK_INT | ALL_UF_INT);
} else {
clear_bit(V_BLANK_FLIP, &dc->vblank_ref_count);
- tegra_dc_mask_interrupt(dc,
- FRAME_END_INT | V_BLANK_INT | ALL_UF_INT);
+ tegra_dc_mask_interrupt(dc, V_BLANK_INT | ALL_UF_INT);
+ if (!atomic_read(&frame_end_ref))
+ tegra_dc_mask_interrupt(dc, FRAME_END_INT);
}
if (dc->out->flags & TEGRA_DC_OUT_ONE_SHOT_MODE)
@@ -456,7 +469,8 @@ void tegra_dc_trigger_windows(struct tegra_dc *dc)
}
if (!dirty) {
- if (!(dc->out->flags & TEGRA_DC_OUT_ONE_SHOT_MODE))
+ if (!(dc->out->flags & TEGRA_DC_OUT_ONE_SHOT_MODE)
+ && !atomic_read(&frame_end_ref))
tegra_dc_mask_interrupt(dc, FRAME_END_INT);
}