e9a5dcc67aef0fbbec9dfdf295c529b82ba487d6
[openembedded.git] /
1 From 85848d329ca3a2d6ee6841cdc11cc5951d187931 Mon Sep 17 00:00:00 2001
2 From: =?utf-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@nokia.com>
3 Date: Fri, 3 Apr 2009 19:09:20 +0200
4 Subject: [PATCH 17/69] DSS2: Disable video planes on sync lost error
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=utf-8
7 Content-Transfer-Encoding: 8bit
8
9 When encountering the sync lost error disable the display and all video
10 planes on the affected manager. Afterwards re-enable the display.
11
12 Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
13 ---
14  drivers/video/omap2/dss/dispc.c |   50 +++++++++++++++++++++++++++++++++++++++
15  1 files changed, 50 insertions(+), 0 deletions(-)
16
17 diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
18 index 1bc23f7..41734f3 100644
19 --- a/drivers/video/omap2/dss/dispc.c
20 +++ b/drivers/video/omap2/dss/dispc.c
21 @@ -2518,29 +2518,79 @@ static void dispc_error_worker(struct work_struct *work)
22         }
23  
24         if (errors & DISPC_IRQ_SYNC_LOST) {
25 +               struct omap_overlay_manager *manager = NULL;
26 +               bool enable = false;
27 +
28                 DSSERR("SYNC_LOST, disabling LCD\n");
29 +
30                 for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
31                         struct omap_overlay_manager *mgr;
32                         mgr = omap_dss_get_overlay_manager(i);
33  
34                         if (mgr->id == OMAP_DSS_CHANNEL_LCD) {
35 +                               manager = mgr;
36 +                               enable = mgr->display->state ==
37 +                                               OMAP_DSS_DISPLAY_ACTIVE;
38                                 mgr->display->disable(mgr->display);
39                                 break;
40                         }
41                 }
42 +
43 +               if (manager) {
44 +                       for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
45 +                               struct omap_overlay *ovl;
46 +                               ovl = omap_dss_get_overlay(i);
47 +
48 +                               if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
49 +                                       continue;
50 +
51 +                               if (ovl->id != 0 && ovl->manager == manager)
52 +                                       dispc_enable_plane(ovl->id, 0);
53 +                       }
54 +
55 +                       dispc_go(manager->id);
56 +                       mdelay(50);
57 +                       if (enable)
58 +                               manager->display->enable(manager->display);
59 +               }
60         }
61  
62         if (errors & DISPC_IRQ_SYNC_LOST_DIGIT) {
63 +               struct omap_overlay_manager *manager = NULL;
64 +               bool enable = false;
65 +
66                 DSSERR("SYNC_LOST_DIGIT, disabling TV\n");
67 +
68                 for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
69                         struct omap_overlay_manager *mgr;
70                         mgr = omap_dss_get_overlay_manager(i);
71  
72                         if (mgr->id == OMAP_DSS_CHANNEL_DIGIT) {
73 +                               manager = mgr;
74 +                               enable = mgr->display->state ==
75 +                                               OMAP_DSS_DISPLAY_ACTIVE;
76                                 mgr->display->disable(mgr->display);
77                                 break;
78                         }
79                 }
80 +
81 +               if (manager) {
82 +                       for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
83 +                               struct omap_overlay *ovl;
84 +                               ovl = omap_dss_get_overlay(i);
85 +
86 +                               if (!(ovl->caps & OMAP_DSS_OVL_CAP_DISPC))
87 +                                       continue;
88 +
89 +                               if (ovl->id != 0 && ovl->manager == manager)
90 +                                       dispc_enable_plane(ovl->id, 0);
91 +                       }
92 +
93 +                       dispc_go(manager->id);
94 +                       mdelay(50);
95 +                       if (enable)
96 +                               manager->display->enable(manager->display);
97 +               }
98         }
99  
100         if (errors & DISPC_IRQ_OCP_ERR) {
101 -- 
102 1.6.2.4
103