|
@@ -2599,12 +2599,6 @@ bool dispc_ovl_enabled(enum omap_plane plane)
|
|
return REG_GET(DISPC_OVL_ATTRIBUTES(plane), 0, 0);
|
|
return REG_GET(DISPC_OVL_ATTRIBUTES(plane), 0, 0);
|
|
}
|
|
}
|
|
|
|
|
|
-static void dispc_mgr_disable_isr(void *data, u32 mask)
|
|
|
|
-{
|
|
|
|
- struct completion *compl = data;
|
|
|
|
- complete(compl);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
void dispc_mgr_enable(enum omap_channel channel, bool enable)
|
|
void dispc_mgr_enable(enum omap_channel channel, bool enable)
|
|
{
|
|
{
|
|
mgr_fld_write(channel, DISPC_MGR_FLD_ENABLE, enable);
|
|
mgr_fld_write(channel, DISPC_MGR_FLD_ENABLE, enable);
|
|
@@ -2617,175 +2611,6 @@ bool dispc_mgr_is_enabled(enum omap_channel channel)
|
|
return !!mgr_fld_read(channel, DISPC_MGR_FLD_ENABLE);
|
|
return !!mgr_fld_read(channel, DISPC_MGR_FLD_ENABLE);
|
|
}
|
|
}
|
|
|
|
|
|
-static void dispc_mgr_enable_lcd_out(enum omap_channel channel)
|
|
|
|
-{
|
|
|
|
- dispc_mgr_enable(channel, true);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static void dispc_mgr_disable_lcd_out(enum omap_channel channel)
|
|
|
|
-{
|
|
|
|
- DECLARE_COMPLETION_ONSTACK(framedone_compl);
|
|
|
|
- int r;
|
|
|
|
- u32 irq;
|
|
|
|
-
|
|
|
|
- if (dispc_mgr_is_enabled(channel) == false)
|
|
|
|
- return;
|
|
|
|
-
|
|
|
|
- /*
|
|
|
|
- * When we disable LCD output, we need to wait for FRAMEDONE to know
|
|
|
|
- * that DISPC has finished with the LCD output.
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
- irq = dispc_mgr_get_framedone_irq(channel);
|
|
|
|
-
|
|
|
|
- r = omap_dispc_register_isr(dispc_mgr_disable_isr, &framedone_compl,
|
|
|
|
- irq);
|
|
|
|
- if (r)
|
|
|
|
- DSSERR("failed to register FRAMEDONE isr\n");
|
|
|
|
-
|
|
|
|
- dispc_mgr_enable(channel, false);
|
|
|
|
-
|
|
|
|
- /* if we couldn't register for framedone, just sleep and exit */
|
|
|
|
- if (r) {
|
|
|
|
- msleep(100);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!wait_for_completion_timeout(&framedone_compl,
|
|
|
|
- msecs_to_jiffies(100)))
|
|
|
|
- DSSERR("timeout waiting for FRAME DONE\n");
|
|
|
|
-
|
|
|
|
- r = omap_dispc_unregister_isr(dispc_mgr_disable_isr, &framedone_compl,
|
|
|
|
- irq);
|
|
|
|
- if (r)
|
|
|
|
- DSSERR("failed to unregister FRAMEDONE isr\n");
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static void dispc_digit_out_enable_isr(void *data, u32 mask)
|
|
|
|
-{
|
|
|
|
- struct completion *compl = data;
|
|
|
|
-
|
|
|
|
- /* ignore any sync lost interrupts */
|
|
|
|
- if (mask & (DISPC_IRQ_EVSYNC_EVEN | DISPC_IRQ_EVSYNC_ODD))
|
|
|
|
- complete(compl);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static void dispc_mgr_enable_digit_out(void)
|
|
|
|
-{
|
|
|
|
- DECLARE_COMPLETION_ONSTACK(vsync_compl);
|
|
|
|
- int r;
|
|
|
|
- u32 irq_mask;
|
|
|
|
-
|
|
|
|
- if (dispc_mgr_is_enabled(OMAP_DSS_CHANNEL_DIGIT) == true)
|
|
|
|
- return;
|
|
|
|
-
|
|
|
|
- /*
|
|
|
|
- * Digit output produces some sync lost interrupts during the first
|
|
|
|
- * frame when enabling. Those need to be ignored, so we register for the
|
|
|
|
- * sync lost irq to prevent the error handler from triggering.
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
- irq_mask = dispc_mgr_get_vsync_irq(OMAP_DSS_CHANNEL_DIGIT) |
|
|
|
|
- dispc_mgr_get_sync_lost_irq(OMAP_DSS_CHANNEL_DIGIT);
|
|
|
|
-
|
|
|
|
- r = omap_dispc_register_isr(dispc_digit_out_enable_isr, &vsync_compl,
|
|
|
|
- irq_mask);
|
|
|
|
- if (r) {
|
|
|
|
- DSSERR("failed to register %x isr\n", irq_mask);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- dispc_mgr_enable(OMAP_DSS_CHANNEL_DIGIT, true);
|
|
|
|
-
|
|
|
|
- /* wait for the first evsync */
|
|
|
|
- if (!wait_for_completion_timeout(&vsync_compl, msecs_to_jiffies(100)))
|
|
|
|
- DSSERR("timeout waiting for digit out to start\n");
|
|
|
|
-
|
|
|
|
- r = omap_dispc_unregister_isr(dispc_digit_out_enable_isr, &vsync_compl,
|
|
|
|
- irq_mask);
|
|
|
|
- if (r)
|
|
|
|
- DSSERR("failed to unregister %x isr\n", irq_mask);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static void dispc_mgr_disable_digit_out(void)
|
|
|
|
-{
|
|
|
|
- DECLARE_COMPLETION_ONSTACK(framedone_compl);
|
|
|
|
- int r, i;
|
|
|
|
- u32 irq_mask;
|
|
|
|
- int num_irqs;
|
|
|
|
-
|
|
|
|
- if (dispc_mgr_is_enabled(OMAP_DSS_CHANNEL_DIGIT) == false)
|
|
|
|
- return;
|
|
|
|
-
|
|
|
|
- /*
|
|
|
|
- * When we disable the digit output, we need to wait for FRAMEDONE to
|
|
|
|
- * know that DISPC has finished with the output.
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
- irq_mask = dispc_mgr_get_framedone_irq(OMAP_DSS_CHANNEL_DIGIT);
|
|
|
|
- num_irqs = 1;
|
|
|
|
-
|
|
|
|
- if (!irq_mask) {
|
|
|
|
- /*
|
|
|
|
- * omap 2/3 don't have framedone irq for TV, so we need to use
|
|
|
|
- * vsyncs for this.
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
- irq_mask = dispc_mgr_get_vsync_irq(OMAP_DSS_CHANNEL_DIGIT);
|
|
|
|
- /*
|
|
|
|
- * We need to wait for both even and odd vsyncs. Note that this
|
|
|
|
- * is not totally reliable, as we could get a vsync interrupt
|
|
|
|
- * before we disable the output, which leads to timeout in the
|
|
|
|
- * wait_for_completion.
|
|
|
|
- */
|
|
|
|
- num_irqs = 2;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- r = omap_dispc_register_isr(dispc_mgr_disable_isr, &framedone_compl,
|
|
|
|
- irq_mask);
|
|
|
|
- if (r)
|
|
|
|
- DSSERR("failed to register %x isr\n", irq_mask);
|
|
|
|
-
|
|
|
|
- dispc_mgr_enable(OMAP_DSS_CHANNEL_DIGIT, false);
|
|
|
|
-
|
|
|
|
- /* if we couldn't register the irq, just sleep and exit */
|
|
|
|
- if (r) {
|
|
|
|
- msleep(100);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- for (i = 0; i < num_irqs; ++i) {
|
|
|
|
- if (!wait_for_completion_timeout(&framedone_compl,
|
|
|
|
- msecs_to_jiffies(100)))
|
|
|
|
- DSSERR("timeout waiting for digit out to stop\n");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- r = omap_dispc_unregister_isr(dispc_mgr_disable_isr, &framedone_compl,
|
|
|
|
- irq_mask);
|
|
|
|
- if (r)
|
|
|
|
- DSSERR("failed to unregister %x isr\n", irq_mask);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-void dispc_mgr_enable_sync(enum omap_channel channel)
|
|
|
|
-{
|
|
|
|
- if (dss_mgr_is_lcd(channel))
|
|
|
|
- dispc_mgr_enable_lcd_out(channel);
|
|
|
|
- else if (channel == OMAP_DSS_CHANNEL_DIGIT)
|
|
|
|
- dispc_mgr_enable_digit_out();
|
|
|
|
- else
|
|
|
|
- WARN_ON(1);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-void dispc_mgr_disable_sync(enum omap_channel channel)
|
|
|
|
-{
|
|
|
|
- if (dss_mgr_is_lcd(channel))
|
|
|
|
- dispc_mgr_disable_lcd_out(channel);
|
|
|
|
- else if (channel == OMAP_DSS_CHANNEL_DIGIT)
|
|
|
|
- dispc_mgr_disable_digit_out();
|
|
|
|
- else
|
|
|
|
- WARN_ON(1);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
void dispc_wb_enable(bool enable)
|
|
void dispc_wb_enable(bool enable)
|
|
{
|
|
{
|
|
dispc_ovl_enable(OMAP_DSS_WB, enable);
|
|
dispc_ovl_enable(OMAP_DSS_WB, enable);
|