]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: dc: Support vsync_irq for dsi panels
authorArun Swain <arswain@nvidia.com>
Mon, 12 Jan 2015 01:16:20 +0000 (17:16 -0800)
committerMitch Luban <mluban@nvidia.com>
Thu, 5 Feb 2015 23:24:18 +0000 (15:24 -0800)
1. In api _tegra_dc_vsync_enable(), for
TEGRA_DC_OUT_DSI panel types, we are waiting on
MSF_INT for vsync_irq and MSF_INT is expected
only for TEGRA_DC_OUT_ONE_SHOT_MODE panels. For
normal continuous mode panels, we should wait on
V_BLANK_INT.

2.In _tegra_dc_user_vsync_enable(), decrement
user_needs_vblank only when it is greater than 0.
Or else if it goes to negative values, it starts
behaving unexpectedly.

Change-Id: I93ca81fda520bbed6a0afd7e8d439d5c20e19a07
Signed-off-by: Arun Swain <arswain@nvidia.com>
Conflicts:
drivers/video/tegra/dc/dc.c
Reviewed-on: http://git-master/r/680840
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
drivers/video/tegra/dc/dc.c

index fe3e6acd20560a8abab42744f83be49670278a87..a07b447148314016a82207e532350d8295a66853 100644 (file)
@@ -2332,7 +2332,7 @@ static void _tegra_dc_vsync_enable(struct tegra_dc *dc)
 {
        int vsync_irq;
 
-       if (dc->out->type == TEGRA_DC_OUT_DSI)
+       if (dc->out->flags & TEGRA_DC_OUT_ONE_SHOT_MODE)
                vsync_irq = MSF_INT;
        else
                vsync_irq = V_BLANK_INT;
@@ -2389,7 +2389,8 @@ static void _tegra_dc_user_vsync_enable(struct tegra_dc *dc, bool enable)
                _tegra_dc_vsync_enable(dc);
        } else {
                _tegra_dc_vsync_disable(dc);
-               dc->out->user_needs_vblank--;
+               if (dc->out->user_needs_vblank > 0)
+                       dc->out->user_needs_vblank--;
        }
 }
 
@@ -2805,8 +2806,13 @@ static void tegra_dc_continuous_irq(struct tegra_dc *dc, unsigned long status,
        if (status & V_BLANK_INT)
                queue_work(system_freezable_wq, &dc->vblank_work);
 
-       if (status & V_BLANK_INT)
+       if (status & (V_BLANK_INT | MSF_INT)) {
+               if (dc->out->user_needs_vblank) {
+                       dc->out->user_needs_vblank = false;
+                       complete(&dc->out->user_vblank_comp);
+               }
                tegra_dc_process_vblank(dc, timestamp);
+       }
 
        if (status & FRAME_END_INT) {
                struct timespec tm = CURRENT_TIME;