From e296264977f68ddf395b8f93f8e174930f88499a Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 1 Dec 2009 13:23:25 +0200 Subject: [PATCH] OMAP: DSS2: Check ctx loss count only when starting the first clock When OMAP PM layer is no-op/debug, the PM layer will increment context loss count with every call. This resulted DSS2 to restore context whenever a clock was enabled. This commit checks the context loss count only when the context actually could have been lost, ie. when enabling a clock when no clocks had been previously enabled. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 5939da9cf021..72547dfc56b8 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -289,9 +289,11 @@ static void dss_clk_enable_no_ctx(enum dss_clock clks) void dss_clk_enable(enum dss_clock clks) { + bool check_ctx = core.num_clks_enabled == 0; + dss_clk_enable_no_ctx(clks); - if (cpu_is_omap34xx() && dss_need_ctx_restore()) + if (check_ctx && cpu_is_omap34xx() && dss_need_ctx_restore()) restore_all_ctx(); } -- 2.39.5