DSS2: Disable video planes on sync lost error
authorVille Syrjälä <ville.syrjala@nokia.com>
Fri, 3 Apr 2009 17:09:20 +0000 (19:09 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Fri, 1 May 2009 16:45:00 +0000 (19:45 +0300)
When encountering the sync lost error disable the display and all video
planes on the affected manager. Afterwards re-enable the display.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
drivers/video/omap2/dss/dispc.c

index 1bc23f7..41734f3 100644 (file)
@@ -2518,29 +2518,79 @@ static void dispc_error_worker(struct work_struct *work)
        }
 
        if (errors & DISPC_IRQ_SYNC_LOST) {
+               struct omap_overlay_manager *manager = NULL;
+               bool enable = false;
+
                DSSERR("SYNC_LOST, disabling LCD\n");
+
                for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
                        struct omap_overlay_manager *mgr;
                        mgr = omap_dss_get_overlay_manager(i);
 
                        if (mgr->id == OMAP_DSS_CHANNEL_LCD) {
+                               manager = mgr;
+                               enable = mgr->display->state ==
+                                               OMAP_DSS_DISPLAY_ACTIVE;
                                mgr->display->disable(mgr->display);
                                break;
                        }
                }
+
+               if (manager) {
+                       for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
+                               struct omap_overlay *ovl;
+                               ovl = omap_dss_get_overlay(i);
+
+                               if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
+                                       continue;
+
+                               if (ovl->id != 0 && ovl->manager == manager)
+                                       dispc_enable_plane(ovl->id, 0);
+                       }
+
+                       dispc_go(manager->id);
+                       mdelay(50);
+                       if (enable)
+                               manager->display->enable(manager->display);
+               }
        }
 
        if (errors & DISPC_IRQ_SYNC_LOST_DIGIT) {
+               struct omap_overlay_manager *manager = NULL;
+               bool enable = false;
+
                DSSERR("SYNC_LOST_DIGIT, disabling TV\n");
+
                for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
                        struct omap_overlay_manager *mgr;
                        mgr = omap_dss_get_overlay_manager(i);
 
                        if (mgr->id == OMAP_DSS_CHANNEL_DIGIT) {
+                               manager = mgr;
+                               enable = mgr->display->state ==
+                                               OMAP_DSS_DISPLAY_ACTIVE;
                                mgr->display->disable(mgr->display);
                                break;
                        }
                }
+
+               if (manager) {
+                       for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
+                               struct omap_overlay *ovl;
+                               ovl = omap_dss_get_overlay(i);
+
+                               if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
+                                       continue;
+
+                               if (ovl->id != 0 && ovl->manager == manager)
+                                       dispc_enable_plane(ovl->id, 0);
+                       }
+
+                       dispc_go(manager->id);
+                       mdelay(50);
+                       if (enable)
+                               manager->display->enable(manager->display);
+               }
        }
 
        if (errors & DISPC_IRQ_OCP_ERR) {