Skip to content

Commit

Permalink
OMAP: DSS2: DSS: Fix context save/restore
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tomi Valkeinen committed Jul 25, 2011
1 parent 49ea86f commit 69f0605
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/video/omap2/dss/dss.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ static struct {
enum omap_dss_clk_source dispc_clk_source;
enum omap_dss_clk_source lcd_clk_source[MAX_DSS_LCD_MANAGERS];

bool ctx_valid;
u32 ctx[DSS_SZ_REGS / sizeof(u32)];
} dss;

Expand Down Expand Up @@ -109,19 +110,28 @@ static void dss_save_context(void)
SR(SDI_CONTROL);
SR(PLL_CONTROL);
}

dss.ctx_valid = true;

DSSDBG("context saved\n");
}

static void dss_restore_context(void)
{
DSSDBG("dss_restore_context\n");

if (!dss.ctx_valid)
return;

RR(CONTROL);

if (dss_feat_get_supported_displays(OMAP_DSS_CHANNEL_LCD) &
OMAP_DISPLAY_TYPE_SDI) {
RR(SDI_CONTROL);
RR(PLL_CONTROL);
}

DSSDBG("context restored\n");
}

#undef SR
Expand Down

0 comments on commit 69f0605

Please sign in to comment.