aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-06-01 08:56:39 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-07-25 03:22:07 -0400
commit69f06054aad122b314cd64fdafdf14fc3b8e5b7c (patch)
treee0ac81c853ca05d9ad822c6dd400a1ef5e5103ec /drivers/video/omap2
parent49ea86f3fae21dd0334668b621e9c88f43a73c86 (diff)
OMAP: DSS2: DSS: Fix context save/restore
The current method of saving and restoring the context could cause a restore before saving, effectively "restoring" zero values to registers. Add ctx_valid field to indicate if the saved context is valid and can be restored. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/dss/dss.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 2424064c9cef..9423a2ee3aac 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -74,6 +74,7 @@ static struct {
74 enum omap_dss_clk_source dispc_clk_source; 74 enum omap_dss_clk_source dispc_clk_source;
75 enum omap_dss_clk_source lcd_clk_source[MAX_DSS_LCD_MANAGERS]; 75 enum omap_dss_clk_source lcd_clk_source[MAX_DSS_LCD_MANAGERS];
76 76
77 bool ctx_valid;
77 u32 ctx[DSS_SZ_REGS / sizeof(u32)]; 78 u32 ctx[DSS_SZ_REGS / sizeof(u32)];
78} dss; 79} dss;
79 80
@@ -109,12 +110,19 @@ static void dss_save_context(void)
109 SR(SDI_CONTROL); 110 SR(SDI_CONTROL);
110 SR(PLL_CONTROL); 111 SR(PLL_CONTROL);
111 } 112 }
113
114 dss.ctx_valid = true;
115
116 DSSDBG("context saved\n");
112} 117}
113 118
114static void dss_restore_context(void) 119static void dss_restore_context(void)
115{ 120{
116 DSSDBG("dss_restore_context\n"); 121 DSSDBG("dss_restore_context\n");
117 122
123 if (!dss.ctx_valid)
124 return;
125
118 RR(CONTROL); 126 RR(CONTROL);
119 127
120 if (dss_feat_get_supported_displays(OMAP_DSS_CHANNEL_LCD) & 128 if (dss_feat_get_supported_displays(OMAP_DSS_CHANNEL_LCD) &
@@ -122,6 +130,8 @@ static void dss_restore_context(void)
122 RR(SDI_CONTROL); 130 RR(SDI_CONTROL);
123 RR(PLL_CONTROL); 131 RR(PLL_CONTROL);
124 } 132 }
133
134 DSSDBG("context restored\n");
125} 135}
126 136
127#undef SR 137#undef SR